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

#include <MessageFederate.hpp>

+ Inheritance diagram for helicscpp::MessageFederate:

Public Member Functions

 MessageFederate (const std::string &fedName, FederateInfo &fi)
 
 MessageFederate (const std::string &configString)
 
 MessageFederate () HELICS_NOTHROW
 
Endpoint registerEndpoint (const std::string &name, const std::string &type=std::string())
 
Endpoint registerGlobalEndpoint (const std::string &name, const std::string &type=std::string())
 
Endpoint getEndpoint (const std::string &name)
 
Endpoint getEndpoint (int index)
 
bool hasMessage () const
 
int pendingMessageCount () const
 
Message getMessage ()
 
Message createMessage ()
 
int getEndpointCount () const
 
- Public Member Functions inherited from helicscpp::Federate
 Federate () HELICS_NOTHROW
 Default constructor.
 
 Federate (const Federate &fedObj)
 Copy constructor.
 
Federateoperator= (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
 

Additional Inherited Members

- Protected Attributes inherited from helicscpp::Federate
HelicsFederate fed
 underlying HelicsFederate object
 
bool exec_async_iterate
 indicator that the federate is in an async operation
 

Detailed Description

class defining the block communication based interface

Constructor & Destructor Documentation

◆ MessageFederate() [1/3]

helicscpp::MessageFederate::MessageFederate ( const std::string &  fedName,
FederateInfo fi 
)
inline

constructor taking a federate information structure and using the default core

Parameters
fedNamethe name of the messageFederate, can be left empty to use a default or one from fi
fia federate information structure

References helicscpp::Federate::fed, helicscpp::FederateInfo::getInfo(), and helicsCreateMessageFederate().

◆ MessageFederate() [2/3]

helicscpp::MessageFederate::MessageFederate ( const std::string &  configString)
inlineexplicit

constructor taking a string with the required information

Parameters
configStringcan be either a JSON file, TOML file or a string containing JSON code

References helicscpp::Federate::fed, and helicsCreateMessageFederateFromConfig().

◆ MessageFederate() [3/3]

helicscpp::MessageFederate::MessageFederate ( )
inline

Default constructor, not meant to be used

Member Function Documentation

◆ createMessage()

Message helicscpp::MessageFederate::createMessage ( )
inline

create a message object

References helicscpp::Federate::fed, and helicsFederateCreateMessage().

◆ getEndpoint() [1/2]

Endpoint helicscpp::MessageFederate::getEndpoint ( const std::string &  name)
inline

get an Endpoint from its name

Parameters
namethe name of the endpoint to retrieve
Returns
an Endpoint

References helicscpp::Federate::fed, and helicsFederateGetEndpoint().

◆ getEndpoint() [2/2]

Endpoint helicscpp::MessageFederate::getEndpoint ( int  index)
inline

get an Endpoint from an index

Parameters
indexthe index of the endpoint to retrieve index is 0 based
Returns
an Endpoint

References helicscpp::Federate::fed, and helicsFederateGetEndpointByIndex().

◆ getEndpointCount()

int helicscpp::MessageFederate::getEndpointCount ( ) const
inline

get the number of registered endpoints

References helicscpp::Federate::fed, and helicsFederateGetEndpointCount().

◆ getMessage()

Message helicscpp::MessageFederate::getMessage ( )
inline

Get a packet for any endpoints in the federate

References helicscpp::Federate::fed, and helicsFederateGetMessage().

◆ hasMessage()

bool helicscpp::MessageFederate::hasMessage ( ) const
inline

Checks if federate has any messages

References helicscpp::Federate::fed, and helicsFederateHasMessage().

◆ pendingMessageCount()

int helicscpp::MessageFederate::pendingMessageCount ( ) const
inline

Returns the number of pending receives for all endpoints.

References helicscpp::Federate::fed, and helicsFederatePendingMessageCount().

◆ registerEndpoint()

Endpoint helicscpp::MessageFederate::registerEndpoint ( const std::string &  name,
const std::string &  type = std::string() 
)
inline

Methods for registering endpoints register an endpoint

call is only valid in startup mode

Parameters
namethe name of the endpoint
typethe defined type of the interface for endpoint checking if requested
Returns
an Endpoint Object

References helicscpp::Federate::fed, and helicsFederateRegisterEndpoint().

◆ registerGlobalEndpoint()

Endpoint helicscpp::MessageFederate::registerGlobalEndpoint ( const std::string &  name,
const std::string &  type = std::string() 
)
inline

register an endpoint directly without prepending the federate name

Parameters
namethe name of the endpoint
typethe defined type of the interface for endpoint checking if requested
Returns
an Endpoint Object

References helicscpp::Federate::fed, and helicsFederateRegisterGlobalEndpoint().


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