helics
3.5.2
|
#include <Clone.hpp>
Classes | |
class | ValueCapture |
Public Member Functions | |
Clone (std::string_view appName, FederateInfo &fedInfo) | |
Clone (std::vector< std::string > args) | |
Clone (int argc, char *argv[]) | |
Clone (std::string_view appName, const std::shared_ptr< Core > &core, const FederateInfo &fedInfo) | |
Clone (std::string_view appName, CoreApp &core, const FederateInfo &fedInfo) | |
Clone (std::string_view appName, const std::string &jsonString) | |
Clone (Clone &&other_recorder)=default | |
Clone & | operator= (Clone &&record)=default |
~Clone () | |
virtual void | runTo (Time runToTime) override |
void | saveFile (const std::string &filename=std::string{}) |
auto | pointCount () const |
auto | messageCount () const |
std::tuple< Time, std::string, std::string > | getValue (int index) const |
std::unique_ptr< Message > | getMessage (int index) const |
void | setFederateToClone (std::string_view federateName) |
void | setOutputFile (std::string_view fileName) |
Public Member Functions inherited from helics::apps::App | |
App ()=default | |
App (std::string_view defaultAppName, std::vector< std::string > args) | |
App (std::string_view defaultAppName, int argc, char *argv[]) | |
App (std::string_view appName, const FederateInfo &fedInfo) | |
App (std::string_view appName, const std::shared_ptr< Core > &core, const FederateInfo &fedInfo) | |
App (std::string_view appName, CoreApp &core, const FederateInfo &fedInfo) | |
App (std::string_view appName, const std::string &configString) | |
App (App &&other_app)=default | |
App (const App &other_app)=delete | |
App & | operator= (App &&app)=default |
App & | operator= (const App &app)=delete |
void | loadFile (const std::string &filename, bool enableFederateInterfaceRegistration=true) |
virtual void | run () |
virtual void | finalize () |
bool | isActive () const |
const CombinationFederate & | accessUnderlyingFederate () const |
Protected Attributes | |
bool | allow_iteration {false} |
trigger to allow Iteration | |
bool | verbose {false} |
print all captured values to the screen | |
bool | fileSaved {false} |
true if the file has been saved already | |
Time | nextPrintTimeStep |
the time advancement period for printing markers More... | |
std::unique_ptr< CloningFilter > | cFilt |
a pointer to a clone filter | |
std::vector< ValueCapture > | points |
lists of points that were captured | |
std::deque< Input > | subscriptions |
the actual subscription objects | |
std::vector< std::string > | cloneSubscriptionNames |
string of the subscriptions of the cloned federate | |
std::unique_ptr< Endpoint > | cloneEndpoint |
the endpoint for cloned message delivery | |
std::vector< std::unique_ptr< Message > > | messages |
list of messages | |
std::map< helics::InterfaceHandle, int > | subids |
map of the subscription ids | |
std::map< std::string_view, int > | subkeys |
translate subscription names to an index | |
std::map< helics::InterfaceHandle, int > | eptids |
std::map< std::string_view, int > | eptNames |
translate endpoint name to index | |
std::string | captureFederate |
storage for the name of the federate to clone | |
std::string | fedConfig |
storage for the federateConfiguration | |
std::string | outFileName {"clone.json"} |
the final output file | |
std::vector< int > | pubPointCount |
a vector containing the counts of each publication | |
Protected Attributes inherited from helics::apps::App | |
std::shared_ptr< CombinationFederate > | fed |
the federate created for the App | |
Time | stopTime = Time::maxVal() |
the time the App should stop | |
std::string | configFileName |
name of the config file used for constructing the federate | |
std::string | inputFileName |
the name of the app input file | |
bool | useLocal {false} |
bool | fileLoaded {false} |
bool | deactivated {false} |
bool | quietMode {false} |
bool | helpMode {false} |
std::vector< std::string > | remArgs |
Additional Inherited Members | |
Protected Member Functions inherited from helics::apps::App | |
virtual void | loadJsonFile (const std::string &jsonString, bool enableFederateInterfaceRegistration) |
void | loadJsonFileConfiguration (const std::string &appName, const std::string &jsonString, bool enableFederateInterfaceRegistration) |
virtual void | loadTextFile (const std::string &textFile) |
void | loadInputFiles () |
void | loadConfigOptions (AppTextParser &aparser) |
class designed to capture data points from a set of subscriptions or endpoints
helics::apps::Clone::Clone | ( | std::string_view | appName, |
FederateInfo & | fedInfo | ||
) |
construct from a FederateInfo structure
appName | the name of the Recorder, can be left empty for the default or to pull from the federateInfo object |
fedInfo | a federate information structure |
|
explicit |
construct from command line arguments in a vector
args | the command line arguments to pass in a reverse vector |
helics::apps::Clone::Clone | ( | int | argc, |
char * | argv[] | ||
) |
construct from command line arguments
helics::apps::Clone::Clone | ( | std::string_view | appName, |
const std::shared_ptr< Core > & | core, | ||
const FederateInfo & | fedInfo | ||
) |
constructor taking a federate information structure and using the given core
appName | the name of the Recorder, can be left empty for the default or to pull from the federateInfo object |
core | a pointer to core object which the federate can join |
fedInfo | a federate information structure |
helics::apps::Clone::Clone | ( | std::string_view | appName, |
CoreApp & | core, | ||
const FederateInfo & | fedInfo | ||
) |
constructor taking a federate information structure and using the given core
appName | the name of the federate (can be empty to use defaults from fedInfo) |
core | a coreApp object that can be joined |
fedInfo | a federate information structure |
helics::apps::Clone::Clone | ( | std::string_view | appName, |
const std::string & | jsonString | ||
) |
constructor taking a file with the required information
appName | the name of the app |
jsonString | a file or json string defining the federate information in JSON or text |
|
default |
move construction
helics::apps::Clone::~Clone | ( | ) |
destructor
References fileSaved, outFileName, and saveFile().
std::unique_ptr< Message > helics::apps::Clone::getMessage | ( | int | index | ) | const |
get a message
makes a copy of a message and returns it in a unique_ptr
index | the number of the message to retrieve |
References helics::isValidIndex(), and messages.
std::tuple< Time, std::string, std::string > helics::apps::Clone::getValue | ( | int | index | ) | const |
get a string with the value of point index
index | the number of the point to retrieve |
References helics::isValidIndex(), points, and subscriptions.
|
inline |
get the number of captured messages
|
inline |
get the number of captured points
|
overridevirtual |
run the Cloner until the specified time
run the Player until the specified time
Implements helics::apps::App.
References allow_iteration, helics::apps::App::fed, helics::ITERATE_IF_NEEDED, helics::NEXT_STEP, nextPrintTimeStep, and helics::timeZero.
void helics::apps::Clone::saveFile | ( | const std::string & | filename = std::string{} | ) |
save the data to a file
References cloneSubscriptionNames, fedConfig, fileSaved, messages, outFileName, points, and subscriptions.
Referenced by ~Clone().
void helics::apps::Clone::setFederateToClone | ( | std::string_view | federateName | ) |
set the name of the federate to Clone
federateName | the name of the federate to clone |
References captureFederate.
|
inline |
set the name of the output file
fileName | the name of the file, can be "" if no file should be auto saved |
|
protected |
the time advancement period for printing markers
Referenced by runTo().