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::Broker");
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);
46 std::string_view name,
50 template<
class BrokerTYPE>
51 std::shared_ptr<BrokerBuilder>
addBrokerType(std::string_view brokerTypeName,
int code)
53 auto bld = std::make_shared<BrokerTypeBuilder<BrokerTYPE>>();
54 std::shared_ptr<BrokerBuilder> bbld = std::static_pointer_cast<BrokerBuilder>(bld);
64 std::shared_ptr<Broker>
create(
CoreType type, std::string_view configureString);
66 std::shared_ptr<Broker>
create(
CoreType type,
int argc,
char* argv[]);
68 std::shared_ptr<Broker>
create(
CoreType type, std::vector<std::string> args);
70 std::shared_ptr<Broker>
71 create(
CoreType type, std::string_view brokerName, std::string_view configureString);
73 std::shared_ptr<Broker>
74 create(
CoreType type, std::string_view brokerName,
int argc,
char* argv[]);
77 std::shared_ptr<Broker>
78 create(
CoreType type, std::string_view brokerName, std::vector<std::string> args);
83 std::shared_ptr<Broker>
findBroker(std::string_view brokerName);
Definition: BrokerFactory.hpp:24
virtual std::shared_ptr< Broker > build(std::string_view name)=0
Definition: BrokerFactory.hpp:32
virtual std::shared_ptr< Broker > build(std::string_view name) override
Definition: BrokerFactory.hpp:38
std::shared_ptr< BrokerBuilder > addBrokerType(std::string_view brokerTypeName, int code)
Definition: BrokerFactory.hpp:51
std::shared_ptr< Broker > create(CoreType type, std::string_view configureString)
Definition: BrokerFactory.cpp:104
void unregisterBroker(std::string_view name)
Definition: BrokerFactory.cpp:337
void displayHelp(CoreType type)
Definition: BrokerFactory.cpp:354
bool copyBrokerIdentifier(std::string_view copyFromName, std::string_view copyToName)
Definition: BrokerFactory.cpp:332
void abortAllBrokers(int errorCode, std::string_view errorString)
Definition: BrokerFactory.cpp:319
std::vector< std::shared_ptr< Broker > > getAllBrokers()
Definition: BrokerFactory.cpp:252
std::shared_ptr< Broker > getConnectedBroker()
Definition: BrokerFactory.cpp:235
std::shared_ptr< Broker > findBroker(std::string_view brokerName)
Definition: BrokerFactory.cpp:218
std::shared_ptr< Broker > findJoinableBrokerOfType(CoreType type)
Definition: BrokerFactory.cpp:246
void defineBrokerBuilder(std::shared_ptr< BrokerBuilder > builder, std::string_view name, int code)
Definition: BrokerFactory.cpp:88
void terminateAllBrokers()
Definition: BrokerFactory.cpp:310
void addAssociatedBrokerType(std::string_view name, CoreType type)
Definition: BrokerFactory.cpp:345
size_t cleanUpBrokers()
Definition: BrokerFactory.cpp:301
bool brokersActive()
Definition: BrokerFactory.cpp:257
std::shared_ptr< Broker > getBrokerByIndex(size_t index)
Definition: BrokerFactory.cpp:240
bool registerBroker(const std::shared_ptr< Broker > &broker, CoreType type)
Definition: BrokerFactory.cpp:281
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