![]() |
helics 3.7.0
|
#include <Federate.hpp>
Inheritance diagram for helicscpp::Federate:Public Member Functions | |
| Federate () HELICS_NOTHROW | |
| Default constructor. | |
| Federate (const Federate &fedObj) | |
| Copy constructor. | |
| Federate & | operator= (const Federate &fedObj) |
| Copy assignment operator. | |
| virtual | ~Federate () |
| operator HelicsFederate () const | |
| HELICS_NODISCARD HelicsFederate | baseObject () const |
| void | setFlagOption (int flag, bool flagValue=true) |
| void | setProperty (int tProperty, HelicsTime timeValue) |
| void | setProperty (int intProperty, int value) |
| HELICS_NODISCARD bool | getFlagOption (int flag) const |
| HELICS_NODISCARD HelicsTime | getTimeProperty (int tProperty) const |
| HELICS_NODISCARD int | getIntegerProperty (int intProperty) const |
| void | setSeparator (char sep) |
| void | registerInterfaces (const std::string &configString) |
| HELICS_NODISCARD HelicsFederateState | getCurrentMode () const |
| HELICS_NODISCARD bool | isAsyncOperationCompleted () const |
| void | enterInitializingMode () |
| void | enterInitializingModeAsync () |
| void | enterInitializingModeComplete () |
| void | enterInitializingModeIterative () |
| void | enterInitializingModeIterativeAsync () |
| void | enterInitializingModeIterativeComplete () |
| HelicsIterationResult | enterExecutingMode (HelicsIterationRequest iterate=HELICS_ITERATION_REQUEST_NO_ITERATION) |
| void | enterExecutingModeAsync (HelicsIterationRequest iterate=HELICS_ITERATION_REQUEST_NO_ITERATION) |
| HelicsIterationResult | enterExecutingModeComplete () |
| void | finalize () |
| void | finalizeAsync () |
| void | finalizeComplete () |
| HELICS_NODISCARD HelicsTime | getCurrentTime () |
| HelicsTime | requestTime (HelicsTime time) |
| HelicsTime | requestNextStep () |
| HelicsTime | requestTimeAdvance (HelicsTime timeDelta) |
| HelicsIterationTime | requestTimeIterative (HelicsTime time, HelicsIterationRequest iterate) |
| void | requestTimeAsync (HelicsTime time) |
| void | requestTimeIterativeAsync (HelicsTime time, HelicsIterationRequest iterate) |
| HelicsTime | requestTimeComplete () |
| HelicsIterationTime | requestTimeIterativeComplete () |
| void | processCommunication (HelicsTime period) |
| HELICS_NODISCARD const char * | getName () const |
| void | protect () |
| void | unProtect () |
| std::string | query (const std::string &target, const std::string &queryStr, HelicsSequencingModes mode=HELICS_SEQUENCING_MODE_FAST) const |
| std::string | query (const std::string &queryStr, HelicsSequencingModes mode=HELICS_SEQUENCING_MODE_FAST) const |
| void | sendCommand (const std::string &target, const std::string &cmd) |
| HELICS_NODISCARD const char * | getCommand () |
| HELICS_NODISCARD const char * | waitCommand () |
| HELICS_NODISCARD const char * | getCommandSource () |
| void | setQueryCallback (void(*queryAnswer)(const char *query, int querySize, HelicsQueryBuffer, void *userdata), void *userdata) |
| void | setTimeRequestEntryCallback (void(*timeRequestEntry)(HelicsTime currentTime, HelicsTime requestTime, HelicsBool iterating, void *userdata), void *userdata) |
| void | setTimeUpdateCallback (void(*timeUpdate)(HelicsTime time, HelicsBool iterating, void *userdata), void *userdata) |
| void | setStateChangeCallback (void(*stateChange)(HelicsFederateState newState, HelicsFederateState oldState, void *userdata), void *userdata) |
| void | setTimeRequestReturnCallback (void(*timeRequestReturn)(HelicsTime newTime, HelicsBool iterating, void *userdata), void *userdata) |
| Filter | registerFilter (HelicsFilterTypes type, const std::string &filterName=std::string()) |
| CloningFilter | registerCloningFilter (const std::string &deliveryEndpoint) |
| Filter | registerGlobalFilter (HelicsFilterTypes type, const std::string &filterName=std::string()) |
| CloningFilter | registerGlobalCloningFilter (const std::string &deliveryEndpoint) |
| HELICS_NODISCARD int | getFilterCount () const |
| HELICS_NODISCARD Filter | getFilter (const std::string &filterName) |
| HELICS_NODISCARD Filter | getFilter (int index) |
| void | setGlobal (const std::string &valueName, const std::string &value) |
| void | addAlias (const std::string &interfaceName, const std::string &alias) |
| void | setTag (const std::string &tag, const std::string &value) |
| HELICS_NODISCARD const char * | getTag (const std::string &tag) const |
| void | addDependency (const std::string &fedName) |
| void | localError (int errorCode, const std::string &errorString) |
| void | globalError (int errorCode, const std::string &errorString) |
| void | logErrorMessage (const std::string &message) |
| void | logWarningMessage (const std::string &message) |
| void | logInfoMessage (const std::string &message) |
| void | logDebugMessage (const std::string &message) |
| void | logMessage (int level, const std::string &message) |
| HELICS_NODISCARD HelicsCore | getCore () |
| HELICS_NODISCARD HelicsFederate | getObject () const |
Protected Attributes | |
| HelicsFederate | fed |
| underlying HelicsFederate object | |
| bool | exec_async_iterate |
| indicator that the federate is in an async operation | |
|
inlinevirtual |
destructor
References fed, and helicsFederateFree().
|
inline |
add a global alias for an interface
| interfaceName | the given name of the interface |
| alias | the new name by which the interface can be referenced |
References fed.
|
inline |
add a dependency for this federate
adds an additional internal time dependency for the federate
| fedName | the name of the federate to add a dependency on |
References fed.
|
inline |
get the underlying HelicsFederate object
References fed.
|
inline |
enter the normal execution mode
call will block until all federates have entered this mode
| iterate | an optional flag indicating the desired iteration mode |
References fed, HELICS_ITERATION_REQUEST_NO_ITERATION, and HELICS_ITERATION_RESULT_NEXT_STEP.
|
inline |
enter the normal execution mode
call will return immediately but enterExecutingModeComplete should be called to complete the operation
| iterate | an optional flag indicating the desired iteration mode |
References exec_async_iterate, fed, and HELICS_ITERATION_REQUEST_NO_ITERATION.
|
inline |
complete the async call for entering Execution state
call will not block but will return quickly. The enterInitializingModeComplete must be called before doing other operations
References exec_async_iterate, fed, and HELICS_ITERATION_RESULT_NEXT_STEP.
|
inline |
enter the initialization mode after all interfaces have been defined
the call will block until all federates have entered initialization mode
References fed.
|
inline |
enter the initialization mode after all interfaces have been defined
the call will not block but a call to enterInitializingModeComplete should be made to complete the call sequence
References fed.
|
inline |
second part of the async process for entering initializationState call after a call to enterInitializingModeAsync if call any other time it will throw an InvalidFunctionCall exception
References fed.
|
inline |
iterate in the created mode.
the call will block until all federates have flagged they are ready for the next stage of initialization all federates requesting iterations on the created mode will be notified they can continue with setup.
References fed.
|
inline |
iterate in the created mode.
the call will not block but a call to enterInitializingModeIterativeComplete should be made to complete the call sequence
References fed.
|
inline |
second part of the async process for entering initializationModeIterative call after a call to enterInitializingModeIterativeAsync; if called any other time it will throw an InvalidFunctionCall exception
References fed.
|
inline |
terminate the simulation
call is will block until the finalize has been acknowledged, no commands that interact with the core may be called after this function function
References fed.
|
inline |
terminate the simulation in a non-blocking call
finalizeComplete must be called after this call to complete the finalize procedure
References fed.
|
inline |
complete the asynchronous terminate pair
References fed.
|
inline |
Get a command sent to the federate.
References fed.
|
inline |
Get the source of the most recently retrieved command sent to the federate.
References fed.
|
inline |
|
inline |
get the current state of the federate
References fed.
|
inline |
get the current time from a federate
References fed.
|
inline |
get the id of a source filter from the name of the endpoint
| filterName | the name of the filter |
References fed, and helicsFederateGetFilter().
|
inline |
get a filter from its index
| index | the index of a filter |
References fed, and helicsFederateGetFilterByIndex().
|
inline |
get a count of the number of filters registered in a federate
References fed, and helicsFederateGetFilterCount().
|
inline |
get the value of a flag option
| flag | an index into the flag /ref flag-definitions.h |
References fed, and HELICS_FALSE.
|
inline |
|
inline |
get the federate name
References fed.
|
inline |
get the C object for use in the C library
References fed.
Referenced by helicscpp::Message::newMessageObject().
|
inline |
get the value of a specific tag (key-value pair) for a federate
the tag is an arbitrary user defined string and value; the tags for a federate are queryable
| tag | the name of the tag to get the value for |
References fed.
|
inline |
get the value of a time option for the federate
| tProperty | the option to get |
References fed.
|
inline |
generate a global error to terminate the federation
| errorCode | an error code to give to the error |
| errorString | a string message associated with the error |
References fed.
|
inline |
called after one of the async calls and will indicate true if an async operation has completed
this should only be called from the same thread as the one that called the initial async call and will return false if called when no async operation is in flight
References fed, and HELICS_FALSE.
|
inline |
generate a local federate error
| errorCode | an error code to give to the error |
| errorString | a string message associated with the error |
References fed.
|
inline |
log a debug message
References fed.
|
inline |
log an error message
References fed.
|
inline |
log an info message
References fed.
|
inline |
log a message with a specified log level
References fed.
|
inline |
log a warning message
References fed.
|
inline |
cast operator to get the underlying HelicsFederate object
References fed.
|
inline |
protect the federate and make it retrievable even if not library objects exist
References fed.
|
inline |
make a query of the federate
this call is blocking until the value is returned which may take some time depending on the size of the federation and the specific string being queried, query without a target assumes the target is the federate
| queryStr | a string with the query, see other documentation for specific properties to query, can be defined by the federate |
| mode | the ordering mode to use for the query (fast for priority channels, ordered for normal channels ordered with all other messages) |
References fed, HELICS_SEQUENCING_MODE_FAST, helicsCreateQuery(), helicsQueryExecute(), helicsQueryFree(), and helicsQuerySetOrdering().
|
inline |
make a query of the federate
this call is blocking until the value is returned which make take some time depending on the size of the federation and the specific string being queried
| target | the target of the query can be "federation", "federate", "broker", "core", or a specific name of a federate, core, or broker |
| queryStr | a string with the query see other documentation for specific properties to query, can be defined by the federate |
| mode | the ordering mode to use for the query (fast for priority channels, ordered for normal channels ordered with all other messages) |
References fed, HELICS_SEQUENCING_MODE_FAST, helicsCreateQuery(), helicsQueryExecute(), helicsQueryFree(), and helicsQuerySetOrdering().
|
inline |
create a cloning Filter on the specified federate
cloning filters copy a message and send it to multiple locations source and destination can be added through other functions
| deliveryEndpoint | the specified endpoint to deliver the message |
References fed, and helicsFederateRegisterCloningFilter().
|
inline |
define a filter interface
a filter will modify messages coming from or going to target endpoints
| type | the type of the filter to register |
| filterName | the name of the filter |
References fed, and helicsFederateRegisterFilter().
|
inline |
create a cloning Filter on the specified federate
cloning filters copy a message and send it to multiple locations source and destination can be added through other functions
| deliveryEndpoint | the specified endpoint to deliver the message |
References fed, and helicsFederateRegisterGlobalCloningFilter().
|
inline |
define a filter interface
a filter will modify messages coming from or going to target endpoints
| type | the type of the filter to register |
| filterName | the name of the filter |
References fed, and helicsFederateRegisterGlobalFilter().
|
inline |
register a set of interfaces defined in a file
call is only valid in startup mode
| configString | the location of the file or config String to load to generate the interfaces |
References fed.
|
inline |
|
inline |
request a time advancement
| time | the next requested time step |
References fed.
|
inline |
request a time advancement to the next allowed time
| timeDelta | the amount of time requested to advance |
References fed.
|
inline |
request a time advancement and return immediately for asynchronous function.
/ref requestTimeComplete should be called to finish the operation and get the result
| time | the next requested time step |
References fed.
|
inline |
|
inline |
request a time advancement
| time | the next requested time step |
| iterate | a requested iteration mode |
References fed, helicscpp::HelicsIterationTime::grantedTime, and helicscpp::HelicsIterationTime::status.
|
inline |
request a time advancement with iterative call and return for asynchronous function.
/ref requestTimeIterativeComplete should be called to finish the operation and get the result
| time | the next requested time step |
| iterate | a requested iteration level (none, require, optional) |
References fed.
|
inline |
finalize the time advancement request
References fed, helicscpp::HelicsIterationTime::grantedTime, and helicscpp::HelicsIterationTime::status.
|
inline |
Send a command to another HELICS object through a federate.
| target | The name of the object to send the command to. |
| cmd | The command to send. |
References fed.
|
inline |
set a flag for the federate
| flag | an index into the flag /ref flag-definitions.h |
| flagValue | the value of the flag defaults to true |
References fed, HELICS_FALSE, and HELICS_TRUE.
|
inline |
set a federation global value
this overwrites any previous value for this name
| valueName | the name of the global to set |
| value | the value of the global |
References fed.
|
inline |
set an integer option for the federate
| intProperty | an index of the option to set |
| value | an integer option value for an integer based property |
References fed.
|
inline |
set a time property option for the federate
| tProperty | an index of the option to set |
| timeValue | and integer option value for an integer based property |
References fed.
|
inline |
specify a separator to use for naming separation between the federate name and the interface name setSeparator('.') will result in future registrations of local endpoints such as fedName.endpoint setSeparator('/') will result in fedName/endpoint the default is '/' any character can be used though many will not make that much sense. This call is not thread safe and should be called before any local interfaces are created otherwise it may not be possible to retrieve them without using the full name. recommended possibilities are ('.','/', ':','-','_')
References fed.
|
inline |
set a tag (key-value pair) for a federate
the tag is an arbitrary user defined string and value; the tags for a federate are queryable through a "tags" query or "tag/<tagname>"
| tag | the name of the tag to set the value for |
| value | the value for the given tag |
References fed.
|
inline |
unprotect the federate and make it retrievable even if not library objects exist
References fed.
|
inline |
Get a command sent to the federate. Blocks until a command is received.
References fed.