Public Types | Public Member Functions | Public Attributes | Private Types | Static Private Attributes | List of all members
io_comm_rx::CallbackHandlers Class Reference

Represents ensemble of (to be constructed) ROS messages, to be handled at once by this class. More...

#include <callback_handlers.hpp>

Public Types

typedef std::multimap< std::string, boost::shared_ptr< AbstractCallbackHandler > > CallbackMap
 Key is std::string and represents the ROS message key, value is boost::shared_ptr<CallbackHandler> More...
 

Public Member Functions

 CallbackHandlers ()=default
 
void handle (RxMessage &rx_message)
 Ćalled every time rx_message is found to contain some potentially useful message. More...
 
template<typename T >
CallbackMap insert (std::string message_key)
 Adds a pair to the multimap "callbackmap_", with the message_key being the key. More...
 
void readCallback (const uint8_t *data, std::size_t &size)
 Searches for Rx messages that could potentially be decoded/parsed/published. More...
 

Public Attributes

CallbackMap callbackmap_
 

Private Types

typedef std::map< std::string, uint32_t > DiagnosticArrayMap
 
typedef std::map< std::string, uint32_t > GPSFixMap
 Shorthand for the map responsible for matching ROS message identifiers relevant for GPSFix to a uint32_t. More...
 
typedef std::map< std::string, uint32_t > NavSatFixMap
 Shorthand for the map responsible for matching ROS message identifiers relevant for NavSatFix to a uint32_t. More...
 
typedef std::map< std::string, uint32_t > PoseWithCovarianceStampedMap
 

Static Private Attributes

static boost::mutex callback_mutex_
 
static DiagnosticArrayMap diagnosticarray_map
 
static std::string do_diagnostics_ = "4014"
 
static std::string do_gpsfix_ = "4007"
 
static std::string do_navsatfix_ = "4007"
 
static std::string do_pose_ = "4007"
 
static GPSFixMap gpsfix_map
 
static NavSatFixMap navsatfix_map
 
static PoseWithCovarianceStampedMap pose_map
 

Detailed Description

Represents ensemble of (to be constructed) ROS messages, to be handled at once by this class.

Definition at line 207 of file callback_handlers.hpp.

Member Typedef Documentation

◆ CallbackMap

Key is std::string and represents the ROS message key, value is boost::shared_ptr<CallbackHandler>

Definition at line 213 of file callback_handlers.hpp.

◆ DiagnosticArrayMap

typedef std::map<std::string, uint32_t> io_comm_rx::CallbackHandlers::DiagnosticArrayMap
private

Shorthand for the map responsible for matching ROS message identifiers relevant for DiagnosticArray to a uint32_t

Definition at line 307 of file callback_handlers.hpp.

◆ GPSFixMap

typedef std::map<std::string, uint32_t> io_comm_rx::CallbackHandlers::GPSFixMap
private

Shorthand for the map responsible for matching ROS message identifiers relevant for GPSFix to a uint32_t.

Definition at line 284 of file callback_handlers.hpp.

◆ NavSatFixMap

typedef std::map<std::string, uint32_t> io_comm_rx::CallbackHandlers::NavSatFixMap
private

Shorthand for the map responsible for matching ROS message identifiers relevant for NavSatFix to a uint32_t.

Definition at line 291 of file callback_handlers.hpp.

◆ PoseWithCovarianceStampedMap

typedef std::map<std::string, uint32_t> io_comm_rx::CallbackHandlers::PoseWithCovarianceStampedMap
private

Shorthand for the map responsible for matching ROS message identifiers relevant for PoseWithCovarianceStamped to a uint32_t

Definition at line 299 of file callback_handlers.hpp.

Constructor & Destructor Documentation

◆ CallbackHandlers()

io_comm_rx::CallbackHandlers::CallbackHandlers ( )
default

Member Function Documentation

◆ handle()

void io_comm_rx::CallbackHandlers::handle ( RxMessage rx_message)

Ćalled every time rx_message is found to contain some potentially useful message.

Parameters
rx_messageThe for loop forwards to a ROS message specific handle if the latter was added via callbackmap_.insert at some earlier point.

Definition at line 90 of file callback_handlers.cpp.

◆ insert()

template<typename T >
CallbackMap io_comm_rx::CallbackHandlers::insert ( std::string  message_key)
inline

