 |
helics
3.0.1
|
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(
CoreType type,
const std::string& coreName,
const std::string& configureString);
73 std::shared_ptr<Core> create(
CoreType type,
const std::string& configureString);
80 std::shared_ptr<Core> create(
CoreType type,
int argc,
char* argv[]);
88 std::shared_ptr<Core> create(std::vector<std::string> args);
94 std::shared_ptr<Core> create(
CoreType type, std::vector<std::string> args);
103 std::shared_ptr<Core> create(
int argc,
char* argv[]);
112 std::shared_ptr<Core>
113 create(
CoreType type,
const std::string& coreName,
int argc,
char* argv[]);
121 std::shared_ptr<Core>
122 create(
CoreType 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);
183 bool copyCoreIdentifier(
const std::string& copyFromName,
const std::string& copyToName);
191 void abortAllCores(
int errorCode,
const std::string& errorString);
bool registerCore(const std::shared_ptr< Core > &core, CoreType type)
Definition: CoreFactory.cpp:305
CoreType
Definition: CoreTypes.hpp:36
std::shared_ptr< Core > findJoinableCoreOfType(CoreType type)
Definition: CoreFactory.cpp:280
Definition: CommonCore.hpp:73
Definition: helicsCLI11.hpp:41
std::shared_ptr< Core > FindOrCreate(CoreType type, const std::string &coreName, std::vector< std::string > args)
Definition: CoreFactory.cpp:189
Definition: core-exceptions.hpp:84
Definition: CoreFactory.hpp:34
void terminateAllCores()
Definition: CoreFactory.cpp:330
size_t getCoreCount()
Definition: CoreFactory.cpp:349
void unregisterCore(const std::string &name)
Definition: CoreFactory.cpp:358
void displayHelp(CoreType type)
Definition: CoreFactory.cpp:373
std::shared_ptr< Core > findCore(const std::string &name)
Definition: CoreFactory.cpp:275
the main namespace for the helics co-simulation library User functions will be in the helics namespac...
Definition: AsyncFedCallInfo.hpp:14
size_t cleanUpCores()
Definition: CoreFactory.cpp:320
void abortAllCores(int errorCode, const std::string &errorString)
Definition: CoreFactory.cpp:339
std::shared_ptr< Core > getEmptyCore()
Definition: CoreFactory.cpp:95
std::shared_ptr< CoreBuilder > addCoreType(const std::string &coreTypeName, int code)
Definition: CoreFactory.hpp:53
virtual void processDisconnect(bool skipUnregister=false) override final
Definition: CommonCore.cpp:192
bool copyCoreIdentifier(const std::string ©FromName, const std::string ©ToName)
Definition: CoreFactory.cpp:353
void addAssociatedCoreType(const std::string &name, CoreType type)
Definition: CoreFactory.cpp:365
constexpr LocalFederateId gLocalCoreId(-259)
Definition: CoreFactory.hpp:27
Definition: core-exceptions.hpp:18