helics  3.0.1
FederateState.hpp
1 /*
2 Copyright (c) 2017-2021,
3 Battelle Memorial Institute; Lawrence Livermore National Security, LLC; Alliance for Sustainable
4 Energy, LLC. See the top-level NOTICE for additional details. All rights reserved.
5 SPDX-License-Identifier: BSD-3-Clause
6 */
7 #pragma once
8 
9 #include "../common/GuardedTypes.hpp"
10 #include "ActionMessage.hpp"
11 #include "BasicHandleInfo.hpp"
12 #include "CoreTypes.hpp"
13 #include "InterfaceInfo.hpp"
14 #include "core-data.hpp"
15 #include "gmlc/containers/BlockingQueue.hpp"
16 #include "helicsTime.hpp"
17 
18 #include <atomic>
19 #include <chrono>
20 #include <deque>
21 #include <map>
22 #include <memory>
23 #include <string>
24 #include <thread>
25 #include <utility>
26 #include <vector>
27 
28 namespace helics {
29 class SubscriptionInfo;
30 class PublicationInfo;
31 class EndpointInfo;
32 class FilterInfo;
33 class CommonCore;
34 class CoreFederateInfo;
35 
36 class TimeCoordinator;
37 class MessageTimer;
38 
39 constexpr Time startupTime = Time::minVal();
40 constexpr Time initialTime{-1000000.0};
43  public:
45  FederateState(const std::string& fedName, const CoreFederateInfo& fedInfo);
46  // the destructor is defined so some classes linked with unique ptrs don't have to be defined in
47  // the header
49  FederateState(const FederateState&) = delete;
50  FederateState& operator=(const FederateState&) = delete;
53 
54  private:
55  const std::string name;
56  std::unique_ptr<TimeCoordinator>
57  timeCoord;
58  public:
60  std::atomic<GlobalFederateId> global_id;
61 
62  private:
63  std::atomic<FederateStates> state{HELICS_CREATED};
64  bool only_transmit_on_change{false};
65  bool realtime{false};
67  bool observer{false};
68  bool source_only{false};
69  bool ignore_time_mismatch_warnings{
70  false};
71  bool strict_input_type_checking{
72  false};
73  bool ignore_unit_mismatch{false};
74  bool slow_responding{false};
76  InterfaceInfo interfaceInformation;
77 
78  public:
79  std::atomic<bool> init_transmitted{false};
80  private:
82  bool wait_for_current_time{false};
84  bool mProfilerActive{false};
87  bool mLocalProfileCapture{false};
88  int errorCode{0};
89  CommonCore* parent_{nullptr};
90  std::string errorString;
91 
92  decltype(std::chrono::steady_clock::now()) start_clock_time;
93  Time rt_lag{timeZero};
94  Time rt_lead{timeZero};
95  Time grantTimeOutPeriod{timeZero};
96  std::int32_t realTimeTimerIndex{-1};
97  std::int32_t grantTimeoutTimeIndex{-1};
98  public:
100  std::atomic<bool> init_requested{false};
101  // temporary
102  std::atomic<bool> requestingMode{false};
103 
104  private:
105  bool iterating{false};
106  bool timeGranted_mode{false};
107  bool terminate_on_error{false};
109  int logLevel{HELICS_LOG_LEVEL_WARNING};
111 
112  std::uint32_t mGrantCount{0}; // this is intended to allow wrapping
114  std::shared_ptr<MessageTimer> mTimer;
116  gmlc::containers::BlockingQueue<ActionMessage> queue;
118  gmlc::containers::BlockingQueue<std::pair<std::string, std::string>> commandQueue;
120  std::atomic<uint16_t> interfaceFlags{0};
122  std::map<GlobalFederateId, std::deque<ActionMessage>> delayQueues;
123  std::vector<InterfaceHandle> events;
124  std::vector<InterfaceHandle> eventMessages;
125  std::vector<GlobalFederateId> delayedFederates;
126  Time time_granted{startupTime};
127  Time allowed_send_time{startupTime};
128  mutable std::atomic_flag processing = ATOMIC_FLAG_INIT;
129 
131  std::function<void(int, std::string_view, std::string_view)> loggerFunction;
133  std::function<std::string(std::string_view)> queryCallback;
134 
135  std::vector<std::pair<std::string, std::string>> tags;
136 
137  Time nextValueTime() const;
139  Time nextMessageTime() const;
140 
142  void setState(FederateStates newState);
143 
145  bool messageShouldBeDelayed(const ActionMessage& cmd) const;
147  void addFederateToDelay(GlobalFederateId id);
149  void generateConfig(Json::Value& base) const;
150 
151  public:
153  void reset();
155  void reInit();
157  const std::string& getIdentifier() const { return name; }
159  FederateStates getState() const;
161  InterfaceInfo& interfaces() { return interfaceInformation; }
163  const InterfaceInfo& interfaces() const { return interfaceInformation; }
164 
166  uint64_t getQueueSize(InterfaceHandle id) const;
169  uint64_t getQueueSize() const;
173  int32_t getCurrentIteration() const;
177  std::unique_ptr<Message> receive(InterfaceHandle id);
180  std::unique_ptr<Message> receiveAny(InterfaceHandle& id);
184  const std::shared_ptr<const SmallBuffer>& getValue(InterfaceHandle handle,
185  uint32_t* inputIndex);
186 
191  const std::vector<std::shared_ptr<const SmallBuffer>>& getAllValues(InterfaceHandle handle);
192 
194  void setParent(CommonCore* coreObject) { parent_ = coreObject; }
199  void setProperties(const ActionMessage& cmd);
201  void setInterfaceProperty(const ActionMessage& cmd);
203  void setProperty(int timeProperty, Time propertyVal);
205  void setProperty(int intProperty, int propertyVal);
207  void setOptionFlag(int optionFlag, bool value);
209  Time getTimeProperty(int timeProperty) const;
211  bool getOptionFlag(int optionFlag) const;
213  int32_t getHandleOption(InterfaceHandle handle, char iType, int32_t option) const;
215  uint16_t getInterfaceFlags() const { return interfaceFlags.load(); }
217  int getIntegerProperty(int intProperty) const;
219  int publicationCount() const;
221  int endpointCount() const;
223  int inputCount() const;
225  void spinlock() const
226  {
227  while (processing.test_and_set()) {
228  ; // spin
229  }
230  }
232  void sleeplock() const
233  {
234  if (!processing.test_and_set()) {
235  return;
236  }
237  // spin for 10000 tries
238  for (int ii = 0; ii < 10000; ++ii) {
239  if (!processing.test_and_set()) {
240  return;
241  }
242  }
243  while (processing.test_and_set()) {
244  std::this_thread::yield();
245  }
246  }
248  void lock() { sleeplock(); }
249 
251  bool try_lock() const { return !processing.test_and_set(); }
253  void unlock() const { processing.clear(); }
255  int loggingLevel() const { return logLevel; }
256 
258  void setTag(const std::string& tag, const std::string& value);
260  const std::string& getTag(const std::string& tag) const;
262  const std::pair<std::string, std::string>& getTagByIndex(size_t index) const
263  {
264  return tags[index];
265  }
267  auto tagCount() const { return tags.size(); }
268 
269  private:
279  MessageProcessingResult processQueue() noexcept;
280 
290  MessageProcessingResult processDelayQueue() noexcept;
294  MessageProcessingResult processActionMessage(ActionMessage& cmd);
298  void fillEventVectorUpTo(Time currentTime);
302  void fillEventVectorInclusive(Time currentTime);
306  void fillEventVectorNextIteration(Time currentTime);
308  void addDependency(GlobalFederateId fedToDependOn);
310  void addDependent(GlobalFederateId fedThatDependsOnThis);
312  int checkInterfaces();
314  std::string processQueryActual(std::string_view query) const;
318  void generateProfilingMessage(bool enterHelicsCode);
320  void generateProfilingMarker();
321 
322  public:
324  Time grantedTime() const { return time_granted; }
326  Time nextAllowedSendTime() const { return allowed_send_time; }
329  const std::vector<InterfaceHandle>& getEvents() const;
332  std::vector<GlobalFederateId> getDependencies() const;
335  std::vector<GlobalFederateId> getDependents() const;
337  const std::string& lastErrorString() const { return errorString; }
339  int lastErrorCode() const noexcept { return errorCode; }
341  void setCoreObject(CommonCore* parent);
342  // the next 5 functions are the processing functions that actually process the queue
353  IterationResult enterExecutingMode(IterationRequest iterate, bool sendRequest = false);
361  iteration_time requestTime(Time nextTime, IterationRequest iterate, bool sendRequest = false);
365  std::vector<GlobalHandle> getSubscribers(InterfaceHandle handle);
366 
370  std::vector<std::pair<GlobalHandle, std::string_view>>
372 
378  void finalize();
379 
381  void addAction(const ActionMessage& action);
383  void addAction(ActionMessage&& action);
385  opt<ActionMessage> processPostTerminationAction(const ActionMessage& action);
386 
388  void forceProcessMessage(ActionMessage& action);
389 
395  void logMessage(int level, std::string_view logMessageSource, std::string_view message) const;
396 
401  void setLogger(std::function<void(int, std::string_view, std::string_view)> logFunction)
402  {
403  loggerFunction = std::move(logFunction);
404  }
408  void setQueryCallback(std::function<std::string(std::string_view)> queryCallbackFunction)
409  {
410  queryCallback = std::move(queryCallbackFunction);
411  }
417  std::string processQuery(const std::string& query, bool force_ordering = false) const;
425  bool checkAndSetValue(InterfaceHandle pub_id, const char* data, uint64_t len);
426 
428  void routeMessage(const ActionMessage& msg);
430  void createInterface(InterfaceType htype,
431  InterfaceHandle handle,
432  const std::string& key,
433  const std::string& type,
434  const std::string& units);
436  void closeInterface(InterfaceHandle handle, InterfaceType type);
438  void sendCommand(ActionMessage& command);
439 
441  std::pair<std::string, std::string> getCommand();
443  std::pair<std::string, std::string> waitCommand();
444 };
445 
446 } // namespace helics
helics::timeZero
constexpr Time timeZero
Definition: helicsTime.hpp:31
HELICS_LOG_LEVEL_PROFILING
@ HELICS_LOG_LEVEL_PROFILING
Definition: helics_enums.h:183
helics::FederateState::receive
std::unique_ptr< Message > receive(InterfaceHandle id)
Definition: FederateState.cpp:220
helics::FederateState::getEvents
const std::vector< InterfaceHandle > & getEvents() const
Definition: FederateState.cpp:798
helics::FederateState::getAllValues
const std::vector< std::shared_ptr< const SmallBuffer > > & getAllValues(InterfaceHandle handle)
Definition: FederateState.cpp:263
helics::initializationTime
constexpr Time initializationTime
Definition: helicsTime.hpp:38
helics::FederateState::genericUnspecifiedQueueProcess
IterationResult genericUnspecifiedQueueProcess()
Definition: FederateState.cpp:768
helics::FederateState::getState
FederateStates getState() const
Definition: FederateState.cpp:167
helics::FederateState::nextAllowedSendTime
Time nextAllowedSendTime() const
Definition: FederateState.hpp:326
helics::FederateState::global_id
std::atomic< GlobalFederateId > global_id
global id code, default to invalid
Definition: FederateState.hpp:60
helics::returnableResult
bool returnableResult(MessageProcessingResult result)
Definition: CoreTypes.hpp:75
helics::FederateState::getTag
const std::string & getTag(const std::string &tag) const
Definition: FederateState.cpp:2124
helics::FederateState::getMessageDestinations
std::vector< std::pair< GlobalHandle, std::string_view > > getMessageDestinations(InterfaceHandle handle)
Definition: FederateState.cpp:571
helics::FederateState::interfaces
InterfaceInfo & interfaces()
Definition: FederateState.hpp:161
helics::FederateState::lastErrorString
const std::string & lastErrorString() const
Definition: FederateState.hpp:337
helics::InterfaceInfo
Definition: InterfaceInfo.hpp:26
helics::FederateState::receiveAny
std::unique_ptr< Message > receiveAny(InterfaceHandle &id)
Definition: FederateState.cpp:229
helics::FederateState::publicationCount
int publicationCount() const
Definition: FederateState.cpp:1723
helics::FederateState::enterExecutingMode
IterationResult enterExecutingMode(IterationRequest iterate, bool sendRequest=false)
Definition: FederateState.cpp:477
helics::EndpointInfo
Definition: EndpointInfo.hpp:32
core-data.hpp
helics::InterfaceType
InterfaceType
Definition: CoreTypes.hpp:96
helics::FederateState::getCurrentIteration
int32_t getCurrentIteration() const
Definition: FederateState.cpp:172
helics::EndpointInfo::id
const GlobalHandle id
identifier for the handle
Definition: EndpointInfo.hpp:40
helics_definitions.hpp
base helics enumerations for C++ API's, a namespace wrapper for the definitions defined in helics_enu...
helics::FederateState::getTimeProperty
Time getTimeProperty(int timeProperty) const
Definition: FederateState.cpp:1644
HELICS_LOG_LEVEL_WARNING
@ HELICS_LOG_LEVEL_WARNING
Definition: helics_enums.h:185
helics::FederateState::getTagByIndex
const std::pair< std::string, std::string > & getTagByIndex(size_t index) const
Definition: FederateState.hpp:262
helics::CommonCore
Definition: CommonCore.hpp:73
helics::FederateState::getOptionFlag
bool getOptionFlag(int optionFlag) const
Definition: FederateState.cpp:1660
helics::InterfaceHandle
Definition: LocalFederateId.hpp:65
helics::Time
TimeRepresentation< count_time< 9 > > Time
Definition: helicsTime.hpp:27
helics::FederateState::reset
void reset()
Definition: FederateState.cpp:149
FORCE_ITERATION
constexpr auto FORCE_ITERATION
simplified alias to force an iteration
Definition: CoreTypes.hpp:112
helics::FederateState::lock
void lock()
Definition: FederateState.hpp:248
helics::FederateState::sendCommand
void sendCommand(ActionMessage &command)
Definition: FederateState.cpp:1862
helics::GlobalFederateId
Definition: GlobalFederateId.hpp:68
helics::ActionMessage
Definition: ActionMessage.hpp:30
helics::FederateState::init_transmitted
std::atomic< bool > init_transmitted
the initialization request has been transmitted
Definition: FederateState.hpp:79
helics::FederateState::waitSetup
IterationResult waitSetup()
Definition: FederateState.cpp:417
helics::HELICS_UNKNOWN
@ HELICS_UNKNOWN
unknown state
Definition: CoreTypes.hpp:29
helics::parent_broker_id
constexpr GlobalBrokerId parent_broker_id
Definition: GlobalFederateId.hpp:60
helics::FederateState::local_id
LocalFederateId local_id
id code for the local federate descriptor
Definition: FederateState.hpp:59
helics::FederateState::reInit
void reInit()
Definition: FederateState.cpp:160
helics::FederateState::getIntegerProperty
int getIntegerProperty(int intProperty) const
Definition: FederateState.cpp:1711
helics::FederateState::lastErrorCode
int lastErrorCode() const noexcept
Definition: FederateState.hpp:339
iteration_requested_flag
@ iteration_requested_flag
indicator that an iteration has been requested
Definition: flagOperations.hpp:16
helics::FederateState::try_lock
bool try_lock() const
Definition: FederateState.hpp:251
helics::ActionMessage::counter
uint16_t counter
26 counter for filter tracking or message counter
Definition: ActionMessage.hpp:41
helics::SmallBuffer::to_string
std::string_view to_string() const
Definition: SmallBuffer.hpp:222
helics::FederateState::inputCount
int inputCount() const
Definition: FederateState.cpp:1733
checkActionFlag
bool checkActionFlag(uint16_t flags, FlagIndex flag)
Definition: flagOperations.hpp:85
helics::FederateState::sleeplock
void sleeplock() const
Definition: FederateState.hpp:232
helics::GlobalHandle::handle
InterfaceHandle handle
the interface handle component
Definition: GlobalFederateId.hpp:131
helics::FederateState::setOptionFlag
void setOptionFlag(int optionFlag, bool value)
Definition: FederateState.cpp:1549
ITERATE_IF_NEEDED
constexpr auto ITERATE_IF_NEEDED
Definition: CoreTypes.hpp:114
helics::FederateState::getIdentifier
const std::string & getIdentifier() const
Definition: FederateState.hpp:157
helics::FederateState::createInterface
void createInterface(InterfaceType htype, InterfaceHandle handle, const std::string &key, const std::string &type, const std::string &units)
Definition: FederateState.cpp:297
helics::FederateState::setLogger
void setLogger(std::function< void(int, std::string_view, std::string_view)> logFunction)
Definition: FederateState.hpp:401
helics::FederateState::grantedTime
Time grantedTime() const
Definition: FederateState.hpp:324
helics::commandErrorString
const char * commandErrorString(int errorCode)
Definition: ActionMessage.cpp:823
helics::FederateState::processPostTerminationAction
opt< ActionMessage > processPostTerminationAction(const ActionMessage &action)
Definition: FederateState.cpp:392
helics::EndpointInfo::getMessage
std::unique_ptr< Message > getMessage(Time maxTime)
Definition: EndpointInfo.cpp:82
helics::FederateState::setProperty
void setProperty(int timeProperty, Time propertyVal)
Definition: FederateState.cpp:1474
helics::FederateState::waitCommand
std::pair< std::string, std::string > waitCommand()
Definition: FederateState.cpp:1918
helics::iteration_time::grantedTime
Time grantedTime
the time of the granted step
Definition: helicsTime.hpp:48
helics::IterationRequest
IterationRequest
Definition: CoreTypes.hpp:89
helics::ActionMessage::setExtraData
void setExtraData(int32_t data)
Definition: ActionMessage.hpp:157
helics::FederateState::getQueueSize
uint64_t getQueueSize() const
Definition: FederateState.cpp:211
helics::FederateState::setQueryCallback
void setQueryCallback(std::function< std::string(std::string_view)> queryCallbackFunction)
Definition: FederateState.hpp:408
indicator_flag
@ indicator_flag
flag used for setting values
Definition: flagOperations.hpp:21
helics::FederateState::getDependencies
std::vector< GlobalFederateId > getDependencies() const
Definition: FederateState.cpp:1738
helics::FederateState::unlock
void unlock() const
Definition: FederateState.hpp:253
helics::FederateState::setProperties
void setProperties(const ActionMessage &cmd)
Definition: FederateState.cpp:1367
helics::IterationResult
IterationResult
Definition: CoreTypes.hpp:80
helics::FederateState::getInterfaceFlags
uint16_t getInterfaceFlags() const
Definition: FederateState.hpp:215
helics::FederateState::~FederateState
~FederateState()
setActionFlag
void setActionFlag(FlagContainer &M, FlagIndex flag)
Definition: flagOperations.hpp:77
helics::FederateState::spinlock
void spinlock() const
Definition: FederateState.hpp:225
helics::ActionMessage::payload
SmallBuffer payload
buffer to contain the data payload
Definition: ActionMessage.hpp:48
helics::ActionMessage::dest_id
GlobalFederateId dest_id
20 fed_id for a targeted message
Definition: ActionMessage.hpp:39
helics::FederateState::endpointCount
int endpointCount() const
Definition: FederateState.cpp:1728
helics::HELICS_EXECUTING
@ HELICS_EXECUTING
the federation has entered execution state and it now advancing in time
Definition: CoreTypes.hpp:25
helics::prettyPrintString
std::string prettyPrintString(const ActionMessage &command)
Definition: ActionMessage.cpp:841
helics::TimeCoordinator
Definition: TimeCoordinator.hpp:55
helics::FederateState::tagCount
auto tagCount() const
Definition: FederateState.hpp:267
helics::InterfaceInfo::setGlobalId
void setGlobalId(GlobalFederateId newglobalId)
Definition: InterfaceInfo.hpp:64
PROFILING
@ PROFILING
profiling log level
Definition: loggingHelper.hpp:23
helics::FederateState::FederateState
FederateState(const std::string &fedName, const CoreFederateInfo &fedInfo)
Definition: FederateState.cpp:102
helics::FederateState::getCommand
std::pair< std::string, std::string > getCommand()
Definition: FederateState.cpp:1903
InterfaceInfo.hpp
helics::FederateState::finalize
void finalize()
Definition: FederateState.cpp:782
error_flag
@ error_flag
flag indicating an error condition associated with the command
Definition: flagOperations.hpp:20
helics::HELICS_TERMINATING
@ HELICS_TERMINATING
the federate is in the process of shutting down
Definition: CoreTypes.hpp:26
helics::FederateState
Definition: FederateState.hpp:42
helics::ActionMessage::actionTime
Time actionTime
40 the time an action took place or will take place //32
Definition: ActionMessage.hpp:44
helics::FederateState::init_requested
std::atomic< bool > init_requested
Definition: FederateState.hpp:100
helics::FederateState::forceProcessMessage
void forceProcessMessage(ActionMessage &action)
Definition: FederateState.cpp:407
helics::FederateState::loggingLevel
int loggingLevel() const
Definition: FederateState.hpp:255
helics::FederateState::processQuery
std::string processQuery(const std::string &query, bool force_ordering=false) const
Definition: FederateState.cpp:2087
helics::ActionMessage::setDestination
void setDestination(GlobalHandle hand)
Definition: ActionMessage.hpp:99
helics::FederateState::enterInitializingMode
IterationResult enterInitializingMode()
Definition: FederateState.cpp:445
destination_target
@ destination_target
indicator that the target is a destination target
Definition: flagOperations.hpp:17
helics::FederateState::routeMessage
void routeMessage(const ActionMessage &msg)
Definition: FederateState.cpp:268
helics
the main namespace for the helics co-simulation library User functions will be in the helics namespac...
Definition: AsyncFedCallInfo.hpp:14
required_flag
@ required_flag
flag indicating that an action or match is required
Definition: flagOperations.hpp:18
helics::CoreFederateInfo
Definition: CoreFederateInfo.hpp:16
helics::iteration_time
Definition: helicsTime.hpp:47
optional_flag
@ optional_flag
flag indicating that a connection is optional and may not be matched
Definition: flagOperations.hpp:24
HELICS_LOG_LEVEL_SUMMARY
@ HELICS_LOG_LEVEL_SUMMARY
Definition: helics_enums.h:187
HELICS_SEQUENCING_MODE_FAST
@ HELICS_SEQUENCING_MODE_FAST
Definition: helics_enums.h:365
helics::FederateStates
FederateStates
Definition: CoreTypes.hpp:21
helics::FederateState::interfaces
const InterfaceInfo & interfaces() const
Definition: FederateState.hpp:163
helics::createMessageFromCommand
std::unique_ptr< Message > createMessageFromCommand(const ActionMessage &cmd)
Definition: ActionMessage.cpp:632
helics::LocalFederateId
Definition: LocalFederateId.hpp:22
helics::FederateState::addAction
void addAction(const ActionMessage &action)
Definition: FederateState.cpp:283
helics::getValue
X getValue(ValueFederate &fed, const std::string &key)
Definition: Subscriptions.hpp:30
helics::FederateState::setParent
void setParent(CommonCore *coreObject)
Definition: FederateState.hpp:194
helics::PublicationInfo::CheckSetValue
bool CheckSetValue(const char *dataToCheck, uint64_t len)
Definition: PublicationInfo.cpp:14
helics::FederateState::requestTime
iteration_time requestTime(Time nextTime, IterationRequest iterate, bool sendRequest=false)
Definition: FederateState.cpp:580
helics::FederateState::logMessage
void logMessage(int level, std::string_view logMessageSource, std::string_view message) const
Definition: FederateState.cpp:1815
helics::ActionMessage::action
action_message_def::action_t action() const noexcept
Definition: ActionMessage.hpp:88
helics::FederateState::getValue
const std::shared_ptr< const SmallBuffer > & getValue(InterfaceHandle handle, uint32_t *inputIndex)
Definition: FederateState.cpp:256
helics::FederateState::closeInterface
void closeInterface(InterfaceHandle handle, InterfaceType type)
Definition: FederateState.cpp:350
helics::FederateState::getSubscribers
std::vector< GlobalHandle > getSubscribers(InterfaceHandle handle)
Definition: FederateState.cpp:560
helics::FederateState::setInterfaceProperty
void setInterfaceProperty(const ActionMessage &cmd)
Definition: FederateState.cpp:1408
helics::FederateState::getDependents
std::vector< GlobalFederateId > getDependents() const
Definition: FederateState.cpp:1743
helics::HELICS_ERROR
@ HELICS_ERROR
the federation has encountered an error
Definition: CoreTypes.hpp:27
helics::MessageProcessingResult
MessageProcessingResult
Definition: CoreTypes.hpp:64
helics::HELICS_INITIALIZING
@ HELICS_INITIALIZING
Definition: CoreTypes.hpp:23
helics::HELICS_FINISHED
@ HELICS_FINISHED
the federation has finished its execution
Definition: CoreTypes.hpp:28
helics::EndpointInfo::availableMessages
int32_t availableMessages() const
Definition: EndpointInfo.cpp:127
helics::FederateState::setTag
void setTag(const std::string &tag, const std::string &value)
Definition: FederateState.cpp:2108
CoreTypes.hpp
helicsTime.hpp
helics::ActionMessage::setSource
void setSource(GlobalHandle hand)
Definition: ActionMessage.hpp:93
make_flags
constexpr uint16_t make_flags(unsigned int flag)
Definition: flagOperations.hpp:117
helics::FederateState::checkAndSetValue
bool checkAndSetValue(InterfaceHandle pub_id, const char *data, uint64_t len)
Definition: FederateState.cpp:177
helics::fedStateString
const std::string & fedStateString(FederateStates state)
Definition: FederateState.cpp:1833
helics::FederateState::getHandleOption
int32_t getHandleOption(InterfaceHandle handle, char iType, int32_t option) const
Definition: FederateState.cpp:1695
helics::ActionMessage::source_id
GlobalFederateId source_id
12 – for federate_id or route_id
Definition: ActionMessage.hpp:37
helics::FederateState::setCoreObject
void setCoreObject(CommonCore *parent)
Definition: FederateState.cpp:1808
helics::setIterationFlags
void setIterationFlags(ActionMessage &command, IterationRequest iterate)
Definition: ActionMessage.cpp:930
helics::generateJsonErrorResponse
std::string generateJsonErrorResponse(JsonErrorCodes code, const std::string &message)
Definition: JsonGeneration.hpp:36