helics  2.8.1
ActionMessage.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 "ActionMessageDefintions.hpp"
10 #include "basic_core_types.hpp"
11 
12 #include <memory>
13 #include <string>
14 #include <utility>
15 #include <vector>
16 
17 namespace helics {
18 constexpr int targetStringLoc{0};
19 constexpr int sourceStringLoc{1};
20 constexpr int unitStringLoc{1};
21 constexpr int origSourceStringLoc{2};
22 constexpr int origDestStringLoc{3};
23 constexpr int typeStringLoc{0};
24 constexpr int typeOutStringLoc{1};
25 
26 constexpr int32_t cmd_info_basis{65536};
27 
30  // need to try to make sure this object is under 64 bytes in size to fit in cache lines NOT
31  // there yet
32  private:
33  action_message_def::action_t messageAction{CMD_IGNORE}; // 4 -- command
34  public:
35  int32_t messageID{0};
40  uint16_t counter{0};
41  uint16_t flags{0};
42  uint32_t sequenceID{0};
44  std::string payload;
45  std::string& name;
50  private:
51  std::vector<std::string> stringData;
52  public:
54  ActionMessage() noexcept: name(payload) {}
59  /* implicit */ ActionMessage(action_message_def::action_t startingAction); // NOLINT
63  global_federate_id sourceId,
64  global_federate_id destId);
66  ActionMessage(ActionMessage&& act) noexcept;
68  explicit ActionMessage(std::unique_ptr<Message> message);
70  explicit ActionMessage(const std::string& bytes);
72  explicit ActionMessage(const std::vector<char>& bytes);
74  explicit ActionMessage(const char* data, size_t size);
78  ActionMessage(const ActionMessage& act);
82  ActionMessage& operator=(ActionMessage&& act) noexcept;
87  ActionMessage& operator=(std::unique_ptr<Message> message) noexcept;
89  action_message_def::action_t action() const noexcept { return messageAction; }
92 
95  {
96  source_id = hand.fed_id;
97  source_handle = hand.handle;
98  }
101  {
102  dest_id = hand.fed_id;
103  dest_handle = hand.handle;
104  }
106  const std::vector<std::string>& getStringData() const { return stringData; }
107 
108  void clearStringData() { stringData.clear(); }
109  // most use cases for this involve short strings, or already have references that need to be
110  // copied so supporting move isn't going to be that useful here, the long strings are going in
111  // the payload
112  void setStringData(const std::string& string1)
113  {
114  stringData.resize(1);
115  stringData[0] = string1;
116  }
117  void setStringData(const std::string& string1, const std::string& string2)
118  {
119  stringData.resize(2);
120  stringData[0] = string1;
121  stringData[1] = string2;
122  }
123  void setStringData(const std::string& string1,
124  const std::string& string2,
125  const std::string& string3)
126  {
127  stringData.resize(3);
128  stringData[0] = string1;
129  stringData[1] = string2;
130  stringData[2] = string3;
131  }
132  void setStringData(const std::string& string1,
133  const std::string& string2,
134  const std::string& string3,
135  const std::string& string4)
136  {
137  stringData.resize(4);
138  stringData[0] = string1;
139  stringData[1] = string2;
140  stringData[2] = string3;
141  stringData[3] = string4;
142  }
143  const std::string& getString(int index) const;
144 
145  void setString(int index, const std::string& str);
151  void swapSourceDest() noexcept
152  {
153  std::swap(source_id, dest_id);
154  std::swap(source_handle, dest_handle);
155  }
159  int32_t getExtraData() const { return dest_handle.baseValue(); }
163  int32_t getExtraDestData() const { return source_handle.baseValue(); }
164  // functions that convert to and from a byte stream
165 
167  int serializedByteCount() const;
173  int toByteArray(char* data, int buffer_size) const;
175  void to_string(std::string& data) const;
177  std::string to_string() const;
179  std::string to_json_string() const;
182  std::string packetize() const;
183  void packetize(std::string& data) const;
186  std::string packetize_json() const;
188  void to_vector(std::vector<char>& data) const;
190  std::vector<char> to_vector() const;
192  int fromByteArray(const char* data, int buffer_size);
196  int depacketize(const char* data, int buffer_size);
199  std::size_t from_string(const std::string& data);
202  bool from_json_string(const std::string& data);
204  std::size_t from_vector(const std::vector<char>& data);
205 
206  friend std::unique_ptr<Message> createMessageFromCommand(const ActionMessage& cmd);
207  friend std::unique_ptr<Message> createMessageFromCommand(ActionMessage&& cmd);
208 };
209 
210 inline bool operator<(const ActionMessage& cmd, const ActionMessage& cmd2)
211 {
212  return (cmd.actionTime < cmd2.actionTime);
213 }
214 
218 std::unique_ptr<Message> createMessageFromCommand(const ActionMessage& cmd);
219 
223 std::unique_ptr<Message> createMessageFromCommand(ActionMessage&& cmd);
224 
226 inline bool isProtocolCommand(const ActionMessage& command) noexcept
227 {
228  return ((command.action() == CMD_PROTOCOL) || (command.action() == CMD_PROTOCOL_PRIORITY) ||
229  (command.action() == CMD_PROTOCOL_BIG));
230 }
232 inline bool isPriorityCommand(const ActionMessage& command) noexcept
233 {
234  return (command.action() < action_message_def::action_t::cmd_ignore);
235 }
236 
237 inline bool isTimingCommand(const ActionMessage& command) noexcept
238 {
239  switch (command.action()) {
240  case CMD_DISCONNECT:
241  case CMD_BROADCAST_DISCONNECT:
242  case CMD_DISCONNECT_CORE:
243  case CMD_DISCONNECT_BROKER:
244  case CMD_DISCONNECT_FED:
245  case CMD_TIME_GRANT:
246  case CMD_TIME_REQUEST:
247  case CMD_EXEC_GRANT:
248  case CMD_EXEC_REQUEST:
249  case CMD_PRIORITY_DISCONNECT:
250  case CMD_TERMINATE_IMMEDIATELY:
251  case CMD_ERROR:
252  case CMD_LOCAL_ERROR:
253  case CMD_GLOBAL_ERROR:
254  return true;
255  default:
256  return false;
257  }
258 }
259 
260 inline bool isDependencyCommand(const ActionMessage& command) noexcept
261 {
262  switch (command.action()) {
263  case CMD_ADD_DEPENDENCY:
264  case CMD_REMOVE_DEPENDENCY:
265  case CMD_ADD_DEPENDENT:
266  case CMD_REMOVE_DEPENDENT:
267  case CMD_ADD_INTERDEPENDENCY:
268  case CMD_REMOVE_INTERDEPENDENCY:
269  return true;
270  default:
271  return false;
272  }
273 }
274 
276 inline bool isDisconnectCommand(const ActionMessage& command) noexcept
277 {
278  switch (command.action()) {
279  case CMD_DISCONNECT:
280  case CMD_DISCONNECT_CHECK:
281  case CMD_DISCONNECT_NAME:
282  case CMD_USER_DISCONNECT:
283  case CMD_DISCONNECT_FED:
284  case CMD_DISCONNECT_CORE:
285  case CMD_PRIORITY_DISCONNECT:
286  case CMD_TERMINATE_IMMEDIATELY:
287  case CMD_REMOVE_FILTER:
288  case CMD_REMOVE_ENDPOINT:
289  case CMD_DISCONNECT_FED_ACK:
290  case CMD_DISCONNECT_CORE_ACK:
291  case CMD_DISCONNECT_BROKER_ACK:
292  case CMD_DISCONNECT_BROKER:
293  case CMD_BROADCAST_DISCONNECT:
294  case CMD_STOP:
295  return true;
296  case CMD_TIME_GRANT:
297  return (command.actionTime == Time::maxVal());
298  default:
299  return false;
300  }
301 }
302 
304 inline bool isErrorCommand(const ActionMessage& command) noexcept
305 {
306  switch (command.action()) {
307  case CMD_ERROR:
308  case CMD_LOCAL_ERROR:
309  case CMD_GLOBAL_ERROR:
310  return true;
311  default:
312  return false;
313  }
314 }
315 
317 inline bool isValidCommand(const ActionMessage& command) noexcept
318 {
319  return (command.action() != action_message_def::action_t::cmd_invalid);
320 }
325 std::string prettyPrintString(const ActionMessage& command);
326 
329 std::ostream& operator<<(std::ostream& os, const ActionMessage& command);
330 
335 int appendMessage(ActionMessage& m, const ActionMessage& newMessage);
336 
341 std::string errorMessageString(const ActionMessage& command);
342 
344 void setIterationFlags(ActionMessage& command, iteration_request iterate);
345 
346 } // namespace helics
helics::timeZero
constexpr Time timeZero
Definition: helics-time.hpp:31
generateJsonString
std::string generateJsonString(const Json::Value &block)
Definition: JsonProcessingFunctions.cpp:97
data
@ data
print timing+data transmissions
Definition: loggingHelper.hpp:30
helics::action_message_def::action_t::cmd_pub
@ cmd_pub
publish a value
helics::action_message_def::action_t::cmd_remove_subscriber
@ cmd_remove_subscriber
cmd to remove a target from connection
helics::action_message_def::action_t::cmd_disconnect_broker
@ cmd_disconnect_broker
disconnect a broker
helics::ActionMessage::getDest
global_handle getDest() const
Definition: ActionMessage.hpp:149
helics::ActionMessage::from_vector
std::size_t from_vector(const std::vector< char > &data)
Definition: ActionMessage.cpp:617
helics::action_message_def::action_t::cmd_log
@ cmd_log
log a message with the root broker
helics::ActionMessage::source_id
global_federate_id source_id
12 – for federate_id or route_id
Definition: ActionMessage.hpp:36
helics::action_message_def::action_t::cmd_disconnect_fed_ack
@ cmd_disconnect_fed_ack
federate disconnect ack
helics::ActionMessage::setExtraDestData
void setExtraDestData(int32_t data)
Definition: ActionMessage.hpp:161
helics::action_message_def::action_t::cmd_init
@ cmd_init
request entry to init mode
helics::action_message_def::action_t::cmd_disconnect
@ cmd_disconnect
disconnect command
helics::action_message_def::action_t::cmd_remove_named_publication
@ cmd_remove_named_publication
cmd to remove a publication from connection by name
helics::action_message_def::action_t::cmd_remove_named_filter
@ cmd_remove_named_filter
cmd to remove a filter from connection by name
helics::action_message_def::action_t::cmd_add_named_input
@ cmd_add_named_input
command to add a named input as a target
helics::action_message_def::action_t::cmd_time_request
@ cmd_time_request
request a time or iteration
helics::action_message_def::action_t::cmd_add_dependency
@ cmd_add_dependency
command to send a federate dependency information
helics::ActionMessage::setSource
void setSource(global_handle hand)
Definition: ActionMessage.hpp:94
helics::operator<<
std::ostream & operator<<(std::ostream &os, const ActionMessage &command)
Definition: ActionMessage.cpp:933
helics::ActionMessage::dest_handle
interface_handle dest_handle
24 local handle for a targeted message
Definition: ActionMessage.hpp:39
helics::action_message_def::action_t::cmd_time_grant
@ cmd_time_grant
grant a time or iteration
helics::action_message_def::action_t::cmd_priority_disconnect
@ cmd_priority_disconnect
command to disconnect a broker from a higher level broker
helics::ActionMessage::toByteArray
int toByteArray(char *data, int buffer_size) const
Definition: ActionMessage.cpp:177
helics::action_message_def::action_t::cmd_remove_interdependency
@ cmd_remove_interdependency
command to remove a federate as both dependent and a dependency
helics::action_message_def::action_t::cmd_remove_named_endpoint
@ cmd_remove_named_endpoint
cmd to remove an endpoint
helics::action_message_def::action_t::cmd_fed_configure_time
@ cmd_fed_configure_time
command to update the configuration of a federate a time parameter
helics::iteration_request
iteration_request
Definition: core-types.hpp:90
helics::action_message_def::action_t::cmd_disconnect_name
@ cmd_disconnect_name
disconnect a broker or core by name vs id
helics::ActionMessage::getStringData
const std::vector< std::string > & getStringData() const
Definition: ActionMessage.hpp:106
helics::action_message_def::action_t
action_t
Definition: ActionMessageDefintions.hpp:20
helics::action_message_def::action_t::cmd_remove_dependent
@ cmd_remove_dependent
command to remove a dependent from a federates consideration
helics::action_message_def::action_t::cmd_filter_result
@ cmd_filter_result
the results of a filter message going back to its originator
helics::interface_handle::baseValue
constexpr base_type baseValue() const
Definition: federate_id.hpp:73
helics::ActionMessage::source_handle
interface_handle source_handle
16 – for local handle or local code
Definition: ActionMessage.hpp:37
helics::action_message_def::action_t::cmd_send_for_filter
@ cmd_send_for_filter
send a message to be filtered and forward on to the destination
helics::global_federate_id
Definition: global_federate_id.hpp:68
helics::action_message_def::action_t::cmd_data_link
@ cmd_data_link
command to connect a publication with an endpoint
helics::ActionMessage::setAction
void setAction(action_message_def::action_t newAction)
Definition: ActionMessage.cpp:140
helics::ActionMessage::depacketize
int depacketize(const char *data, int buffer_size)
Definition: ActionMessage.cpp:540
helics::setIterationFlags
void setIterationFlags(ActionMessage &command, iteration_request iterate)
Definition: ActionMessage.cpp:950
helics::action_message_def::action_t::cmd_stop
@ cmd_stop
halt execution
helics::action_message_def::action_t::cmd_ping
@ cmd_ping
request for an Echo response
helics::parent_broker_id
constexpr global_broker_id parent_broker_id
Definition: global_federate_id.hpp:60
helics::ActionMessage::packetize_json
std::string packetize_json() const
Definition: ActionMessage.cpp:338
helics::ActionMessage::to_string
void to_string(std::string &data) const
Definition: ActionMessage.cpp:383
helics::isErrorCommand
bool isErrorCommand(const ActionMessage &command) noexcept
Definition: ActionMessage.hpp:304
helics::Time
TimeRepresentation< count_time< 9 > > Time
Definition: helics-time.hpp:27
helics::action_message_def::action_t::cmd_filter_link
@ cmd_filter_link
command to add a target to a filter
helics::action_message_def::action_t::cmd_remove_publication
@ cmd_remove_publication
cmd to remove a publication from connection
helics::ActionMessage
Definition: ActionMessage.hpp:29
helics::ActionMessage::to_json_string
std::string to_json_string() const
Definition: ActionMessage.cpp:295
helics::action_message_def::action_t::cmd_error
@ cmd_error
indicate an error with a federate
helics::action_message_def::action_t::cmd_time_barrier_request
@ cmd_time_barrier_request
request a time barrier
helics::action_message_def::action_t::cmd_register_route
@ cmd_register_route
instructions to create a direct route to another federate
helics::iteration_request::force_iteration
@ force_iteration
force an iteration whether it is needed or not
iteration_requested_flag
@ iteration_requested_flag
indicator that an iteration has been requested
Definition: flagOperations.hpp:16
helics::action_message_def::action_t::cmd_tick
@ cmd_tick
command for a timer tick
helics::appendMessage
int appendMessage(ActionMessage &m, const ActionMessage &newMessage)
Definition: ActionMessage.cpp:939
helics::ActionMessage::counter
uint16_t counter
26 counter for filter tracking or message counter
Definition: ActionMessage.hpp:40
helics::action_message_def::action_t::cmd_time_barrier_clear
@ cmd_time_barrier_clear
clear a global time barrier
helics::ActionMessage::getExtraDestData
int32_t getExtraDestData() const
Definition: ActionMessage.hpp:163
helics::action_message_def::action_t::cmd_ack
@ cmd_ack
acknowledge command to for various purposes
checkActionFlag
bool checkActionFlag(uint16_t flags, FlagIndex flag)
Definition: flagOperations.hpp:75
helics::action_message_def::action_t::cmd_add_dependent
@ cmd_add_dependent
command to add a dependent to a federate
helics::action_message_def::action_t::cmd_remove_endpoint
@ cmd_remove_endpoint
cmd to remove an endpoint
helics::isValidCommand
bool isValidCommand(const ActionMessage &command) noexcept
Definition: ActionMessage.hpp:317
helics::global_handle::fed_id
global_federate_id fed_id
the federate id component
Definition: global_federate_id.hpp:130
helics::action_message_def::action_t::cmd_ignore
@ cmd_ignore
null command
helics::global_handle::handle
interface_handle handle
the interface handle component
Definition: global_federate_id.hpp:131
helics::commandErrorString
const char * commandErrorString(int errorCode)
Definition: ActionMessage.cpp:837
helics::ActionMessage::sequenceID
uint32_t sequenceID
a sequence number for ordering
Definition: ActionMessage.hpp:42
helics::iteration_request::iterate_if_needed
@ iterate_if_needed
indicator that the iterations need to continue
helics::action_message_def::action_t::cmd_add_named_publication
@ cmd_add_named_publication
command to add a named publication as a target
helics::iteration_request::no_iterations
@ no_iterations
indicator that the iterations have completed
helics::action_message_def::action_t::cmd_time_unblock
@ cmd_time_unblock
clear a time block
helics::action_message_def::action_t::cmd_invalid
@ cmd_invalid
indicates that command has generated an invalid state
helics::action_message_def::action_t::cmd_query_reply
@ cmd_query_reply
response to a query
helics::ActionMessage::payload
std::string payload
Definition: ActionMessage.hpp:44
helics::action_message_def::action_t::cmd_exec_grant
@ cmd_exec_grant
grant entry to exec mode or iterate
helics::global_handle
Definition: global_federate_id.hpp:128
helics::global_federate_id::baseValue
constexpr base_type baseValue() const
Definition: global_federate_id.hpp:83
helics::action_message_def::action_t::cmd_terminate_immediately
@ cmd_terminate_immediately
immediate halt no-disconnect;
helics::action_message_def::action_t::priority_null_info_command
@ priority_null_info_command
helics::ActionMessage::from_json_string
bool from_json_string(const std::string &data)
Definition: ActionMessage.cpp:583
helics::action_message_def::action_t::cmd_priority_ack
@ cmd_priority_ack
doesn't do anything
helics::action_message_def::action_t::cmd_init_grant
@ cmd_init_grant
grant entry to initialization mode
helics::action_message_def::action_t::cmd_fed_configure_int
@ cmd_fed_configure_int
command to update the configuration of a federate an int parameter
helics::ActionMessage::messageID
int32_t messageID
8 – message ID for a variety of purposes
Definition: ActionMessage.hpp:35
helics::action_message_def::action_t::cmd_reg_end
@ cmd_reg_end
register an endpoint
helics::ActionMessage::setExtraData
void setExtraData(int32_t data)
Definition: ActionMessage.hpp:157
loadJsonStr
Json::Value loadJsonStr(const std::string &jsonString)
Definition: JsonProcessingFunctions.cpp:50
helics::ActionMessage::to_vector
std::vector< char > to_vector() const
Definition: ActionMessage.cpp:367
helics::action_message_def::action_t::cmd_resend
@ cmd_resend
command to resend some data
use_json_serialization_flag
@ use_json_serialization_flag
flag to indicate it should use the json packetization
Definition: flagOperations.hpp:22
helics::action_message_def::action_t::cmd_disconnect_core_ack
@ cmd_disconnect_core_ack
ack for core disconnect
helics::action_message_def::action_t::cmd_broker_configure
@ cmd_broker_configure
command to update the configuration of a broker
setActionFlag
void setActionFlag(FlagContainer &M, FlagIndex flag)
Definition: flagOperations.hpp:67
helics::action_message_def::action_t::cmd_warning
@ cmd_warning
indicate some sort of warning
helics::interface_handle
Definition: federate_id.hpp:65
helics::action_message_def::action_t::cmd_fed_ack
@ cmd_fed_ack
a reply with the global id or an error if the fed registration failed
helics::ActionMessage::Te
Time Te
48 event time
Definition: ActionMessage.hpp:47
helics::action_message_def::action_t::cmd_send_route
@ cmd_send_route
command to define a route information
helics::action_message_def::action_t::cmd_reg_pub
@ cmd_reg_pub
register a publication
helics::action_message_def::action_t::cmd_add_named_endpoint
@ cmd_add_named_endpoint
command to add a named endpoint as a target
helics::action_message_def::action_t::cmd_reg_input
@ cmd_reg_input
register an input interface
helics::ActionMessage::serializedByteCount
int serializedByteCount() const
Definition: ActionMessage.cpp:262
helics::prettyPrintString
std::string prettyPrintString(const ActionMessage &command)
Definition: ActionMessage.cpp:861
helics::ActionMessage::getSource
global_handle getSource() const
Definition: ActionMessage.hpp:147
helics::action_message_def::action_t::cmd_disconnect_broker_ack
@ cmd_disconnect_broker_ack
ack for broker disconnect
helics::action_message_def::action_t::cmd_time_check
@ cmd_time_check
command to run a check on whether time can be granted
helics::ActionMessage::flags
uint16_t flags
28 set of messageFlags
Definition: ActionMessage.hpp:41
helics::isDisconnectCommand
bool isDisconnectCommand(const ActionMessage &command) noexcept
Definition: ActionMessage.hpp:276
helics::action_message_def::action_t::cmd_disconnect_core
@ cmd_disconnect_core
disconnect a core
helics::action_message_def::action_t::cmd_add_endpoint
@ cmd_add_endpoint
notify of a source endpoint
helics::action_message_def::action_t::cmd_send_message
@ cmd_send_message
send a message
error_flag
@ error_flag
flag indicating an error condition associated with the command
Definition: flagOperations.hpp:20
helics::action_message_def::action_t::cmd_ping_reply
@ cmd_ping_reply
response to a ping request
helics::ActionMessage::createMessageFromCommand
friend std::unique_ptr< Message > createMessageFromCommand(const ActionMessage &cmd)
Definition: ActionMessage.cpp:628
helics::ActionMessage::getExtraData
int32_t getExtraData() const
Definition: ActionMessage.hpp:159
helics::ActionMessage::Tdemin
Time Tdemin
56 min dependent event time
Definition: ActionMessage.hpp:48
helics::action_message_def::action_t::cmd_fed_configure_flag
@ cmd_fed_configure_flag
command to update the configuration of a federate a flag parameter
helics::ActionMessage::actionTime
Time actionTime
40 the time an action took place or will take place //32
Definition: ActionMessage.hpp:43
helics::ActionMessage::~ActionMessage
~ActionMessage()
helics::action_message_def::action_t::null_info_command
@ null_info_command
biggest command that doesn't have the info structure
helics::action_message_def::action_t::cmd_send_for_filter_return
@ cmd_send_for_filter_return
send a message back to its originator after filtering
helics::ActionMessage::Tso
Time Tso
64 the second order dependent time
Definition: ActionMessage.hpp:49
helics::action_message_def::action_t::cmd_protocol_big
@ cmd_protocol_big
command used in the protocol stacks with the additional info
helics::isProtocolCommand
bool isProtocolCommand(const ActionMessage &command) noexcept
Definition: ActionMessage.hpp:226
helics::action_message_def::action_t::cmd_add_publisher
@ cmd_add_publisher
notify of a publication
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::actionMessageType
const char * actionMessageType(action_message_def::action_t action)
Definition: ActionMessage.cpp:808
helics::action_message_def::action_t::cmd_null_message
@ cmd_null_message
used when a filter drops a message but it needs to return
helics::action_message_def::action_t::cmd_user_disconnect
@ cmd_user_disconnect
command specifying that a user has issued a disconnect signal
helics::action_message_def::action_t::cmd_reg_fed
@ cmd_reg_fed
register a federate
helics::action_message_def::action_t::cmd_reg_filter
@ cmd_reg_filter
register a destination filter
helics::action_message_def::action_t::cmd_route_ack
@ cmd_route_ack
acknowledge reply to a route registration
helics::action_message_def::action_t::cmd_add_interdependency
@ cmd_add_interdependency
command to add a federate as both dependent and a dependency
helics::action_message_def::action_t::cmd_protocol
@ cmd_protocol
command used in the protocol stacks and ignored by the core
helics::createMessageFromCommand
std::unique_ptr< Message > createMessageFromCommand(const ActionMessage &cmd)
Definition: ActionMessage.cpp:628
helics::ActionMessage::ActionMessage
ActionMessage() noexcept
Definition: ActionMessage.hpp:54
helics::action_message_def::action_t::cmd_bye
@ cmd_bye
message stating this is the last communication from a federate
helics::action_message_def::action_t::cmd_add_named_filter
@ cmd_add_named_filter
command to add named filter as a target
helics::ActionMessage::swapSourceDest
void swapSourceDest() noexcept
Definition: ActionMessage.hpp:151
helics::action_message_def::action_t::cmd_close_interface
@ cmd_close_interface
cmd to close all communications from an interface
helics::ActionMessage::setDestination
void setDestination(global_handle hand)
Definition: ActionMessage.hpp:100
helics::ActionMessage::from_string
std::size_t from_string(const std::string &data)
Definition: ActionMessage.cpp:572
helics::action_message_def::action_t::cmd_exec_check
@ cmd_exec_check
command to run a check on execution entry
helics::ActionMessage::dest_id
global_federate_id dest_id
20 fed_id for a targeted message
Definition: ActionMessage.hpp:38
helics::ActionMessage::packetize
std::string packetize() const
Definition: ActionMessage.cpp:331
helics::ActionMessage::action
action_message_def::action_t action() const noexcept
Definition: ActionMessage.hpp:89
helics::action_message_def::action_t::cmd_add_filter
@ cmd_add_filter
notify of a destination filter
helics::action_message_def::action_t::cmd_exec_request
@ cmd_exec_request
request an iteration or entry to execution mode
helics::action_message_def::action_t::cmd_query
@ cmd_query
send a query this is a priority command
helics::ActionMessage::fromByteArray
int fromByteArray(const char *data, int buffer_size)
Definition: ActionMessage.cpp:398
flagOperations.hpp
helics::action_message_def::action_t::cmd_init_not_ready
@ cmd_init_not_ready
retract an init ready command
helics::action_message_def::action_t::cmd_time_block
@ cmd_time_block
prevent a federate from granting time until the block is cleared
helics::isPriorityCommand
bool isPriorityCommand(const ActionMessage &command) noexcept
Definition: ActionMessage.hpp:232
helics::action_message_def::action_t::cmd_disconnect_fed
@ cmd_disconnect_fed
disconnect a federate
helics::errorMessageString
std::string errorMessageString(const ActionMessage &command)
Definition: ActionMessage.cpp:849
helics::action_message_def::action_t::cmd_time_barrier
@ cmd_time_barrier
setup a global time barrier
helics::action_message_def::action_t::cmd_remove_named_input
@ cmd_remove_named_input
cmd to remove a target from connection by name
helics::ActionMessage::name
std::string & name
alias payload to a name reference for registration functions
Definition: ActionMessage.hpp:46
helics::action_message_def::action_t::cmd_add_route
@ cmd_add_route
command to define a route
helics::action_message_def::action_t::cmd_multi_message
@ cmd_multi_message
cmd that encapsulates a bunch of messages in its payload
helics::action_message_def::action_t::cmd_remove_filter
@ cmd_remove_filter
cmd to remove a filter from connection
helics::action_message_def::action_t::cmd_protocol_priority
@ cmd_protocol_priority
priority command used by protocol stacks and ignored by core
helics::action_message_def::action_t::cmd_broadcast_disconnect
@ cmd_broadcast_disconnect
a broadcast disconnect message
helics::action_message_def::action_t::cmd_reg_broker
@ cmd_reg_broker
for a broker to connect with a higher level broker
helics::action_message_def::action_t::cmd_remove_dependency
@ cmd_remove_dependency
command to remove a dependency
helics::action_message_def::action_t::cmd_add_subscriber
@ cmd_add_subscriber
notify of a subscription
helics::ActionMessage::operator=
ActionMessage & operator=(const ActionMessage &act)
Definition: ActionMessage.cpp:86
helics::isValidIndex
bool isValidIndex(sizeType testSize, const SizedDataType &vec)
Definition: core-data.hpp:249
helics::ActionMessage::to_string
std::string to_string() const
Definition: ActionMessage.cpp:282