9 #include "../application_api/Endpoints.hpp"
10 #include "../application_api/Publications.hpp"
11 #include "../application_api/Subscriptions.hpp"
12 #include "helicsApp.hpp"
39 explicit Clone(std::vector<std::string> args);
41 Clone(
int argc,
char* argv[]);
49 Clone(std::string_view appName,
50 const std::shared_ptr<Core>& core,
64 Clone(std::string_view appName,
const std::string& jsonString);
72 virtual void runTo(
Time runToTime)
override;
74 void saveFile(
const std::string& filename = std::string{});
83 std::tuple<Time, std::string, std::string> getValue(
int index)
const;
88 std::unique_ptr<Message> getMessage(
int index)
const;
93 void setFederateToClone(std::string_view federateName);
96 void setOutputFile(std::string_view fileName) { outFileName = fileName; }
100 void addSubscription(std::string_view key);
103 void addSourceEndpointClone(std::string_view sourceEndpoint);
105 virtual void initialize()
override;
106 void generateInterfaces();
107 void captureForCurrentTime(
Time currentTime,
int iteration = 0);
109 std::shared_ptr<helicsCLI11App> buildArgParserApp();
122 int16_t iteration{0};
127 time(t1), index(id1), value(val)
132 bool allow_iteration{
false};
134 bool fileSaved{
false};
137 std::unique_ptr<CloningFilter>
cFilt;
140 std::vector<std::string>
144 std::map<helics::InterfaceHandle, int>
subids;
146 std::map<helics::InterfaceHandle, int> eptids;
150 std::string outFileName{
"clone.json"};
Definition: FederateInfo.hpp:29
Definition: helicsApp.hpp:32
Definition: Clone.hpp:118
std::map< std::string_view, int > eptNames
translate endpoint name to index
Definition: Clone.hpp:147
Clone(Clone &&other_recorder)=default
std::unique_ptr< Endpoint > cloneEndpoint
the endpoint for cloned message delivery
Definition: Clone.hpp:142
std::vector< int > pubPointCount
a vector containing the counts of each publication
Definition: Clone.hpp:151
std::vector< ValueCapture > points
lists of points that were captured
Definition: Clone.hpp:138
std::deque< Input > subscriptions
the actual subscription objects
Definition: Clone.hpp:139
auto messageCount() const
Definition: Clone.hpp:78
std::string captureFederate
storage for the name of the federate to clone
Definition: Clone.hpp:148
std::unique_ptr< CloningFilter > cFilt
a pointer to a clone filter
Definition: Clone.hpp:137
Clone & operator=(Clone &&record)=default
void setOutputFile(std::string_view fileName)
Definition: Clone.hpp:96
std::string fedConfig
storage for the federateConfiguration
Definition: Clone.hpp:149
std::vector< std::string > cloneSubscriptionNames
string of the subscriptions of the cloned federate
Definition: Clone.hpp:141
std::vector< std::unique_ptr< Message > > messages
list of messages
Definition: Clone.hpp:143
auto pointCount() const
Definition: Clone.hpp:76
std::map< helics::InterfaceHandle, int > subids
map of the subscription ids
Definition: Clone.hpp:144
std::map< std::string_view, int > subkeys
translate subscription names to an index
Definition: Clone.hpp:145
the main namespace for the helics co-simulation library User functions will be in the helics namespac...
Definition: AsyncFedCallInfo.hpp:14
constexpr Time timeZero
Definition: helicsTime.hpp:31
TimeRepresentation< count_time< 9 > > Time
Definition: helicsTime.hpp:27