helics  3.5.2
Public Member Functions | List of all members
helics::BrokerApp Class Reference

#include <BrokerApp.hpp>

Public Member Functions

 BrokerApp ()=default
 
 BrokerApp (std::vector< std::string > args)
 
 BrokerApp (CoreType ctype, std::vector< std::string > args)
 
 BrokerApp (CoreType ctype, const std::string &broker_name, std::vector< std::string > args)
 
 BrokerApp (int argc, char *argv[])
 
 BrokerApp (CoreType ctype, int argc, char *argv[])
 
 BrokerApp (CoreType ctype, std::string_view brokerName, int argc, char *argv[])
 
 BrokerApp (std::string_view argString)
 
 BrokerApp (CoreType ctype, std::string_view argString=std::string_view{})
 
 BrokerApp (CoreType ctype, std::string_view brokerName, std::string_view argString)
 
 BrokerApp (std::shared_ptr< Broker > brk)
 
bool isConnected () const
 
bool connect ()
 
bool isOpenToNewFederates () const
 
void forceTerminate ()
 
bool waitForDisconnect (std::chrono::milliseconds waitTime=std::chrono::milliseconds(0))
 
void linkEndpoints (std::string_view source, std::string_view target)
 
void dataLink (std::string_view source, std::string_view target)
 
void addSourceFilterToEndpoint (std::string_view filter, std::string_view endpoint)
 
void addDestinationFilterToEndpoint (std::string_view filter, std::string_view endpoint)
 
void addAlias (std::string_view interfaceName, std::string_view alias)
 
void makeConnections (const std::string &file)
 
const std::string & getIdentifier () const
 
const std::string & getAddress () const
 
std::string query (std::string_view target, std::string_view queryStr, HelicsSequencingModes mode=HELICS_SEQUENCING_MODE_FAST)
 
void setGlobal (std::string_view valueName, std::string_view value)
 
void sendCommand (std::string_view target, std::string_view commandStr, HelicsSequencingModes mode=HELICS_SEQUENCING_MODE_FAST)
 
void setLogFile (std::string_view logFile)
 
void setLoggingLevel (int loglevel)
 
void reset ()
 
BrokerAppoperator-> ()
 
const BrokerAppoperator-> () const
 
std::shared_ptr< BrokergetCopyofBrokerPointer () const
 
void setTimeBarrier (Time barrierTime)
 
void clearTimeBarrier ()
 
void globalError (int32_t errorCode, std::string_view errorString)
 

Detailed Description

class implementing a Broker object. This object is meant to a be a very simple broker executor with a similar interface to the other apps

Constructor & Destructor Documentation

◆ BrokerApp() [1/11]

helics::BrokerApp::BrokerApp ( )
default

default constructor

◆ BrokerApp() [2/11]

helics::BrokerApp::BrokerApp ( std::vector< std::string >  args)
explicit

construct from command line arguments in a vector

Parameters
argsthe command line arguments to pass in a reverse vector

References helics::DEFAULT.

◆ BrokerApp() [3/11]

helics::BrokerApp::BrokerApp ( CoreType  ctype,
std::vector< std::string >  args 
)

construct from command line arguments in a vector

Parameters
ctypethe type of broker to create
argsthe command line arguments to pass in a reverse vector

◆ BrokerApp() [4/11]

helics::BrokerApp::BrokerApp ( CoreType  ctype,
const std::string &  broker_name,
std::vector< std::string >  args 
)

construct from command line arguments in a vector

Parameters
ctypethe type of broker to create
broker_namethe name of the broker
argsthe command line arguments to pass in a reverse vector

References helics::MULTI.

◆ BrokerApp() [5/11]

helics::BrokerApp::BrokerApp ( int  argc,
char *  argv[] 
)

construct from command line arguments

Parameters
argcthe number of arguments
argvthe strings in the input

References helics::DEFAULT.

◆ BrokerApp() [6/11]

helics::BrokerApp::BrokerApp ( CoreType  ctype,
int  argc,
char *  argv[] 
)

construct from command line arguments

Parameters
ctypethe type of broker to create
argcthe number of arguments
argvthe strings in the input

◆ BrokerApp() [7/11]

helics::BrokerApp::BrokerApp ( CoreType  ctype,
std::string_view  brokerName,
int  argc,
char *  argv[] 
)

construct from command line arguments

Parameters
ctypethe type of broker to create
brokerNamethe name of the broker
argcthe number of arguments
argvthe strings in the input

References helics::MULTI.

◆ BrokerApp() [8/11]

helics::BrokerApp::BrokerApp ( std::string_view  argString)
explicit

construct from command line arguments parsed as a single string

Parameters
argStringa merged string with all the arguments

References helics::BrokerFactory::findBroker().

◆ BrokerApp() [9/11]

helics::BrokerApp::BrokerApp ( CoreType  ctype,
std::string_view  argString = std::string_view{} 
)
explicit

construct from command line arguments parsed as a single string

