Cafer_core
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator
Public Member Functions | List of all members
cafer_core::Manager< Msg, std::unordered_map< u_int32_t, Msg > > Class Template Reference

#include <manager.hpp>

Inheritance diagram for cafer_core::Manager< Msg, std::unordered_map< u_int32_t, Msg > >:
cafer_core::ManagerBase< Msg, std::unordered_map< u_int32_t, Msg >, Manager< Msg, std::unordered_map< u_int32_t, Msg > > >

Public Member Functions

void add (const Msg &msg)
 add a msg to the container of Manager More...
 
Msg get ()
 Random access to an element from the data container. More...
 
size_t remove (const u_int32_t &h)
 remove a element of the container of the manager More...
 
Msg search (const u_int32_t &id)
 search a precise msg by is identifier More...
 
- Public Member Functions inherited from cafer_core::ManagerBase< Msg, std::unordered_map< u_int32_t, Msg >, Manager< Msg, std::unordered_map< u_int32_t, Msg > > >
 ManagerBase (std::string type, std::string name, std::string description="")
 Manager constructor. More...
 
void disconnect_from_ros ()
 
bool is_initialized ()
 
void update ()
 
void add_cb (const shared_ptr< Msg > &msg)
 The callback function used to process messages from the listened topic. More...
 
void listen_to (const std::string &topic, io type_io=ADD)
 Connects to a specific topic and listen to it. More...
 
size_t data_size ()
 Returns the number of elements in the data container. More...
 

Additional Inherited Members

- Public Types inherited from cafer_core::ManagerBase< Msg, std::unordered_map< u_int32_t, Msg >, Manager< Msg, std::unordered_map< u_int32_t, Msg > > >
enum  io
 The io enum type of traitement to do with incoming data. More...
 
- Protected Attributes inherited from cafer_core::ManagerBase< Msg, std::unordered_map< u_int32_t, Msg >, Manager< Msg, std::unordered_map< u_int32_t, Msg > > >
std::unordered_map< u_int32_t,
Msg > 
_data_set
 the data container. All messages are stored in this container. More...
 
long int _id
 
std::string _name
 
std::string _description
 
std::string _type
 
std::unique_ptr< ros::Publisher > _publisher
 
std::unique_ptr< ros::Subscriber > _subcriber
 subscriber to retrieve data More...
 
std::mt19937 _gen
 
std::mutex _container_mutex
 Mutex to protect the _data_set from concurrent access. More...
 

Detailed Description

template<typename Msg>
class cafer_core::Manager< Msg, std::unordered_map< u_int32_t, Msg > >

Definition at line 202 of file manager.hpp.

Member Function Documentation

template<typename Msg >
void cafer_core::Manager< Msg, std::unordered_map< u_int32_t, Msg > >::add ( const Msg &  msg)
inline

add a msg to the container of Manager

Parameters
msgthe message to add

Definition at line 214 of file manager.hpp.

template<typename Msg >
Msg cafer_core::Manager< Msg, std::unordered_map< u_int32_t, Msg > >::get ( )
inline

Random access to an element from the data container.

Returns
The returned message/element.

Definition at line 225 of file manager.hpp.

template<typename Msg >
size_t cafer_core::Manager< Msg, std::unordered_map< u_int32_t, Msg > >::remove ( const u_int32_t &  h)
inline

remove a element of the container of the manager

Parameters
ididentifier of the msg to remove
Returns
should be 1 in success case and 0 otherwise.

Definition at line 240 of file manager.hpp.

template<typename Msg >
Msg cafer_core::Manager< Msg, std::unordered_map< u_int32_t, Msg > >::search ( const u_int32_t &  id)
inline

search a precise msg by is identifier

Parameters
ididentifier of the searched msg

Definition at line 253 of file manager.hpp.


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