 |
helics
3.3.0
|
15 #include <type_traits>
22 namespace BrokerFactory {
27 virtual std::shared_ptr<Broker>
build(std::string_view 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(std::string_view name)
override
40 return std::make_shared<BrokerTYPE>(name);
45 void defineBrokerBuilder(std::shared_ptr<BrokerBuilder> cb, std::string_view name,
int code);
48 template<
class BrokerTYPE>
49 std::shared_ptr<BrokerBuilder>
addBrokerType(std::string_view 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(
CoreType type, std::string_view configureString);
63 std::shared_ptr<Broker>
create(
CoreType type,
int argc,
char* argv[]);
65 std::shared_ptr<Broker>
create(
CoreType type, std::vector<std::string> args);
67 std::shared_ptr<Broker>
68 create(
CoreType type, std::string_view brokerName, std::string_view configureString);
70 std::shared_ptr<Broker>
71 create(
CoreType type, std::string_view brokerName,
int argc,
char* argv[]);
74 std::shared_ptr<Broker>
75 create(
CoreType type, std::string_view brokerName, std::vector<std::string> args);
80 std::shared_ptr<Broker>
findBroker(std::string_view brokerName);
std::vector< std::shared_ptr< Broker > > getAllBrokers()
Definition: BrokerFactory.cpp:217
Definition: BrokerFactory.cpp:25
CoreType
Definition: CoreTypes.hpp:36
std::shared_ptr< Broker > getConnectedBroker()
Definition: BrokerFactory.cpp:200
@ INPROC
core/broker using a stripped down in process core type
size_t cleanUpBrokers()
Definition: BrokerFactory.cpp:266
void addAssociatedBrokerType(std::string_view name, CoreType type)
Definition: BrokerFactory.cpp:310
Definition: BrokerFactory.hpp:32
Definition: BrokerFactory.hpp:24
void displayHelp(CoreType type)
Definition: BrokerFactory.cpp:319
virtual std::shared_ptr< Broker > build(std::string_view name)=0
@ DEFAULT
ZMQ if available or UDP.
std::shared_ptr< Broker > create(CoreType type, std::string_view configureString)
Definition: BrokerFactory.cpp:99
bool copyBrokerIdentifier(std::string_view copyFromName, std::string_view copyToName)
Definition: BrokerFactory.cpp:297
std::shared_ptr< Broker > getBrokerByIndex(size_t index)
Definition: BrokerFactory.cpp:205
Definition: core-exceptions.hpp:85
std::shared_ptr< Broker > findBroker(std::string_view brokerName)
Definition: BrokerFactory.cpp:183
virtual std::shared_ptr< Broker > build(std::string_view name) override
Definition: BrokerFactory.hpp:38
bool brokersActive()
Definition: BrokerFactory.cpp:222
@ INTERPROCESS
use when all federates are on the same machine
@ TEST
use the Test core if all federates are in the same process
bool registerBroker(const std::shared_ptr< Broker > &broker, CoreType type)
Definition: BrokerFactory.cpp:246
the main namespace for the helics co-simulation library User functions will be in the helics namespac...
Definition: AsyncFedCallInfo.hpp:14
void defineBrokerBuilder(std::shared_ptr< BrokerBuilder > cb, std::string_view name, int code)
Definition: BrokerFactory.cpp:83
void terminateAllBrokers()
Definition: BrokerFactory.cpp:275
std::shared_ptr< BrokerBuilder > addBrokerType(std::string_view brokerTypeName, int code)
Definition: BrokerFactory.hpp:49
@ IPC
same as INTERPROCESS
void abortAllBrokers(int errorCode, std::string_view errorString)
Definition: BrokerFactory.cpp:284
std::shared_ptr< Broker > findJoinableBrokerOfType(CoreType type)
Definition: BrokerFactory.cpp:211
Definition: core-exceptions.hpp:18
void unregisterBroker(std::string_view name)
Definition: BrokerFactory.cpp:302
@ NULLCORE
explicit core type that doesn't exist