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

Method build

src/Factory/Module/Source/Source.cpp:84–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82
83template<typename B>
84spu::module::Source<B>*
85Source ::build() const
86{
87 if (this->type == "RAND")
88 {
89 if (this->implem == "STD")
90 return new spu::module::Source_random<B>(this->K, this->seed);
91 else if (this->implem == "FAST")
92 return new module::Source_random_fast<B>(this->K, this->seed);
93 }
94
95 if (this->type == "AZCW") return new spu::module::Source_AZCW<B>(this->K);
96 if (this->type == "USER") return new spu::module::Source_user<B>(this->K, this->path, this->start_idx);
97
98 if (this->type == "USER_BIN")
99 return new spu::module::Source_user_binary<B>(this->K, this->path, this->auto_reset, this->fifo_mode);
100
101 throw spu::tools::cannot_allocate(__FILE__, __LINE__, __func__);
102}
103
104// ==================================================================================== explicit template instantiation
105#include "Tools/types.h"

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected