helics  2.8.1
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 pendingMessages () 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 helics_federate () const
 
helics_federate baseObject () const
 
void setFlagOption (int flag, bool flagValue=true)
 
void setProperty (int tProperty, helics_time timeValue)
 
void setProperty (int intProperty, int value)
 
bool getFlagOption (int flag) const
 
helics_time getTimeProperty (int tProperty) const
 
int getIntegerProperty (int intProperty) const
 
void setSeparator (char sep)
 
void registerInterfaces (const std::string &configString)
 
helics_federate_state getCurrentMode () const
 
void enterInitializingMode ()
 
void enterInitializingModeAsync ()
 
bool isAsyncOperationCompleted () const
 
void enterInitializingModeComplete ()
 
helics_iteration_result enterExecutingMode (helics_iteration_request iterate=helics_iteration_request_no_iteration)
 
void enterExecutingModeAsync (helics_iteration_request iterate=helics_iteration_request_no_iteration)
 
helics_iteration_result enterExecutingModeComplete ()
 
void finalize ()
 
void finalizeAsync ()
 
void finalizeComplete ()
 
helics_time getCurrentTime ()
 
helics_time requestTime (helics_time time)
 
helics_time requestNextStep ()
 
helics_time requestTimeAdvance (helics_time timeDelta)
 
helics_iteration_time requestTimeIterative (helics_time time, helics_iteration_request iterate)
 
void requestTimeAsync (helics_time time)
 
void requestTimeIterativeAsync (helics_time time, helics_iteration_request iterate)
 
helics_time requestTimeComplete ()
 
helics_iteration_time requestTimeIterativeComplete ()
 
const char * getName () const
 
std::string query (const std::string &target, const std::string &queryStr, helics_sequencing_mode mode=helics_sequencing_mode_fast) const
 
std::string query (const std::string &queryStr, helics_sequencing_mode mode=helics_sequencing_mode_fast) const
 
void setQueryCallback (void(*queryAnswer)(const char *query, int querySize, helics_query_buffer, void *userdata), void *userdata)
 
Filter registerFilter (helics_filter_type type, const std::string &filterName=std::string())
 
CloningFilter registerCloningFilter (const std::string &deliveryEndpoint)
 
Filter registerGlobalFilter (helics_filter_type type, const std::string &filterName=std::string())
 
CloningFilter registerGlobalCloningFilter (const std::string &deliveryEndpoint)
 
Filter getFilter (const std::string &filterName)
 
Filter getFilter (int index)
 
void setGlobal (const std::string &valueName, const std::string &value)
 
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_core getCore ()
 
helics_federate getObject () const
 

Additional Inherited Members

- Protected Attributes inherited from helicscpp::Federate
helics_federate fed
 underlying helics_federate 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 helicsFederateCreateMessageObject().

◆ 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 helicsFederateGetMessageObject().

◆ hasMessage()

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

Checks if federate has any messages

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

◆ pendingMessages()

int helicscpp::MessageFederate::pendingMessages ( ) 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: