helics
3.5.2
|
#include <Federate.hpp>
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 | |
HelicsFederate | baseObject () const |
void | setFlagOption (int flag, bool flagValue=true) |
void | setProperty (int tProperty, HelicsTime timeValue) |
void | setProperty (int intProperty, int value) |
bool | getFlagOption (int flag) const |
HelicsTime | getTimeProperty (int tProperty) const |
int | getIntegerProperty (int intProperty) const |
void | setSeparator (char sep) |
void | registerInterfaces (const std::string &configString) |
HelicsFederateState | getCurrentMode () const |
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 () |
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) |
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) |
const char * | getCommand () |
const char * | waitCommand () |
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) |
int | getFilterCount () const |
Filter | getFilter (const std::string &filterName) |
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) |
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) |
HelicsCore | getCore () |
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, and helicsFederateAddAlias().
|
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, and helicsFederateAddDependency().
|
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, HELICS_ITERATION_RESULT_NEXT_STEP, helicsFederateEnterExecutingMode(), and helicsFederateEnterExecutingModeIterative().
|
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, HELICS_ITERATION_REQUEST_NO_ITERATION, helicsFederateEnterExecutingModeAsync(), and helicsFederateEnterExecutingModeIterativeAsync().
|
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, HELICS_ITERATION_RESULT_NEXT_STEP, helicsFederateEnterExecutingModeComplete(), and helicsFederateEnterExecutingModeIterativeComplete().
|
inline |
enter the initialization mode after all interfaces have been defined
the call will block until all federates have entered initialization mode
References fed, and helicsFederateEnterInitializingMode().
|
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, and helicsFederateEnterInitializingModeAsync().
|
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, and helicsFederateEnterInitializingModeComplete().
|
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, and helicsFederateEnterInitializingModeIterative().
|
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, and helicsFederateEnterInitializingModeIterativeAsync().
|
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, and helicsFederateEnterInitializingModeIterativeComplete().
|
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, and helicsFederateFinalize().
|
inline |
terminate the simulation in a non-blocking call
finalizeComplete must be called after this call to complete the finalize procedure
References fed, and helicsFederateFinalizeAsync().
|
inline |
complete the asynchronous terminate pair
References fed, and helicsFederateFinalizeComplete().
|
inline |
Get a command sent to the federate.
References fed, and helicsFederateGetCommand().
|
inline |
Get the source of the most recently retrieved command sent to the federate.
References fed, and helicsFederateGetCommandSource().
|
inline |
get a Core Object
References fed, and helicsFederateGetCore().
|
inline |
get the current state of the federate
References fed, and helicsFederateGetState().
|
inline |
get the current time from a federate
References fed, and helicsFederateGetCurrentTime().
|
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, HELICS_FALSE, and helicsFederateGetFlagOption().
|
inline |
get an integer option for the federate
intProperty | the option to inquire |
References fed, and helicsFederateGetIntegerProperty().
|
inline |
get the federate name
References fed, and helicsFederateGetName().
|
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, and helicsFederateGetTag().
|
inline |
get the value of a time option for the federate
tProperty | the option to get |
References fed, and helicsFederateGetTimeProperty().
|
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, and helicsFederateGlobalError().
|
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, HELICS_FALSE, and helicsFederateIsAsyncOperationCompleted().
|
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, and helicsFederateLocalError().
|
inline |
log a debug message
References fed, and helicsFederateLogDebugMessage().
|
inline |
log an error message
References fed, and helicsFederateLogErrorMessage().
|
inline |
log an info message
References fed, and helicsFederateLogInfoMessage().
|
inline |
log a message with a specified log level
References fed, and helicsFederateLogLevelMessage().
|
inline |
log a warning message
References fed, and helicsFederateLogWarningMessage().
|
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, helicsFederateGetName(), and helicsFederateProtect().
|
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, and helicsFederateRegisterInterfaces().
|
inline |
request a time advancement to the next allowed time
References fed, and helicsFederateRequestNextStep().
|
inline |
request a time advancement
time | the next requested time step |
References fed, and helicsFederateRequestTime().
|
inline |
request a time advancement to the next allowed time
timeDelta | the amount of time requested to advance |
References fed, and helicsFederateRequestTimeAdvance().
|
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, and helicsFederateRequestTimeAsync().
|
inline |
request a time advancement
References fed, and helicsFederateRequestTimeComplete().
|
inline |
request a time advancement
time | the next requested time step |
iterate | a requested iteration mode |
References fed, helicscpp::HelicsIterationTime::grantedTime, helicsFederateRequestTimeIterative(), 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, and helicsFederateRequestTimeIterativeAsync().
|
inline |
finalize the time advancement request
References fed, helicscpp::HelicsIterationTime::grantedTime, helicsFederateRequestTimeIterativeComplete(), 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, and helicsFederateSendCommand().
|
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, HELICS_TRUE, and helicsFederateSetFlagOption().
|
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, and helicsFederateSetGlobal().
|
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, and helicsFederateSetIntegerProperty().
|
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, and helicsFederateSetTimeProperty().
|
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, and helicsFederateSetSeparator().
|
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, and helicsFederateSetTag().
|
inline |
unprotect the federate and make it retrievable even if not library objects exist
References fed, helicsFederateGetName(), and helicsFederateUnProtect().
|
inline |
Get a command sent to the federate. Blocks until a command is received.
References fed, and helicsFederateWaitCommand().