|
Capabilities2 0.3.0
|
event base class More...
#include "event_base.hpp"

Public Types | |
| typedef std::string | capability_str_t |
| typedef capabilities2_events::EventParameters | parameter_t |
| typedef std::string | access_id_t |
| typedef std::string | target_instance_id_t |
| typedef std::function< void(const access_id_t &, const capability_str_t &, const target_instance_id_t &, parameter_t)> | event_callback_t |
Public Member Functions | |
| EventBase () | |
| ~EventBase ()=default | |
| virtual void | emit (const std::string &connection_id, const uint8_t &event_code, const capabilities2_msgs::msg::Capability &source, const capabilities2_msgs::msg::Capability &target, event_callback_t callback) |
| emit an event | |
| virtual void | on_server_ready (const std::string &msg)=0 |
| on server ready event | |
| virtual void | on_process_launched (const std::string &pid)=0 |
| on process launched event | |
| virtual void | on_process_terminated (const std::string &pid)=0 |
| on process terminated event | |
| virtual void | on_triggered (const std::string &trigger_id)=0 |
| on triggered event from server | |
| virtual void | on_connected (const std::string &source, const std::string &target)=0 |
| on connected event from server | |
| virtual void | on_disconnected (const std::string &source, const std::string &target)=0 |
| on disconnected event from server | |
event base class
Represents an event in the capabilities framework. An event can be triggered to notify other components about changes in running capability (runners) states.
| typedef std::string capabilities2_events::EventBase::access_id_t |
| typedef std::string capabilities2_events::EventBase::capability_str_t |
| typedef std::function<void(const access_id_t&, const capability_str_t&, const target_instance_id_t&, parameter_t)> capabilities2_events::EventBase::event_callback_t |
| typedef std::string capabilities2_events::EventBase::target_instance_id_t |
|
inline |
|
default |
|
inlinevirtual |
emit an event
an event emission uses a parameterised callback which lets loosely-coupled capabilities propogate state changes when a source capability emits an event to a target capability
| connection_id | connection identifier (format: "bond_id/trigger_id") |
| event_code | type of event being emitted |
| source | source capability emitting the event |
| target | target capability receiving the event |
| callback | function to trigger target capability with (capability, parameters, bond_id, target_instance_id) |
Reimplemented in capabilities2_events::PublishedEvent.
|
pure virtual |
on connected event from server
| source | |
| target |
Implemented in capabilities2_events::PublishedEvent.
|
pure virtual |
on disconnected event from server
| source | |
| target |
Implemented in capabilities2_events::PublishedEvent.
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
on triggered event from server
| trigger_id |
Implemented in capabilities2_events::PublishedEvent.