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

Method build

src/Factory/Module/Channel/Channel.cpp:206–232  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

204
205template<typename R>
206module::Channel<R>*
207Channel ::build() const
208{
209 try
210 {
211 return build_gaussian<R>();
212 }
213 catch (spu::tools::cannot_allocate&)
214 {
215 }
216
217 try
218 {
219 return build_event<R>();
220 }
221 catch (spu::tools::cannot_allocate&)
222 {
223 }
224
225 if (type == "USER") return new module::Channel_user<R>(this->N, this->path, this->add_users);
226 if (type == "USER_ADD") return new module::Channel_user_add<R>(this->N, this->path, this->add_users);
227 if (type == "USER_BEC") return new module::Channel_user_be<R>(this->N, this->path);
228 if (type == "USER_BSC") return new module::Channel_user_bs<R>(this->N, this->path);
229 if (type == "NO") return new module::Channel_NO<R>(this->N, this->add_users);
230
231 throw spu::tools::cannot_allocate(__FILE__, __LINE__, __func__);
232}
233
234template<typename R>
235module::Channel<R>*

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected