helics
3.5.2
|
#include <Connector.hpp>
Public Member Functions | |
Connector ()=default | |
Connector (std::vector< std::string > args) | |
Connector (int argc, char *argv[]) | |
Connector (std::string_view name, const FederateInfo &fedInfo) | |
Connector (std::string_view name, const std::shared_ptr< Core > &core, const FederateInfo &fedInfo) | |
Connector (std::string_view name, CoreApp &core, const FederateInfo &fedInfo) | |
Connector (std::string_view appName, const std::string &configString) | |
Connector (Connector &&other_player)=default | |
Connector & | operator= (Connector &&fed)=default |
virtual void | initialize () override |
virtual void | runTo (Time stopTime_input) override |
void | addConnection (std::string_view interface1, std::string_view interface2, InterfaceDirection direction=InterfaceDirection::BIDIRECTIONAL, const std::vector< std::string > &tags={}) |
std::size_t | addTag (std::string_view tagName) |
std::string_view | addInterface (std::string_view interfaceName) |
auto | connectionCount () const |
auto | madeConnections () const |
void | allowMultipleConnections (bool value=true) |
void | matchEndpointTargets (bool value=true) |
Public Member Functions inherited from helics::apps::App | |
App ()=default | |
App (std::string_view defaultAppName, std::vector< std::string > args) | |
App (std::string_view defaultAppName, int argc, char *argv[]) | |
App (std::string_view appName, const FederateInfo &fedInfo) | |
App (std::string_view appName, const std::shared_ptr< Core > &core, const FederateInfo &fedInfo) | |
App (std::string_view appName, CoreApp &core, const FederateInfo &fedInfo) | |
App (std::string_view appName, const std::string &configString) | |
App (App &&other_app)=default | |
App (const App &other_app)=delete | |
App & | operator= (App &&app)=default |
App & | operator= (const App &app)=delete |
void | loadFile (const std::string &filename, bool enableFederateInterfaceRegistration=true) |
virtual void | run () |
virtual void | finalize () |
bool | isActive () const |
const CombinationFederate & | accessUnderlyingFederate () const |
Additional Inherited Members | |
Protected Member Functions inherited from helics::apps::App | |
void | loadJsonFileConfiguration (const std::string &appName, const std::string &jsonString, bool enableFederateInterfaceRegistration) |
void | loadInputFiles () |
void | loadConfigOptions (AppTextParser &aparser) |
Protected Attributes inherited from helics::apps::App | |
std::shared_ptr< CombinationFederate > | fed |
the federate created for the App | |
Time | stopTime = Time::maxVal() |
the time the App should stop | |
std::string | configFileName |
name of the config file used for constructing the federate | |
std::string | inputFileName |
the name of the app input file | |
bool | useLocal {false} |
bool | fileLoaded {false} |
bool | deactivated {false} |
bool | quietMode {false} |
bool | helpMode {false} |
std::vector< std::string > | remArgs |
class implementing a Connector object, which is capable of automatically connecting interfaces in HELICS
the Connector class is not thread-safe, don't try to use it from multiple threads without external protection, that will result in undefined behavior
|
default |
default constructor
|
explicit |
construct from command line arguments in a vector
args | the command line arguments to pass in a reverse vector |
helics::apps::Connector::Connector | ( | int | argc, |
char * | argv[] | ||
) |
construct from command line arguments
argc | the number of arguments |
argv | the strings in the input |
|
explicit |
construct from a federate info object
name | the name of the federate (can be empty to use defaults from fedInfo) |
fedInfo | a federate info object containing information on the desired federate configuration |
helics::apps::Connector::Connector | ( | std::string_view | name, |
const std::shared_ptr< Core > & | core, | ||
const FederateInfo & | fedInfo | ||
) |
constructor taking a federate information structure and using the given core
name | the name of the federate (can be empty to use defaults from fedInfo) |
core | a pointer to core object which the federate can join |
fedInfo | a federate information structure |
helics::apps::Connector::Connector | ( | std::string_view | name, |
CoreApp & | core, | ||
const FederateInfo & | fedInfo | ||
) |
constructor taking a federate information structure and using the given core
name | the name of the federate (can be empty to use defaults from fedInfo) |
core | a coreApp object that can be joined |
fedInfo | a federate information structure |
helics::apps::Connector::Connector | ( | std::string_view | appName, |
const std::string & | configString | ||
) |
constructor taking a file with the required information
appName | the name of the app |
configString | JSON, TOML or text file or JSON string defining the federate information and other configuration |
|
default |
move construction
void helics::apps::Connector::addConnection | ( | std::string_view | interface1, |
std::string_view | interface2, | ||
InterfaceDirection | direction = InterfaceDirection::BIDIRECTIONAL , |
||
const std::vector< std::string > & | tags = {} |
||
) |
add a connection to a connector
interface1 | the identifier of the first interface |
interface2 | the identifier of the second interface |
direction | the directionality of the interface |
tags | any string tags associated with the connection |
References addInterface(), and addTag().
std::string_view helics::apps::Connector::addInterface | ( | std::string_view | interfaceName | ) |
add an interface name for later reference, return a string_view reference for the interface name
Referenced by addConnection().
std::size_t helics::apps::Connector::addTag | ( | std::string_view | tagName | ) |
add a tag for later reference, return a string_view reference for the tag
Referenced by addConnection().
|
inline |
get the number of connections
|
overridevirtual |
initialize the Player federate
generate all the publications and organize the points, the final publication count will be available after this time and the Player will enter the initialization mode, which means it will not be possible to add more publications; calling run will automatically do this if necessary
Reimplemented from helics::apps::App.
References helics::apps::App::fed, and helics::Federate::STARTUP.
Referenced by runTo().
|
inline |
get the number of made connections
|
overridevirtual |
run the Player until the specified time
stopTime_input | the desired stop time |
Implements helics::apps::App.
References helics::Federate::EXECUTING, helics::apps::App::fed, initialize(), and helics::Federate::STARTUP.