Parameters
ctypethe type of broker to create
argStringa merged string with all the arguments

◆ BrokerApp() [10/11]

helics::BrokerApp::BrokerApp ( CoreType  ctype,
std::string_view  brokerName,
std::string_view  argString 
)

construct from command line arguments parsed as a single string

Parameters
ctypethe type of broker to create
brokerNamethe name of the broker
argStringa merged string with all the arguments

References helics::MULTI.

◆ BrokerApp() [11/11]

helics::BrokerApp::BrokerApp ( std::shared_ptr< Broker brk)
explicit

create a BrokerApp from a broker pointer

Member Function Documentation

◆ addAlias()

void helics::BrokerApp::addAlias ( std::string_view  interfaceName,
std::string_view  alias 
)

add an alias for an interface

◆ addDestinationFilterToEndpoint()

void helics::BrokerApp::addDestinationFilterToEndpoint ( std::string_view  filter,
std::string_view  endpoint 
)

add a destination Filter to an endpoint

◆ addSourceFilterToEndpoint()

void helics::BrokerApp::addSourceFilterToEndpoint ( std::string_view  filter,
std::string_view  endpoint 
)

add a source Filter to an endpoint

◆ clearTimeBarrier()

void helics::BrokerApp::clearTimeBarrier ( )

clear a global time Barrier

◆ connect()

bool helics::BrokerApp::connect ( )

connect the broker to the network

◆ dataLink()

void helics::BrokerApp::dataLink ( std::string_view  source,
std::string_view  target 
)

link a publication and input

◆ forceTerminate()

void helics::BrokerApp::forceTerminate ( )

forcibly disconnect the broker

Referenced by helics::BrokerKeeper::forceTerminate().

◆ getAddress()

const std::string & helics::BrokerApp::getAddress ( ) const

get the network address of the broker

◆ getCopyofBrokerPointer()

std::shared_ptr<Broker> helics::BrokerApp::getCopyofBrokerPointer ( ) const
inline

get a copy of the core pointer

◆ getIdentifier()

const std::string & helics::BrokerApp::getIdentifier ( ) const

get the identifier of the broker

◆ globalError()

void helics::BrokerApp::globalError ( int32_t  errorCode,
std::string_view  errorString 
)

generate a global error that will halt a co-simulation

◆ isConnected()

bool helics::BrokerApp::isConnected ( ) const

◆ isOpenToNewFederates()

bool helics::BrokerApp::isOpenToNewFederates ( ) const

check if the broker is ready to accept new federates or cores

◆ linkEndpoints()

void helics::BrokerApp::linkEndpoints ( std::string_view  source,
std::string_view  target 
)

link two endpoints source to destination

◆ makeConnections()

void helics::BrokerApp::makeConnections ( const std::string &  file)

make connections between interfaces with a file

◆ query()

std::string helics::BrokerApp::query ( std::string_view  target,
std::string_view  queryStr,
HelicsSequencingModes  mode = HELICS_SEQUENCING_MODE_FAST 
)

make a query at the broker

Parameters
targetthe target of the query "federation", "parent", "broker", or a specific named object
queryStrthe query to make
modethe ordering mode to use (fast for asynchronous priority channels, and ordered for slower but well ordered queries)
Returns
a string containing the query results

make a query at the broker

◆ reset()

void helics::BrokerApp::reset ( )

clear the pointer to the broker

◆ sendCommand()

void helics::BrokerApp::sendCommand ( std::string_view  target,
std::string_view  commandStr,
HelicsSequencingModes  mode = HELICS_SEQUENCING_MODE_FAST 
)

send a command to a specific target

the format is somewhat unspecified; target is the name of an object, typically one of "federation", "broker", "core", or the name of a specific object/core/broker

Parameters
targetthe specific target of the command
commandStrthe actual command
modethe ordering mode to use (fast for asynchronous priority channels, and ordered for slower but well ordered commands)

◆ setGlobal()

void helics::BrokerApp::setGlobal ( std::string_view  valueName,
std::string_view  value 
)

set a federation global value

this overwrites any previous value for this name globals can be queried with a target of "global" or "global_value" and queryStr of the value to Query

Parameters
valueNamethe name of the global to set
valuethe value of the global

◆ setLogFile()

void helics::BrokerApp::setLogFile ( std::string_view  logFile)

set the log file to use for the broker

◆ setLoggingLevel()

void helics::BrokerApp::setLoggingLevel ( int  loglevel)

set the minimum log level to use in the broker

◆ setTimeBarrier()

void helics::BrokerApp::setTimeBarrier ( Time  barrierTime)

set a global time Barrier

◆ waitForDisconnect()

bool helics::BrokerApp::waitForDisconnect ( std::chrono::milliseconds  waitTime = std::chrono::milliseconds(0))

wait for the broker to normally disconnect for a certain amount of time

Referenced by helics::BrokerKeeper::~BrokerKeeper().


The documentation for this class was generated from the following files: