helics  3.0.1
Public Member Functions | List of all members
helics::apps::Echo Class Reference

#include <Echo.hpp>

+ Inheritance diagram for helics::apps::Echo:

Public Member Functions

 Echo ()=default
 
 Echo (std::vector< std::string > args)
 
 Echo (int argc, char *argv[])
 
 Echo (const std::string &name, const FederateInfo &fi)
 
 Echo (const std::string &name, const std::shared_ptr< Core > &core, const FederateInfo &fi)
 
 Echo (const std::string &name, CoreApp &core, const FederateInfo &fi)
 
 Echo (const std::string &name, const std::string &jsonString)
 
 Echo (Echo &&other_echo) noexcept
 
Echooperator= (Echo &&other_echo) noexcept
 
virtual void runTo (Time stopTime_input) override
 
void addEndpoint (const std::string &endpointName, const std::string &endpointType="")
 
auto echoCount () const
 
void setEchoDelay (Time delay)
 
auto endpointCount () const
 
- Public Member Functions inherited from helics::apps::App
 App ()=default
 
 App (const std::string &defaultAppName, std::vector< std::string > args)
 
 App (const std::string &defaultAppName, int argc, char *argv[])
 
 App (const std::string &appName, const FederateInfo &fi)
 
 App (const std::string &appName, const std::shared_ptr< Core > &core, const FederateInfo &fi)
 
 App (const std::string &appName, CoreApp &core, const FederateInfo &fi)
 
 App (const std::string &appName, const std::string &jsonString)
 
 App (App &&other_app)=default
 
 App (const App &other_app)=delete
 
Appoperator= (App &&app)=default
 
Appoperator= (const App &app)=delete
 
void loadFile (const std::string &filename)
 
virtual void initialize ()
 
virtual void run ()
 
virtual void finalize ()
 
bool isActive () const
 
const CombinationFederateaccessUnderlyingFederate () const
 

Additional Inherited Members

- Protected Member Functions inherited from helics::apps::App
void loadJsonFileConfiguration (const std::string &appName, const std::string &jsonString)
 
virtual void loadTextFile (const std::string &textFile)
 
- Protected Attributes inherited from helics::apps::App
std::shared_ptr< CombinationFederatefed
 the federate created for the Player
 
Time stopTime = Time::maxVal()
 the time the Player should stop
 
std::string masterFileName
 the name of the master file used to do the construction
 
bool useLocal {false}
 
bool fileLoaded {false}
 
bool deactivated {false}
 
bool quietMode {false}
 
bool helpMode {false}
 
std::vector< std::string > remArgs
 

Detailed Description

class implementing an Echo object, which will generate endpoint interfaces and send a data message back to the source at the with a specified delay

the Echo class is NOT threadsafe in general, don't try to use it from multiple threads without external protection, that will result in undefined behavior. One exception is the setEchoDelay function is threadsafe, and const methods will not cause problems but may not give consistent answers if used from multiple threads unless protected.

Constructor & Destructor Documentation

◆ Echo() [1/8]

helics::apps::Echo::Echo ( )
default

default constructor

◆ Echo() [2/8]

helics::apps::Echo::Echo ( std::vector< std::string >  args)
explicit

construct from command line arguments

Parameters
argsa vector of command line arguments

◆ Echo() [3/8]

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

construct from command line arguments

Parameters
argcthe number of arguments
argvthe strings in the input

◆ Echo() [4/8]

helics::apps::Echo::Echo ( const std::string &  name,
const FederateInfo fi 
)
explicit

construct from a federate info object

Parameters
namethe name of the echo app, can be empty to get name from fi or default
fia pointer info object containing information on the desired federate configuration

References helics::apps::App::fed, and HELICS_FLAG_EVENT_TRIGGERED.

◆ Echo() [5/8]

helics::apps::Echo::Echo ( const std::string &  name,
const std::shared_ptr< Core > &  core,
const FederateInfo fi 
)

constructor taking a federate information structure and using the given core

Parameters
namethe name of the echo app, can be empty to get name from fi or default
corea pointer to core object which the federate can join
fia federate information structure

References helics::apps::App::fed, and HELICS_FLAG_EVENT_TRIGGERED.

◆ Echo() [6/8]

helics::apps::Echo::Echo ( const std::string &  name,
CoreApp &  core,
const FederateInfo fi 
)

constructor taking a federate information structure and using the given core

Parameters
namethe name of the federate (can be empty to use defaults from fi)
corea coreApp object that can be joined
fia federate information structure

References helics::apps::App::fed, and HELICS_FLAG_EVENT_TRIGGERED.

◆ Echo() [7/8]

helics::apps::Echo::Echo ( const std::string &  name,
const std::string &  jsonString 
)

constructor taking a file with the required information

Parameters
namethe name of the echo app, can be empty to get name from fi or default
jsonStringfile or JSON string defining the federate information and other configuration

References helics::apps::App::fed, and HELICS_FLAG_EVENT_TRIGGERED.

◆ Echo() [8/8]

helics::apps::Echo::Echo ( Echo &&  other_echo)
noexcept

move construction

Member Function Documentation

◆ addEndpoint()

void helics::apps::Echo::addEndpoint ( const std::string &  endpointName,
const std::string &  endpointType = "" 
)

add an endpoint to the Player

Parameters
endpointNamethe name of the endpoint
endpointTypethe named type of the endpoint

References helics::apps::App::fed.

◆ echoCount()

auto helics::apps::Echo::echoCount ( ) const
inline

get the number of points loaded

◆ endpointCount()

auto helics::apps::Echo::endpointCount ( ) const
inline

get the number of endpoints

◆ operator=()

Echo & helics::apps::Echo::operator= ( Echo &&  other_echo)
noexcept

move assignment

References helics::apps::App::operator=().

◆ runTo()

void helics::apps::Echo::runTo ( Time  stopTime_input)
overridevirtual

run the Echo federate until the specified time

Parameters
stopTime_inputthe desired stop time

Implements helics::apps::App.

References helics::Federate::EXECUTING, helics::apps::App::fed, helics::Federate::FINALIZE, helics::apps::App::initialize(), and helics::Federate::STARTUP.

◆ setEchoDelay()

void helics::apps::Echo::setEchoDelay ( Time  delay)

set the delay time Function is threadsafe


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