9 #include "Endpoints.hpp"
10 #include "Federate.hpp"
11 #include "data_view.hpp"
16 #include <string_view>
19 class MessageFederateManager;
40 const std::shared_ptr<Core>& core,
58 MessageFederate(std::string_view name,
const std::string& configString);
90 virtual void startupToInitializeStateTransition()
override;
91 virtual void initializeToExecuteStateTransition(
iteration_time result)
override;
92 virtual void updateTime(
Time newTime,
Time oldTime)
override;
93 virtual std::string localQuery(std::string_view queryStr)
const override;
100 Endpoint& registerEndpoint(std::string_view eptName = std::string_view(),
101 std::string_view type = std::string_view());
108 Endpoint& registerTargetedEndpoint(std::string_view eptName = std::string_view(),
109 std::string_view type = std::string_view());
116 Endpoint& registerGlobalEndpoint(std::string_view eptName,
117 std::string_view type = std::string_view());
124 Endpoint& registerGlobalTargetedEndpoint(std::string_view eptName,
125 std::string_view type = std::string_view());
135 std::string_view type = std::string_view())
137 return registerGlobalEndpoint(std::string(eptName) +
'_' + std::to_string(index1), type);
144 Endpoint& registerDataSink(std::string_view sinkName = std::string_view());
146 virtual void registerInterfaces(
const std::string& configString)
override;
153 void registerMessageInterfaces(
const std::string& configString);
157 void loadFederateData();
162 void registerMessageInterfacesJson(
const std::string& jsonString);
165 void registerMessageInterfacesJsonDetail(Json::Value& json,
bool defaultGlobal);
171 void registerMessageInterfacesToml(
const std::string& tomlString);
174 Endpoint& registerEndpoint(std::string_view eptName,
175 std::string_view type,
184 void subscribe(
const Endpoint& ept, std::string_view key);
186 bool hasMessage()
const;
188 bool hasMessage(
const Endpoint& ept)
const;
193 uint64_t pendingMessageCount(
const Endpoint& ept)
const;
197 uint64_t pendingMessageCount()
const;
201 std::unique_ptr<Message> getMessage(
const Endpoint& ept);
206 std::unique_ptr<Message> getMessage();
211 Endpoint& getEndpoint(std::string_view name)
const;
216 Endpoint& getEndpoint(
int index)
const;
221 Endpoint& getDataSink(std::string_view name)
const;
234 virtual void disconnect()
override;
237 int getEndpointCount()
const;
241 std::unique_ptr<MessageFederateManager> mfManager;
Definition: application_api/CoreApp.hpp:25
Definition: Endpoints.hpp:21
Definition: FederateInfo.hpp:29
Definition: application_api/Federate.hpp:48
Definition: application_api/MessageFederate.hpp:24
Endpoint & registerIndexedEndpoint(std::string_view eptName, int index1, std::string_view type=std::string_view())
Definition: application_api/MessageFederate.hpp:133
MessageFederate & operator=(const MessageFederate &mFed)=delete
virtual ~MessageFederate()
MessageFederate(MessageFederate &&mFed) noexcept
void setMessageNotificationCallback(const Endpoint &ept, const std::function< void(Endpoint &, Time)> &callback)
MessageFederate(const MessageFederate &mFed)=delete
void setMessageNotificationCallback(const std::function< void(Endpoint &, Time)> &callback)
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
Definition: helicsTime.hpp:43