Capabilities2 0.3.0
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
capabilities2_events::EventParameters Struct Reference

capability options for a capability runner given by interface and provider More...

#include "event_parameters.hpp"

Public Member Functions

 EventParameters ()=default
 
 EventParameters (const capabilities2_msgs::msg::Capability &msg)
 
bool is_empty () const
 
bool has_value (const std::string &key) const
 Check if an option with the given key exists.
 
std::any get_value (const std::string &key, std::any default_value)
 Get the value of an option by key.
 
void set_value (const std::string &key, const std::any &value, const OptionType &type)
 Set the value of an option by key, if the option does not exist it will be created.
 
capabilities2_msgs::msg::Capability toMsg () const
 

Public Attributes

std::vector< Parameteroptions = {}
 

Detailed Description

capability options for a capability runner given by interface and provider

Parameters
interfacethe interface of the capability
providerthe provider of the capability
optionsthe options for the capability

Constructor & Destructor Documentation

◆ EventParameters() [1/2]

capabilities2_events::EventParameters::EventParameters ( )
default

◆ EventParameters() [2/2]

capabilities2_events::EventParameters::EventParameters ( const capabilities2_msgs::msg::Capability &  msg)
inline

Member Function Documentation

◆ get_value()

std::any capabilities2_events::EventParameters::get_value ( const std::string &  key,
std::any  default_value 
)
inline

Get the value of an option by key.

Parameters
keythe key of the option to get the value of
Returns
std::any the value of the option, can be cast to the appropriate type based on the OptionType
Exceptions
options_exceptionif the key is not found or if there is a type conversion error

◆ has_value()

bool capabilities2_events::EventParameters::has_value ( const std::string &  key) const
inline

Check if an option with the given key exists.

Parameters
keythe key of the option to check
Returns
true if the option exists, false otherwise

◆ is_empty()

bool capabilities2_events::EventParameters::is_empty ( ) const
inline

◆ set_value()

void capabilities2_events::EventParameters::set_value ( const std::string &  key,
const std::any &  value,
const OptionType type 
)
inline

Set the value of an option by key, if the option does not exist it will be created.

Parameters
keythe key of the option to set the value of
typethe type of the option to set
valuethe value to set, should be castable to the appropriate type based on the OptionType
Exceptions
options_exceptionif there is a type conversion error

◆ toMsg()

capabilities2_msgs::msg::Capability capabilities2_events::EventParameters::toMsg ( ) const
inline

Member Data Documentation

◆ options

std::vector<Parameter> capabilities2_events::EventParameters::options = {}

The documentation for this struct was generated from the following file: