15 #include <type_traits>
25 namespace CoreFactory {
29 virtual std::shared_ptr<Core> build(
const std::string& 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(
const std::string& name)
override
42 return std::make_shared<CoreTYPE>(name);
47 void defineCoreBuilder(std::shared_ptr<CoreBuilder> cb,
48 const std::string& coreTypeName,
52 template<
class CoreTYPE>
53 std::shared_ptr<CoreBuilder>
addCoreType(
const std::string& coreTypeName,
int code)
55 auto bld = std::make_shared<CoreTypeBuilder<CoreTYPE>>();
56 std::shared_ptr<CoreBuilder> cbld = std::static_pointer_cast<CoreBuilder>(bld);
57 defineCoreBuilder(cbld, coreTypeName, code);
67 create(
core_type type,
const std::string& coreName,
const std::string& configureString);
73 std::shared_ptr<Core> create(
core_type type,
const std::string& configureString);
80 std::shared_ptr<Core> create(
core_type type,
int argc,
char* argv[]);
88 std::shared_ptr<Core> create(std::vector<std::string> args);
94 std::shared_ptr<Core> create(
core_type type, std::vector<std::string> args);
103 std::shared_ptr<Core> create(
int argc,
char* argv[]);
112 std::shared_ptr<Core>
113 create(
core_type type,
const std::string& coreName,
int argc,
char* argv[]);
121 std::shared_ptr<Core>
122 create(
core_type type,
const std::string& coreName, std::vector<std::string> args);
127 const std::string& coreName,
128 const std::string& configureString);
132 std::shared_ptr<Core>
137 std::shared_ptr<Core>
145 std::shared_ptr<Core>
findCore(
const std::string& name);
179 bool copyCoreIdentifier(
const std::string& copyFromName,
const std::string& copyToName);
187 void abortAllCores(
int errorCode,
const std::string& errorString);