 |
helics
2.8.1
|
15 #include <type_traits>
22 namespace BrokerFactory {
27 virtual std::shared_ptr<Broker>
build(
const std::string& name) = 0;
31 template<
class BrokerTYPE>
34 static_assert(std::is_base_of<Broker, BrokerTYPE>::value,
35 "Type does not inherit from helics::Core");
37 using broker_build_type = BrokerTYPE;
38 virtual std::shared_ptr<Broker>
build(
const std::string& name)
override
40 return std::make_shared<BrokerTYPE>(name);
45 void defineBrokerBuilder(std::shared_ptr<BrokerBuilder> cb,
const std::string& name,
int code);
48 template<
class BrokerTYPE>
49 std::shared_ptr<BrokerBuilder>
addBrokerType(
const std::string& brokerTypeName,
int code)
51 auto bld = std::make_shared<BrokerTypeBuilder<BrokerTYPE>>();
52 std::shared_ptr<BrokerBuilder> bbld = std::static_pointer_cast<BrokerBuilder>(bld);
61 std::shared_ptr<Broker>
create(
core_type type,
const std::string& configureString);
65 std::shared_ptr<Broker>
create(
core_type type, std::vector<std::string> args);
67 std::shared_ptr<Broker>
68 create(
core_type type,
const std::string& brokerName,
const std::string& configureString);
70 std::shared_ptr<Broker>
71 create(
core_type type,
const std::string& brokerName,
int argc,
char* argv[]);
74 std::shared_ptr<Broker>
75 create(
core_type type,
const std::string& brokerName, std::vector<std::string> args);
80 std::shared_ptr<Broker>
findBroker(
const std::string& brokerName);
size_t cleanUpBrokers()
Definition: BrokerFactory.cpp:266
bool copyBrokerIdentifier(const std::string ©FromName, const std::string ©ToName)
Definition: BrokerFactory.cpp:290
core_type
Definition: core-types.hpp:37
bool brokersActive()
Definition: BrokerFactory.cpp:225
std::shared_ptr< Broker > getConnectedBroker()
Definition: BrokerFactory.cpp:206
Definition: core/BrokerFactory.hpp:32
Definition: core/BrokerFactory.hpp:24
void displayHelp(core_type type)
Definition: BrokerFactory.cpp:311
void defineBrokerBuilder(std::shared_ptr< BrokerBuilder > cb, const std::string &name, int code)
Definition: BrokerFactory.cpp:84
void unregisterBroker(const std::string &name)
Definition: BrokerFactory.cpp:295
std::shared_ptr< Broker > getBrokerByIndex(size_t index)
Definition: BrokerFactory.cpp:211
@ DEFAULT
ZMQ if available or UDP.
Definition: core-exceptions.hpp:85
@ INPROC
core/broker using a stripped down in process core type
std::shared_ptr< Broker > findBroker(const std::string &brokerName)
Definition: BrokerFactory.cpp:185
void addAssociatedBrokerType(const std::string &name, core_type type)
Definition: BrokerFactory.cpp:303
void abortAllBrokers(int errorCode, const std::string &errorString)
Definition: BrokerFactory.cpp:281
std::shared_ptr< Broker > findJoinableBrokerOfType(core_type type)
Definition: BrokerFactory.cpp:217
@ IPC
same as INTERPROCESS
@ INTERPROCESS
use when all federates are on the same machine
std::shared_ptr< Broker > create(core_type type, const std::string &configureString)
Definition: BrokerFactory.cpp:100
the main namespace for the helics co-simulation library User functions will be in the helics namespac...
Definition: AsyncFedCallInfo.hpp:14
bool registerBroker(const std::shared_ptr< Broker > &broker, core_type type)
Definition: BrokerFactory.cpp:246
std::shared_ptr< BrokerBuilder > addBrokerType(const std::string &brokerTypeName, int code)
Definition: core/BrokerFactory.hpp:49
virtual std::shared_ptr< Broker > build(const std::string &name) override
Definition: core/BrokerFactory.hpp:38
void terminateAllBrokers()
Definition: BrokerFactory.cpp:272
std::vector< std::shared_ptr< Broker > > getAllBrokers()
Definition: BrokerFactory.cpp:223
virtual std::shared_ptr< Broker > build(const std::string &name)=0
@ NULLCORE
explicit core type that doesn't exist
Definition: core-exceptions.hpp:18
@ TEST
use the Test core if all federates are in the same process