9 #include "../application_api/Endpoints.hpp"
10 #include "../application_api/Subscriptions.hpp"
11 #include "helicsApp.hpp"
38 explicit Recorder(std::vector<std::string> args);
49 const std::shared_ptr<Core>& core,
61 Recorder(std::string_view name,
const std::string& jsonString);
69 virtual void runTo(
Time runToTime)
override;
71 void addSubscription(std::string_view key);
73 void addEndpoint(std::string_view endpoint);
75 void addSourceEndpointClone(std::string_view sourceEndpoint);
77 void addDestEndpointClone(std::string_view destEndpoint);
81 void addCapture(std::string_view captureDesc);
83 void saveFile(
const std::string& filename);
93 std::tuple<Time, std::string_view, std::string> getValue(std::size_t index)
const;
98 std::unique_ptr<Message> getMessage(std::size_t index)
const;
106 virtual void loadJsonFile(
const std::string& jsonString,
107 bool enableFederateInterfaceRegistration)
override;
109 virtual void loadTextFile(
const std::string& textFile)
override;
111 void writeJsonFile(
const std::string& filename);
113 void writeTextFile(
const std::string& filename);
115 virtual void initialize()
override;
116 void generateInterfaces();
117 void captureForCurrentTime(
Time currentTime,
int iteration = 0);
118 void loadCaptureInterfaces();
121 std::shared_ptr<helicsCLI11App> buildArgParserApp();
131 int16_t iteration{0};
136 time(t1), index(id1), value(val)
150 bool allow_iteration{
false};
154 std::unique_ptr<CloningFilter>
cFilt;
161 std::map<helics::InterfaceHandle, int>
subids;
163 std::map<helics::InterfaceHandle, int> eptids;
168 std::string outFileName{
"out.txt"};
Definition: FederateInfo.hpp:29
Definition: helicsApp.hpp:32
Definition: Recorder.hpp:127
Definition: Recorder.hpp:142
Definition: Recorder.hpp:27
std::deque< Input > subscriptions
the actual subscription objects
Definition: Recorder.hpp:156
auto pointCount() const
Definition: Recorder.hpp:85
std::unique_ptr< CloningFilter > cFilt
a pointer to a clone filter
Definition: Recorder.hpp:154
std::deque< Endpoint > endpoints
the actual endpoint objects
Definition: Recorder.hpp:158
std::map< std::string_view, int > eptNames
translate endpoint name to index
Definition: Recorder.hpp:164
Recorder & operator=(Recorder &&other_recorder)=default
std::vector< std::string > captureInterfaces
storage for the interfaces to capture
Definition: Recorder.hpp:166
std::vector< ValueCapture > points
lists of points that were captured
Definition: Recorder.hpp:155
std::unique_ptr< Endpoint > cloneEndpoint
the endpoint for cloned message delivery
Definition: Recorder.hpp:159
Recorder(Recorder &&other_recorder)=default
std::vector< std::string > targets
specified targets for the subscriptions
Definition: Recorder.hpp:157
std::vector< std::unique_ptr< Message > > messages
list of messages
Definition: Recorder.hpp:160
std::map< std::string_view, int > subkeys
translate subscription names to an index
Definition: Recorder.hpp:162
std::vector< ValueStats > vStat
storage for statistics capture
Definition: Recorder.hpp:165
std::map< helics::InterfaceHandle, int > subids
map of the subscription ids
Definition: Recorder.hpp:161
std::string mapfile
file name for the on-line file updater
Definition: Recorder.hpp:167
auto messageCount() const
Definition: Recorder.hpp:87
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