Adds a pair to the multimap "callbackmap_", with the message_key being the key.

This method is called by "handlers_" in rosaic_node.cpp. T would be a (custom or not) ROS message, e.g. rosaic::PVTGeodetic, or nmea_msgs::GPGGA. Note that "typename" could be omitted in the argument.

Parameters
message_keyThe pair's key
callbackThe key's counterpart
Returns
The modified multimap "callbackmap_"

Definition at line 228 of file callback_handlers.hpp.

◆ readCallback()

void io_comm_rx::CallbackHandlers::readCallback ( const uint8_t *  data,
std::size_t &  size 
)

Searches for Rx messages that could potentially be decoded/parsed/published.

Parameters
[in]dataBuffer passed on from AsyncManager class
[in]sizeSize of the buffer

Definition at line 269 of file callback_handlers.cpp.

Member Data Documentation

◆ callback_mutex_

boost::mutex io_comm_rx::CallbackHandlers::callback_mutex_
staticprivate

The "static" keyword resolves construct-by-copying issues related to this mutex by making it available throughout the code unit. The mutex constructor list contains "mutex (const mutex&) = delete", hence construct-by-copying a mutex is explicitly prohibited. The get_handlers() method of the Comm_IO class hence forces us to make this mutex static.

Definition at line 265 of file callback_handlers.hpp.

◆ callbackmap_

CallbackMap io_comm_rx::CallbackHandlers::callbackmap_

Callback handlers multimap for Rx messages; it needs to be public since we copy-assign (did not work otherwise) new callbackmap_, after inserting a pair to the multimap within the DefineMessages() method of the ROSaicNode class, onto its old version.

Definition at line 257 of file callback_handlers.hpp.

◆ diagnosticarray_map

CallbackHandlers::DiagnosticArrayMap io_comm_rx::CallbackHandlers::diagnosticarray_map
staticprivate

All instances of the CallbackHandlers class shall have access to the map without reinitializing it, hence static

Definition at line 311 of file callback_handlers.hpp.

◆ do_diagnostics_

std::string io_comm_rx::CallbackHandlers::do_diagnostics_ = "4014"
staticprivate

Determines which of the SBF blocks necessary for the diagnostic_msgs/DiagnosticArray ROS message arrives last and thus launches its construction

Definition at line 281 of file callback_handlers.hpp.

◆ do_gpsfix_

std::string io_comm_rx::CallbackHandlers::do_gpsfix_ = "4007"
staticprivate

Determines which of the SBF blocks necessary for the gps_common::GPSFix ROS message arrives last and thus launches its construction

Definition at line 269 of file callback_handlers.hpp.

◆ do_navsatfix_

std::string io_comm_rx::CallbackHandlers::do_navsatfix_ = "4007"
staticprivate

Determines which of the SBF blocks necessary for the sensor_msgs::NavSatFix ROS message arrives last and thus launches its construction

Definition at line 273 of file callback_handlers.hpp.

◆ do_pose_

std::string io_comm_rx::CallbackHandlers::do_pose_ = "4007"
staticprivate

Determines which of the SBF blocks necessary for the geometry_msgs/PoseWithCovarianceStamped ROS message arrives last and thus launches its construction

Definition at line 277 of file callback_handlers.hpp.

◆ gpsfix_map

CallbackHandlers::GPSFixMap io_comm_rx::CallbackHandlers::gpsfix_map
staticprivate

All instances of the CallbackHandlers class shall have access to the map without reinitializing it, hence static

Definition at line 288 of file callback_handlers.hpp.

◆ navsatfix_map

CallbackHandlers::NavSatFixMap io_comm_rx::CallbackHandlers::navsatfix_map
staticprivate

All instances of the CallbackHandlers class shall have access to the map without reinitializing it, hence static

Definition at line 295 of file callback_handlers.hpp.

◆ pose_map

CallbackHandlers::PoseWithCovarianceStampedMap io_comm_rx::CallbackHandlers::pose_map
staticprivate

All instances of the CallbackHandlers class shall have access to the map without reinitializing it, hence static

Definition at line 303 of file callback_handlers.hpp.


The documentation for this class was generated from the following files:


rosaic
Author(s): Tibor Dome
autogenerated on Wed Oct 14 2020 03:43:50