9 #include "../application_api/Endpoints.hpp"
10 #include "../application_api/Subscriptions.hpp"
11 #include "helicsApp.hpp"
33 explicit Tracer(std::vector<std::string> args);
36 Tracer(
int argc,
char* argv[]);
43 Tracer(std::string_view name,
44 const std::shared_ptr<Core>& core,
58 Tracer(std::string_view name,
const std::string& configString);
65 virtual void runTo(
Time runToTime)
override;
67 void addSubscription(std::string_view key);
69 void addEndpoint(std::string_view endpoint);
71 void addSourceEndpointClone(std::string_view sourceEndpoint);
73 void addDestEndpointClone(std::string_view destEndpoint);
77 void addCapture(std::string_view captureDesc);
84 clonedMessageCallback = std::move(callback);
91 std::function<
void(
Time, std::string_view, std::unique_ptr<Message>)> callback)
93 endpointMessageCallback = std::move(callback);
102 valueCallback = std::move(callback);
115 virtual void loadJsonFile(
const std::string& jsonString,
116 bool enableFederateInterfaceRegistration)
override;
118 virtual void loadTextFile(
const std::string& textFile)
override;
120 virtual void initialize()
override;
121 void generateInterfaces();
122 void captureForCurrentTime(
Time currentTime,
int iteration = 0);
123 void loadCaptureInterfaces();
126 std::shared_ptr<helicsCLI11App> buildArgParserApp();
131 bool printMessage =
false;
132 bool allow_iteration =
134 bool skiplog =
false;
135 std::unique_ptr<CloningFilter>
cFilt;
145 std::function<void(
Time, std::unique_ptr<Message>)> clonedMessageCallback;
146 std::function<void(
Time, std::string_view, std::unique_ptr<Message>)>
147 endpointMessageCallback;
148 std::function<void(
Time, std::string_view, std::string_view)> valueCallback;
Definition: FederateInfo.hpp:29
Definition: helicsApp.hpp:32
Definition: Tracer.hpp:26
void enableTextOutput()
Definition: Tracer.hpp:105
std::unique_ptr< Endpoint > cloneEndpoint
the endpoint for cloned message delivery
Definition: Tracer.hpp:142
std::deque< Input > subscriptions
the actual subscription objects
Definition: Tracer.hpp:137
std::vector< std::string > captureInterfaces
storage for the interfaces to capture
Definition: Tracer.hpp:143
void setValueCallback(std::function< void(Time, std::string_view, std::string_view)> callback)
Definition: Tracer.hpp:100
std::map< std::string_view, int > subkeys
translate subscription names to an index
Definition: Tracer.hpp:138
Tracer & operator=(Tracer &&tracer)=default
void setEndpointMessageCallback(std::function< void(Time, std::string_view, std::unique_ptr< Message >)> callback)
Definition: Tracer.hpp:90
std::map< std::string_view, int > eptNames
translate endpoint name to index
Definition: Tracer.hpp:141
std::deque< Endpoint > endpoints
the actual endpoint objects
Definition: Tracer.hpp:140
Tracer(Tracer &&other_tracer)=default
void setClonedMessageCallback(std::function< void(Time, std::unique_ptr< Message >)> callback)
Definition: Tracer.hpp:82
void disableTextOutput()
Definition: Tracer.hpp:107
std::unique_ptr< CloningFilter > cFilt
a pointer to a clone filter
Definition: Tracer.hpp:135
the main namespace for the helics co-simulation library User functions will be in the helics namespac...
Definition: AsyncFedCallInfo.hpp:14
TimeRepresentation< count_time< 9 > > Time
Definition: helicsTime.hpp:27