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);
47 void defineCoreBuilder(std::shared_ptr<CoreBuilder> builder,
48 std::string_view coreTypeName,
52 template<
class CoreTYPE>
53 std::shared_ptr<CoreBuilder>
addCoreType(std::string_view 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);
70 create(
CoreType type, std::string_view coreName, std::string_view configureString);
76 std::shared_ptr<Core> create(
CoreType type, std::string_view configureString);
83 std::shared_ptr<Core> create(
CoreType type,
int argc,
char* argv[]);
91 std::shared_ptr<Core> create(std::vector<std::string> args);
97 std::shared_ptr<Core> create(
CoreType type, std::vector<std::string> args);
106 std::shared_ptr<Core> create(
int argc,
char* argv[]);
115 std::shared_ptr<Core> create(
CoreType type, std::string_view coreName,
int argc,
char* argv[]);
123 std::shared_ptr<Core>
124 create(
CoreType type, std::string_view coreName, std::vector<std::string> args);
128 std::shared_ptr<Core>
133 std::shared_ptr<Core>
138 std::shared_ptr<Core>
146 std::shared_ptr<Core>
findCore(std::string_view name);
195 void abortAllCores(
int errorCode, std::string_view errorString);
Definition: CoreFactory.hpp:27
Definition: CoreFactory.hpp:34
Definition: core/Core.hpp:41
void unregisterCore(std::string_view name)
Definition: CoreFactory.cpp:389
size_t cleanUpCores()
Definition: CoreFactory.cpp:346
void abortAllCores(int errorCode, std::string_view errorString)
Definition: CoreFactory.cpp:365
std::vector< std::string > getAvailableCoreTypes()
Definition: CoreFactory.cpp:94
std::shared_ptr< Core > getEmptyCore()
Definition: CoreFactory.cpp:120
Core * getEmptyCorePtr()
Definition: CoreFactory.cpp:125
std::shared_ptr< CoreBuilder > addCoreType(std::string_view coreTypeName, int code)
Definition: CoreFactory.hpp:53
std::shared_ptr< Core > FindOrCreate(CoreType type, std::string_view coreName, std::vector< std::string > args)
Definition: CoreFactory.cpp:220
bool registerCore(const std::shared_ptr< Core > &core, CoreType type)
Definition: CoreFactory.cpp:332
void terminateAllCores()
Definition: CoreFactory.cpp:356
void addAssociatedCoreType(std::string_view name, CoreType type)
Definition: CoreFactory.cpp:396
void displayHelp(CoreType type)
Definition: CoreFactory.cpp:404
std::shared_ptr< Core > findCore(std::string_view name)
Definition: CoreFactory.cpp:302
bool copyCoreIdentifier(std::string_view copyFromName, std::string_view copyToName)
Definition: CoreFactory.cpp:384
size_t getCoreCount()
Definition: CoreFactory.cpp:380
std::shared_ptr< Core > findJoinableCoreOfType(CoreType type)
Definition: CoreFactory.cpp:307
the main namespace for the helics co-simulation library User functions will be in the helics namespac...
Definition: AsyncFedCallInfo.hpp:14
CoreType
Definition: CoreTypes.hpp:46