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

Method build

src/Factory/Module/Modem/Modem.cpp:283–305  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

281
282template<typename B, typename R, typename Q>
283module::Modem<B, R, Q>*
284Modem ::build(const tools::Constellation<R>* cstl) const
285{
286 if (this->type == "SCMA" && this->implem == "STD")
287 {
288 return _build_scma<B, R, Q>();
289 }
290 else if (this->type == "OOK" && this->implem == "STD")
291 {
292 if (channel_type == "AWGN") return new module::Modem_OOK_AWGN<B, R, Q>(this->N, this->no_sig2);
293 if (channel_type == "BEC") return new module::Modem_OOK_BEC<B, R, Q>(this->N);
294 if (channel_type == "BSC") return new module::Modem_OOK_BSC<B, R, Q>(this->N);
295 }
296 else
297 {
298 if (this->max == "MAX") return _build<B, R, Q, tools::max<Q>, tools::max_i<Q>>(cstl);
299 if (this->max == "MAXL") return _build<B, R, Q, tools::max_linear<Q>, tools::max_linear_i<Q>>(cstl);
300 if (this->max == "MAXS") return _build<B, R, Q, tools::max_star<Q>, tools::max_star_i<Q>>(cstl);
301 if (this->max == "MAXSS") return _build<B, R, Q, tools::max_star_safe<Q>, tools::max_star_safe_i<Q>>(cstl);
302 }
303
304 throw spu::tools::cannot_allocate(__FILE__, __LINE__, __func__);
305}
306
307template<typename B, typename R, typename Q>
308module::Modem<B, R, Q>*

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected