OGLplus  (0.59.0) a C++ wrapper for rendering APIs

remote_node.hpp
Go to the documentation of this file.
1 
9 #ifndef EAGINE_MESSAGE_BUS_REMOTE_NODE_HPP
10 #define EAGINE_MESSAGE_BUS_REMOTE_NODE_HPP
11 
12 #include "../bitfield.hpp"
13 #include "../build_info.hpp"
14 #include "../callable_ref.hpp"
15 #include "../flat_map.hpp"
16 #include "../identifier_t.hpp"
17 #include "../message_id.hpp"
18 #include "../optional_ref.hpp"
19 #include "../tribool.hpp"
20 #include "../types.hpp"
21 #include "../valid_if/ge0_le1.hpp"
22 #include "../valid_if/nonnegative.hpp"
23 #include "../valid_if/not_empty.hpp"
24 #include "../valid_if/not_zero.hpp"
25 #include "../valid_if/positive.hpp"
26 #include "node_kind.hpp"
27 #include "types.hpp"
28 #include <chrono>
29 #include <memory>
30 
31 namespace eagine::msgbus {
32 //------------------------------------------------------------------------------
36 enum class remote_node_change : std::uint16_t {
39  kind = 1U << 0U,
41  host_id = 1U << 1U,
43  host_info = 1U << 2U,
45  build_info = 1U << 3U,
47  endpoint_info = 1U << 4U,
49  methods_added = 1U << 5U,
51  methods_removed = 1U << 6U,
53  started_responding = 1U << 7U,
55  stopped_responding = 1U << 8U,
57  hardware_config = 1U << 9U,
59  sensor_values = 1U << 10U,
61  connection_info = 1U << 11U,
63  instance_id = 1U << 12U
64 };
65 //------------------------------------------------------------------------------
66 template <typename Selector>
67 constexpr auto
68 enumerator_mapping(type_identity<remote_node_change>, Selector) noexcept {
69  return enumerator_map_type<remote_node_change, 13>{
70  {{"kind", remote_node_change::kind},
71  {"host_id", remote_node_change::host_id},
72  {"host_info", remote_node_change::host_info},
73  {"build_info", remote_node_change::build_info},
74  {"endpoint_info", remote_node_change::endpoint_info},
75  {"methods_added", remote_node_change::methods_added},
76  {"methods_removed", remote_node_change::methods_removed},
77  {"started_responding", remote_node_change::started_responding},
78  {"stopped_responding", remote_node_change::stopped_responding},
79  {"hardware_config", remote_node_change::hardware_config},
80  {"sensor_values", remote_node_change::sensor_values},
81  {"connection_info", remote_node_change::connection_info},
82  {"instance_id", remote_node_change::instance_id}}};
83 }
84 //------------------------------------------------------------------------------
87 struct remote_node_changes : bitfield<remote_node_change> {
89  using base::base;
90 
92  auto responsivity() const noexcept -> bool {
93  return has_any(
96  }
97 
99  auto new_instance() const noexcept -> bool {
101  }
102 };
103 
104 static inline auto operator|(remote_node_change l, remote_node_change r) noexcept
105  -> remote_node_changes {
106  return {l, r};
107 }
108 //------------------------------------------------------------------------------
109 class remote_node_tracker_impl;
110 class remote_host_impl;
111 class remote_host;
112 class remote_instance_impl;
113 class remote_instance;
114 class remote_instance_state;
115 class remote_host_state;
116 class remote_node_impl;
117 class remote_node;
118 class remote_node_state;
119 class node_connection_impl;
120 class node_connection;
121 class node_connection_state;
122 class node_connections;
123 //------------------------------------------------------------------------------
128 public:
131 
133  : _pimpl{} {}
134 
135  remote_node_tracker(std::shared_ptr<remote_node_tracker_impl> pimpl) noexcept
136  : _pimpl{std::move(pimpl)} {}
137 
138  auto cached(const std::string&) -> string_view;
139 
145  auto get_node(identifier_t node_id) -> remote_node_state&;
146 
153 
159  auto get_host(host_id_t) const -> remote_host_state;
160 
166 
172 
178  auto get_connection(identifier_t node_id1, identifier_t node_id2)
180 
186  auto get_connection(identifier_t node_id1, identifier_t node_id2) const
188 
189  auto notice_instance(identifier_t node_id, process_instance_id_t)
190  -> remote_node_state&;
191 
198  template <typename Function>
199  void for_each_host(Function func);
200 
208  template <typename Function>
209  void for_each_host_state(Function func);
210 
217  template <typename Function>
218  void for_each_node(Function func);
219 
227  template <typename Function>
228  void for_each_node_state(Function func);
229 
237  template <typename Function>
238  void
239  for_each_instance_node_state(process_instance_id_t inst_id, Function func);
240 
248  template <typename Function>
249  void for_each_host_node_state(host_id_t host_id, Function func);
250 
251  template <typename Function>
252  void for_each_connection(Function func);
253 
259  template <typename Function>
260  void for_each_connection(Function func) const;
261 
262 private:
263  friend class node_connections;
264 
265  auto _get_nodes() noexcept -> flat_map<identifier_t, remote_node_state>&;
266  auto _get_hosts() noexcept -> flat_map<host_id_t, remote_host_state>&;
267  auto _get_connections() noexcept -> std::vector<node_connection_state>&;
268  auto _get_connections() const noexcept
269  -> const std::vector<node_connection_state>&;
270 
271  std::shared_ptr<remote_node_tracker_impl> _pimpl{};
272 };
273 //------------------------------------------------------------------------------
280 class remote_host {
281 public:
282  remote_host() noexcept = default;
283  remote_host(host_id_t host_id) noexcept
284  : _host_id{host_id} {}
285 
287  explicit operator bool() const noexcept {
288  return bool(_pimpl);
289  }
290 
292  auto id() const noexcept -> valid_if_not_zero<host_id_t> {
293  return {_host_id};
294  }
295 
297  auto is_alive() const noexcept -> bool;
298 
300  auto name() const noexcept -> valid_if_not_empty<string_view>;
301 
303  auto cpu_concurrent_threads() const noexcept
305 
309  auto short_average_load() const noexcept -> valid_if_nonnegative<float>;
310 
314  auto long_average_load() const noexcept -> valid_if_nonnegative<float>;
315 
321  auto total_ram_size() const noexcept -> valid_if_positive<span_size_t>;
322 
328  auto free_ram_size() const noexcept -> valid_if_positive<span_size_t>;
329 
333  auto ram_usage() const noexcept -> valid_if_nonnegative<float> {
334  if(const auto total{total_ram_size()}) {
335  if(const auto free{free_ram_size()}) {
336  return 1.F - float(extract(free)) / float(extract(total));
337  }
338  }
339  return {-1.F};
340  }
341 
347  auto total_swap_size() const noexcept -> valid_if_positive<span_size_t>;
348 
354  auto free_swap_size() const noexcept -> valid_if_nonnegative<span_size_t>;
355 
359  auto swap_usage() const noexcept -> valid_if_nonnegative<float> {
360  if(const auto total{total_swap_size()}) {
361  if(const auto free{free_swap_size()}) {
362  return 1.F - float(extract(free)) / float(extract(total));
363  }
364  }
365  return {-1.F};
366  }
367 
368 protected:
369  auto _impl() const noexcept -> const remote_host_impl*;
370  auto _impl() noexcept -> remote_host_impl*;
371 
372 private:
373  host_id_t _host_id{0U};
374  std::shared_ptr<remote_host_impl> _pimpl{};
375 };
376 //------------------------------------------------------------------------------
383 public:
384  using remote_host::remote_host;
385 
386  auto should_query_sensors() -> bool;
387  auto sensors_queried() -> remote_host_state&;
388 
389  auto notice_alive() -> remote_host_state&;
390  auto set_hostname(std::string) -> remote_host_state&;
391  auto set_cpu_concurrent_threads(span_size_t) -> remote_host_state&;
392  auto set_short_average_load(float) -> remote_host_state&;
393  auto set_long_average_load(float) -> remote_host_state&;
394  auto set_total_ram_size(span_size_t) -> remote_host_state&;
395  auto set_total_swap_size(span_size_t) -> remote_host_state&;
396  auto set_free_ram_size(span_size_t) -> remote_host_state&;
397  auto set_free_swap_size(span_size_t) -> remote_host_state&;
398 };
399 //------------------------------------------------------------------------------
407 public:
408  remote_instance() noexcept = default;
410  process_instance_id_t inst_id,
411  remote_node_tracker tracker) noexcept
412  : _inst_id{inst_id}
413  , _tracker{std::move(tracker)} {}
414 
416  explicit operator bool() const noexcept {
417  return bool(_pimpl);
418  }
419 
421  auto id() const noexcept -> valid_if_not_zero<process_instance_id_t> {
422  return {_inst_id};
423  }
424 
426  auto is_alive() const noexcept -> bool;
427 
429  auto host() const noexcept -> remote_host;
430 
432  auto build() const noexcept -> optional_reference_wrapper<const build_info>;
433 
434 private:
435  process_instance_id_t _inst_id{0U};
436  std::shared_ptr<remote_instance_impl> _pimpl{};
437 
438 protected:
439  remote_node_tracker _tracker{nothing};
440  auto _impl() const noexcept -> const remote_instance_impl*;
441  auto _impl() noexcept -> remote_instance_impl*;
442 };
443 //------------------------------------------------------------------------------
450 public:
451  using remote_instance::remote_instance;
452 
453  auto notice_alive() -> remote_instance_state&;
454  auto set_host_id(host_id_t) -> remote_instance_state&;
455  auto assign(build_info) -> remote_instance_state&;
456 };
457 //------------------------------------------------------------------------------
464 class remote_node {
465 public:
466  remote_node() noexcept = default;
467  remote_node(identifier_t node_id, remote_node_tracker tracker) noexcept
468  : _node_id{node_id}
469  , _tracker{std::move(tracker)} {}
470 
472  explicit operator bool() const noexcept {
473  return bool(_pimpl);
474  }
475 
477  auto id() const noexcept -> valid_if_not_zero<identifier_t> {
478  return {_node_id};
479  }
480 
482  auto instance_id() const noexcept
484 
486  auto host_id() const noexcept -> valid_if_not_zero<host_id_t>;
487 
491  auto kind() const noexcept -> node_kind;
492 
496  auto is_router_node() const noexcept -> tribool;
497 
501  auto is_bridge_node() const noexcept -> tribool;
502 
504  auto has_endpoint_info() const noexcept -> bool;
505 
507  auto app_name() const noexcept -> valid_if_not_empty<string_view>;
508 
510  auto display_name() const noexcept -> valid_if_not_empty<string_view>;
511 
513  auto description() const noexcept -> valid_if_not_empty<string_view>;
514 
516  auto subscribes_to(message_id msg_id) const noexcept -> tribool;
517 
521  auto is_pingable() const noexcept -> tribool;
522 
525  void set_ping_interval(std::chrono::milliseconds) noexcept;
526 
530  auto ping_success_rate() const noexcept -> valid_if_between_0_1<float>;
531 
534  auto is_responsive() const noexcept -> tribool;
535 
539  auto host() const noexcept -> remote_host;
540 
544  auto instance() const noexcept -> remote_instance;
545 
549  auto connections() const noexcept -> node_connections;
550 
551 private:
552  identifier_t _node_id{0U};
553  std::shared_ptr<remote_node_impl> _pimpl{};
554 
555 protected:
556  remote_node_tracker _tracker{nothing};
557  auto _impl() const noexcept -> const remote_node_impl*;
558  auto _impl() noexcept -> remote_node_impl*;
559 };
560 //------------------------------------------------------------------------------
567 public:
568  using remote_node::remote_node;
569 
570  auto clear() noexcept -> remote_node_state&;
571 
572  auto host_state() const noexcept -> remote_host_state;
573 
574  auto changes() -> remote_node_changes;
575  auto add_change(remote_node_change) -> remote_node_state&;
576 
577  auto set_instance_id(process_instance_id_t) -> remote_node_state&;
578  auto set_host_id(host_id_t) -> remote_node_state&;
579 
580  auto assign(node_kind) -> remote_node_state&;
581  auto assign(const endpoint_info&) -> remote_node_state&;
582 
583  auto add_subscription(message_id) -> remote_node_state&;
584  auto remove_subscription(message_id) -> remote_node_state&;
585 
586  auto should_ping() -> std::tuple<bool, std::chrono::milliseconds>;
587  auto notice_alive() -> remote_node_state&;
588  auto pinged() -> remote_node_state&;
589  auto ping_response(message_sequence_t, std::chrono::microseconds age)
590  -> remote_node_state&;
591  auto ping_timeout(message_sequence_t, std::chrono::microseconds age)
592  -> remote_node_state&;
593 };
594 //------------------------------------------------------------------------------
603 public:
604  node_connection() noexcept = default;
606  identifier_t id1,
607  identifier_t id2,
608  remote_node_tracker tracker) noexcept
609  : _id1{id1}
610  , _id2{id2}
611  , _tracker{std::move(tracker)} {}
612 
614  explicit operator bool() const noexcept {
615  return bool(_pimpl);
616  }
617 
620  auto connects(identifier_t id) const noexcept {
621  return (_id1 == id) || (_id2 == id);
622  }
623 
626  auto connects(identifier_t id1, identifier_t id2) const noexcept {
627  return ((_id1 == id1) && (_id2 == id2)) ||
628  ((_id1 == id2) && (_id2 == id1));
629  }
630 
633  auto opposite_id(identifier_t id) const noexcept
635  if(_id1 == id) {
636  return {_id2};
637  }
638  if(_id2 == id) {
639  return {_id1};
640  }
641  return {0U};
642  }
643 
645  auto kind() const noexcept -> connection_kind;
646 
647 private:
648  std::shared_ptr<node_connection_impl> _pimpl{};
649 
650 protected:
651  identifier_t _id1{0U};
652  identifier_t _id2{0U};
653  remote_node_tracker _tracker{nothing};
654  auto _impl() const noexcept -> const node_connection_impl*;
655  auto _impl() noexcept -> node_connection_impl*;
656 };
657 //------------------------------------------------------------------------------
666 public:
667  using node_connection::node_connection;
668 
669  auto set_kind(connection_kind) -> node_connection_state&;
670 };
671 //------------------------------------------------------------------------------
680 public:
682  identifier_t origin_id,
683  std::vector<identifier_t> remote_ids,
684  remote_node_tracker tracker) noexcept
685  : _origin_id{origin_id}
686  , _remote_ids{std::move(remote_ids)}
687  , _tracker{std::move(tracker)} {}
688 
690  auto origin() -> remote_node {
691  return _tracker.get_node(_origin_id);
692  }
693 
697  auto count() const noexcept -> span_size_t {
698  return span_size(_remote_ids.size());
699  }
700 
705  auto get(span_size_t index) -> node_connection {
706  EAGINE_ASSERT((index >= 0) && (index < count()));
707  return _tracker.get_connection(
708  _origin_id, _remote_ids[std_size(index)]);
709  }
710 
715  auto remote(span_size_t index) -> remote_node {
716  EAGINE_ASSERT((index >= 0) && (index < count()));
717  return _tracker.get_node(_remote_ids[std_size(index)]);
718  }
719 
720 private:
721  identifier_t _origin_id{0U};
722  std::vector<identifier_t> _remote_ids{};
723  remote_node_tracker _tracker{nothing};
724 };
725 //------------------------------------------------------------------------------
726 template <typename Function>
728  if(EAGINE_LIKELY(_pimpl)) {
729  for(auto& [host_id, host] : _get_hosts()) {
730  func(host_id, static_cast<remote_host&>(host));
731  }
732  }
733 }
734 //------------------------------------------------------------------------------
735 template <typename Function>
737  if(EAGINE_LIKELY(_pimpl)) {
738  for(auto& [host_id, host] : _get_hosts()) {
739  func(host_id, host);
740  }
741  }
742 }
743 //------------------------------------------------------------------------------
744 template <typename Function>
746  if(EAGINE_LIKELY(_pimpl)) {
747  for(auto& [node_id, node] : _get_nodes()) {
748  func(node_id, static_cast<remote_node&>(node));
749  }
750  }
751 }
752 //------------------------------------------------------------------------------
753 template <typename Function>
755  if(EAGINE_LIKELY(_pimpl)) {
756  for(auto& [node_id, node] : _get_nodes()) {
757  func(node_id, node);
758  }
759  }
760 }
761 //------------------------------------------------------------------------------
762 template <typename Function>
764  process_instance_id_t inst_id,
765  Function func) {
766  if(EAGINE_LIKELY(_pimpl)) {
767  for(auto& [node_id, node] : _get_nodes()) {
768  if(node.instance_id() == inst_id) {
769  func(node_id, node);
770  }
771  }
772  }
773 }
774 //------------------------------------------------------------------------------
775 template <typename Function>
777  host_id_t host_id,
778  Function func) {
779  if(EAGINE_LIKELY(_pimpl)) {
780  for(auto& [node_id, node] : _get_nodes()) {
781  if(node.host_id() == host_id) {
782  func(node_id, node);
783  }
784  }
785  }
786 }
787 //------------------------------------------------------------------------------
788 template <typename Function>
789 void remote_node_tracker::for_each_connection(Function func) {
790  if(EAGINE_LIKELY(_pimpl)) {
791  for(auto& conn : _get_connections()) {
792  func(conn);
793  }
794  }
795 }
796 //------------------------------------------------------------------------------
797 template <typename Function>
798 void remote_node_tracker::for_each_connection(Function func) const {
799  if(EAGINE_LIKELY(_pimpl)) {
800  for(const auto& conn : _get_connections()) {
801  func(conn);
802  }
803  }
804 }
805 //------------------------------------------------------------------------------
806 } // namespace eagine::msgbus
807 
808 #if !EAGINE_LINK_LIBRARY || defined(EAGINE_IMPLEMENTING_LIBRARY)
809 #include <eagine/message_bus/remote_node.inl>
810 #endif
811 
812 #endif // EAGINE_MESSAGE_BUS_REMOTE_NODE_HPP
auto count() const noexcept -> span_size_t
Returns the number of adjacent connections of the origin node.
Definition: remote_node.hpp:697
auto free_ram_size() const noexcept -> valid_if_positive< span_size_t >
Returns the free RAM size on the remote host.
Class providin and manipulating information about remote node changes.
Definition: remote_node.hpp:87
void for_each_instance_node_state(process_instance_id_t inst_id, Function func)
Calls a function on tracked remote bus nodes of an instance (process).
Definition: remote_node.hpp:763
std::ptrdiff_t span_size_t
Signed span size type used by eagine.
Definition: types.hpp:36
basic_string_span< const char > string_view
Alias for const string views.
Definition: string_span.hpp:116
@ host_id
The host identifier has appeared or changed.
@ connection_info
The bus connection information has appeared or changed.
Class providing information about connections from the perspective of a node.
Definition: remote_node.hpp:679
static constexpr auto span_size(T v) noexcept
Converts argument to span size type.
Definition: types.hpp:59
@ host_info
The host information has appeared or changed.
auto id() const noexcept -> valid_if_not_zero< host_id_t >
Returns the unique host id.
Definition: remote_node.hpp:292
auto responsivity() const noexcept -> bool
Remote node responsivity has changed.
Definition: remote_node.hpp:92
auto new_instance() const noexcept -> bool
Remote node instance id has changed.
Definition: remote_node.hpp:99
auto get_instance(host_id_t) -> remote_instance_state &
Finds and returns the information about a remote instance (process).
static constexpr auto extract(api_result_value< Result, api_result_validity::never > &) noexcept -> Result &
Overload of extract for api_result_value.
Definition: c_api_wrap.hpp:270
auto connects(identifier_t id1, identifier_t id2) const noexcept
Indicates if the connection connects nodes with the specified id.
Definition: remote_node.hpp:626
Class providing information about connection between bus nodes.
Definition: remote_node.hpp:602
Class representing "none" / "nothing" values.
Definition: nothing.hpp:17
Primary template for conditionally valid values.
Definition: decl.hpp:49
Class for manipulating and testing a group of enumeration-based bits.
Definition: bitfield.hpp:19
@ stopped_responding
Node stopped responding to pings.
constexpr auto has(bit_type bit) const noexcept
Tests if the specified bit is set.
Definition: bitfield.hpp:70
Optional reference to an instance of type T.
Definition: optional_ref.hpp:23
@ sensor_values
New sensor values have appeared or changed.
@ started_responding
Node started responding to pings.
auto swap_usage() const noexcept -> valid_if_nonnegative< float >
Returns the swap usage on the remote host (0.0, 1.0).
Definition: remote_node.hpp:359
std::uint32_t host_id_t
Unique host identifier type.
Definition: identifier_t.hpp:25
@ methods_added
New remotly callable methods have been added.
void for_each_node_state(Function func)
Calls a function on each tracked remote bus node.
Definition: remote_node.hpp:754
auto cpu_concurrent_threads() const noexcept -> valid_if_positive< span_size_t >
Returns the number of concurrent threads supported at the host.
Class manipulating information about connection between bus nodes.
Definition: remote_node.hpp:665
auto get_connection(identifier_t node_id1, identifier_t node_id2) -> node_connection_state &
Finds and returns the information about remote node connections.
@ methods_removed
New remotly callable methods have been removed.
constexpr auto has_any(bit_type bit, B... bits) const noexcept -> std::enable_if_t< all_are_same_v< bit_type, B... >, bool >
Tests if any of the specified bits are set.
Definition: bitfield.hpp:106
auto total_swap_size() const noexcept -> valid_if_positive< span_size_t >
Returns the total swap size on the remote host.
Class manipulating information about a remote host of bus nodes.
Definition: remote_node.hpp:382
Tri-state boolean value.
Definition: tribool.hpp:61
Class manipulating information about a remote instance running bus nodes.
Definition: remote_node.hpp:449
auto get(span_size_t index) -> node_connection
Returns the i-th connection of the origin node.
Definition: remote_node.hpp:705
auto long_average_load() const noexcept -> valid_if_nonnegative< float >
Returns the long average load on the remote host.
auto is_alive() const noexcept -> bool
Indicates if the remote host is reachable/alive.
std::uint32_t process_instance_id_t
Unique process identifier type (does not necessarily match to OS PID).
Definition: identifier_t.hpp:22
@ endpoint_info
The endpoint information has appeared or changed.
remote_node_tracker()
Default constructor.
static constexpr auto std_size(T v) noexcept
Converts argument to std size type.
Definition: types.hpp:52
std::uint32_t message_sequence_t
Alias for message sequence number type.
Definition: types.hpp:22
auto is_alive() const noexcept -> bool
Indicates if the remote instance (process) is alive and responsive.
auto origin() -> remote_node
Returns the origin node connected by the listed connections.
Definition: remote_node.hpp:690
auto total_ram_size() const noexcept -> valid_if_positive< span_size_t >
Returns the total RAM size on the remote host.
@ kind
The node kind has appeared or changed.
Class providing information about a remote host of bus nodes.
Definition: remote_node.hpp:280
Message bus endpoint information.
Definition: types.hpp:102
auto host() const noexcept -> remote_host
Returns the information about the host where the instance is running.
Message bus code is placed in this namespace.
Definition: eagine.hpp:58
@ hardware_config
The hardware configuration information has appeared or changed.
void for_each_host(Function func)
Calls a function on each tracked remote host.
Definition: remote_node.hpp:727
node_kind
Message bus node kind enumeration.
Definition: node_kind.hpp:18
remote_node_change
Enumeration of changes tracked about remote message bus nodes.
Definition: remote_node.hpp:36
connection_kind
Message bus connection kind bits enumeration.
Definition: connection_kind.hpp:21
auto get_node(identifier_t node_id) -> remote_node_state &
Finds and returns the state information about a remote bus node.
auto opposite_id(identifier_t id) const noexcept -> valid_if_not_zero< identifier_t >
Returns the id of the node opposite to the node with id in argument.
Definition: remote_node.hpp:633
auto id() const noexcept -> valid_if_not_zero< identifier_t >
Returns the unique id of the remote bus node.
Definition: remote_node.hpp:477
@ instance_id
The endpoint instance id has changed.
void for_each_node(Function func)
Calls a function on each tracked remote bus node.
Definition: remote_node.hpp:745
Basic interface for retrieving message bus connection information.
Definition: connection.hpp:98
Class providing basic system information.
Definition: build_info.hpp:20
void for_each_host_node_state(host_id_t host_id, Function func)
Calls a function on tracked remote bus nodes of a remote host.
Definition: remote_node.hpp:776
auto build() const noexcept -> optional_reference_wrapper< const build_info >
Returns the build information about the program running in the instance.
std::uint64_t identifier_t
The underlying integer type for eagine::identifier.
Definition: identifier_t.hpp:19
Class tracking the state of remote message bus nodes.
Definition: remote_node.hpp:127
auto name() const noexcept -> valid_if_not_empty< string_view >
Returns the name of the remote host.
Class providing information about a remote bus node.
Definition: remote_node.hpp:464
Template type used mostly for function type-tag dispatching.
Definition: type_identity.hpp:19
auto id() const noexcept -> valid_if_not_zero< process_instance_id_t >
Returns the id of the instance unique in the host scope.
Definition: remote_node.hpp:421
Class storing two identifier values representing class/method pair.
Definition: message_id.hpp:25
Class manipulating information about a remote bus node.
Definition: remote_node.hpp:566
auto get_host(host_id_t) -> remote_host_state &
Finds and returns the state information about a remote host.
void for_each_host_state(Function func)
Calls a function on each tracked remote host.
Definition: remote_node.hpp:736
auto ram_usage() const noexcept -> valid_if_nonnegative< float >
Returns the RAM usage on the remote host (0.0, 1.0).
Definition: remote_node.hpp:333
auto short_average_load() const noexcept -> valid_if_nonnegative< float >
Returns the short average load on the remote host.
Class providing information about a remote instance running bus nodes.
Definition: remote_node.hpp:406
auto connects(identifier_t id) const noexcept
Indicates if the connection connects node with the specified id.
Definition: remote_node.hpp:620
@ build_info
The build information has appeared or changed.
auto remote(span_size_t index) -> remote_node
Returns the node connected through the i-th connection.
Definition: remote_node.hpp:715
auto free_swap_size() const noexcept -> valid_if_nonnegative< span_size_t >
Returns the free swap size on the remote host.
static constexpr nothing_t nothing
Constant of nothing_t type.
Definition: nothing.hpp:30

Copyright © 2015-2021 Matúš Chochlík.
<chochlik -at -gmail.com>
Documentation generated on Tue Apr 13 2021 by Doxygen (version 1.8.17).