an event node is a source of an event
More...
#include "event_node.hpp"
|
| void | set_source (const capabilities2_msgs::msg::Capability &src) |
| | Set the source object.
|
| |
| void | set_event_emitter (std::shared_ptr< EventBase > event_emitter) |
| | event emitter for this event node
|
| |
| void | add_connection (const std::string &connection_id, const capabilities2_msgs::msg::CapabilityEventCode &type, const capabilities2_msgs::msg::Capability &target, EventBase::event_callback_t event_cb) |
| | make EventNode::add_connection public method on runner api.
|
| |
| void | remove_connection (const std::string &connection_id) |
| | Remove a connection by its id.
|
| |
| void | clear_connections () |
| | clear all connections from this event node
|
| |
| std::vector< capabilities2_msgs::msg::CapabilityConnection > | list_connections () const |
| | List all connections from this event node.
|
| |
| bool | has_connection (const std::string &connection_id) const |
| | Check if a connection exists.
|
| |
| size_t | connection_count () const |
| | current connection count
|
| |
| const std::string & | get_id () const |
| | unique id of this event node
|
| |
| const capabilities2_msgs::msg::Capability & | get_source () const |
| | source capability of this event node
|
| |
| bool | is_event_emitter_set () const |
| | event emitter is set on this node
|
| |
an event node is a source of an event
events when emitted will trigger interactions with connected nodes
◆ EventNode()
| capabilities2_events::EventNode::EventNode |
( |
std::shared_ptr< EventBase > |
event_emitter = nullptr | ) |
|
|
inline |
◆ ~EventNode()
| virtual capabilities2_events::EventNode::~EventNode |
( |
| ) |
|
|
virtualdefault |
◆ add_connection()
| void capabilities2_events::EventNode::add_connection |
( |
const std::string & |
connection_id, |
|
|
const capabilities2_msgs::msg::CapabilityEventCode & |
type, |
|
|
const capabilities2_msgs::msg::Capability & |
target, |
|
|
EventBase::event_callback_t |
event_cb |
|
) |
| |
|
inlineprotected |
make EventNode::add_connection public method on runner api.
add connection to this runner to target capability this allows the runner to emit events on state changes to the target capability the connection ID format is: "bond_id/trigger_id" which allows event emission to extract bond_id for access control
- Parameters
-
| connection_id | unique identifier for the connection (format: "bond_id/trigger_id") |
| type | type of event to connect to |
| target | target capability to connect to |
| event_cb | callback to trigger target capability with (capability, parameters, bond_id, target_instance_id) |
- Exceptions
-
◆ clear_connections()
| void capabilities2_events::EventNode::clear_connections |
( |
| ) |
|
|
inlineprotected |
clear all connections from this event node
◆ connection_count()
| size_t capabilities2_events::EventNode::connection_count |
( |
| ) |
const |
|
inlineprotected |
current connection count
- Returns
- size_t
◆ emit_event()
emit an event from this event node to all matching connections
event handling
- Parameters
-
| bond_id | the bond_id to match connections with (extracted from connection_id) for access control |
| event_type | the type of event being emitted |
| msg_parameters | the new parameters to emit with the event |
◆ get_id()
| const std::string & capabilities2_events::EventNode::get_id |
( |
| ) |
const |
|
inlineprotected |
unique id of this event node
- Returns
- const std::string&
◆ get_source()
| const capabilities2_msgs::msg::Capability & capabilities2_events::EventNode::get_source |
( |
| ) |
const |
|
inlineprotected |
source capability of this event node
- Returns
- const capabilities2_msgs::msg::Capability&
◆ has_connection()
| bool capabilities2_events::EventNode::has_connection |
( |
const std::string & |
connection_id | ) |
const |
|
inlineprotected |
Check if a connection exists.
- Parameters
-
- Returns
- true
-
false
◆ is_event_emitter_set()
| bool capabilities2_events::EventNode::is_event_emitter_set |
( |
| ) |
const |
|
inlineprotected |
event emitter is set on this node
◆ list_connections()
| std::vector< capabilities2_msgs::msg::CapabilityConnection > capabilities2_events::EventNode::list_connections |
( |
| ) |
const |
|
inlineprotected |
List all connections from this event node.
- Returns
- std::vector<capabilities2_msgs::msg::CapabilityConnection>
◆ remove_connection()
| void capabilities2_events::EventNode::remove_connection |
( |
const std::string & |
connection_id | ) |
|
|
inlineprotected |
Remove a connection by its id.
- Parameters
-
◆ set_event_emitter()
| void capabilities2_events::EventNode::set_event_emitter |
( |
std::shared_ptr< EventBase > |
event_emitter | ) |
|
|
inlineprotected |
event emitter for this event node
allows late binding of event emitter (when a node is initialized)
- Parameters
-
◆ set_source()
| void capabilities2_events::EventNode::set_source |
( |
const capabilities2_msgs::msg::Capability & |
src | ) |
|
|
inlineprotected |
Set the source object.
- Parameters
-
◆ connections_
| std::map<std::string, EventPipe> capabilities2_events::EventNode::connections_ |
|
private |
◆ event_emitter_
| std::shared_ptr<EventBase> capabilities2_events::EventNode::event_emitter_ |
|
private |
◆ id_
| std::string capabilities2_events::EventNode::id_ |
|
private |
◆ source_
| capabilities2_msgs::msg::Capability capabilities2_events::EventNode::source_ |
|
private |
The documentation for this class was generated from the following file: