15 #include <type_traits>
25 namespace CoreFactory {
29 virtual std::shared_ptr<Core> build(std::string_view name) = 0;
33 template<
class CoreTYPE>
36 static_assert(std::is_base_of<Core, CoreTYPE>::value,
37 "Type does not inherit from helics::Core");
39 using core_build_type = CoreTYPE;
40 virtual std::shared_ptr<Core> build(std::string_view name)
override
42 return std::make_shared<CoreTYPE>(name);
48 defineCoreBuilder(std::shared_ptr<CoreBuilder> cb, std::string_view coreTypeName,
int code);
51 template<
class CoreTYPE>
52 std::shared_ptr<CoreBuilder>
addCoreType(std::string_view coreTypeName,
int code)
54 auto bld = std::make_shared<CoreTypeBuilder<CoreTYPE>>();
55 std::shared_ptr<CoreBuilder> cbld = std::static_pointer_cast<CoreBuilder>(bld);
56 defineCoreBuilder(cbld, coreTypeName, code);
69 create(
CoreType type, std::string_view coreName, std::string_view configureString);
75 std::shared_ptr<Core> create(
CoreType type, std::string_view configureString);
82 std::shared_ptr<Core> create(
CoreType type,
int argc,
char* argv[]);
90 std::shared_ptr<Core> create(std::vector<std::string> args);
96 std::shared_ptr<Core> create(
CoreType type, std::vector<std::string> args);
105 std::shared_ptr<Core> create(
int argc,
char* argv[]);
114 std::shared_ptr<Core> create(
CoreType type, std::string_view coreName,
int argc,
char* argv[]);
122 std::shared_ptr<Core>
123 create(
CoreType type, std::string_view coreName, std::vector<std::string> args);
127 std::shared_ptr<Core>
132 std::shared_ptr<Core>
137 std::shared_ptr<Core>
145 std::shared_ptr<Core>
findCore(std::string_view name);
194 void abortAllCores(
int errorCode, std::string_view errorString);