MCPcopy Create free account
hub / github.com/aff3ct/aff3ct / _build

Method _build

src/Factory/Module/Modem/Modem.cpp:234–260  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

232
233template<typename B, typename R, typename Q, tools::proto_max<Q> MAX, tools::proto_max_i<Q> MAXI>
234module::Modem<B, R, Q>*
235Modem ::_build(const tools::Constellation<R>* cstl) const
236{
237 if (this->type == "BPSK" && this->implem == "STD") return new module::Modem_BPSK<B, R, Q>(this->N, this->no_sig2);
238 if (this->type == "BPSK" && this->implem == "FAST")
239 return new module::Modem_BPSK_fast<B, R, Q>(this->N, this->no_sig2);
240 if (this->type == "CPM" && this->implem == "STD")
241 return new module::Modem_CPM<B, R, Q, MAX>(this->N,
242 this->bps,
243 this->cpm_upf,
244 this->cpm_L,
245 this->cpm_k,
246 this->cpm_p,
247 this->cpm_mapping,
248 this->cpm_wave_shape,
249 this->no_sig2);
250
251 if (cstl != nullptr)
252 {
253 if (this->implem == "FAST")
254 return new module::Modem_generic_fast<B, R, Q, MAX, MAXI>(N, *cstl, this->no_sig2);
255 else
256 return new module::Modem_generic<B, R, Q, MAX>(N, *cstl, this->no_sig2);
257 }
258
259 throw spu::tools::cannot_allocate(__FILE__, __LINE__, __func__);
260}
261
262template<typename B, typename R, typename Q>
263module::Modem<B, R, Q>*

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected