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);
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);
63 std::shared_ptr<Broker>
create(
CoreType type, std::string_view configureString);
65 std::shared_ptr<Broker>
create(
CoreType type,
int argc,
char* argv[]);
67 std::shared_ptr<Broker>
create(
CoreType type, std::vector<std::string> args);
69 std::shared_ptr<Broker>
70 create(
CoreType type, std::string_view brokerName, std::string_view configureString);
72 std::shared_ptr<Broker>
73 create(
CoreType type, std::string_view brokerName,
int argc,
char* argv[]);
76 std::shared_ptr<Broker>
77 create(
CoreType type, std::string_view brokerName, std::vector<std::string> args);
82 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:99
void unregisterBroker(std::string_view name)
Definition: BrokerFactory.cpp:299
void displayHelp(CoreType type)
Definition: BrokerFactory.cpp:316
bool copyBrokerIdentifier(std::string_view copyFromName, std::string_view copyToName)
Definition: BrokerFactory.cpp:294
void abortAllBrokers(int errorCode, std::string_view errorString)
Definition: BrokerFactory.cpp:281
std::vector< std::shared_ptr< Broker > > getAllBrokers()
Definition: BrokerFactory.cpp:214
std::shared_ptr< Broker > getConnectedBroker()
Definition: BrokerFactory.cpp:197
std::shared_ptr< Broker > findBroker(std::string_view brokerName)
Definition: BrokerFactory.cpp:180
std::shared_ptr< Broker > findJoinableBrokerOfType(CoreType type)
Definition: BrokerFactory.cpp:208
void defineBrokerBuilder(std::shared_ptr< BrokerBuilder > builder, std::string_view name, int code)
Definition: BrokerFactory.cpp:83
void terminateAllBrokers()
Definition: BrokerFactory.cpp:272
void addAssociatedBrokerType(std::string_view name, CoreType type)
Definition: BrokerFactory.cpp:307
size_t cleanUpBrokers()
Definition: BrokerFactory.cpp:263
bool brokersActive()
Definition: BrokerFactory.cpp:219
std::shared_ptr< Broker > getBrokerByIndex(size_t index)
Definition: BrokerFactory.cpp:202
bool registerBroker(const std::shared_ptr< Broker > &broker, CoreType type)
Definition: BrokerFactory.cpp:243
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