Cafer_core
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator
Public Types | Public Member Functions | Protected Attributes | List of all members
cafer_core::ManagerBase< Msg, DataContainer, DerivedClass > Class Template Reference

Base class for manager component. A manager component handle ROS messages (like images, features or policies). More...

#include <manager.hpp>

Public Types

enum  io { ADD }
 The io enum type of traitement to do with incoming data. More...
 

Public Member Functions

 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...
 

Protected Attributes

DataContainer _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, typename DataContainer, typename DerivedClass>
class cafer_core::ManagerBase< Msg, DataContainer, DerivedClass >

Base class for manager component. A manager component handle ROS messages (like images, features or policies).

Definition at line 61 of file manager.hpp.

Member Enumeration Documentation

template<typename Msg, typename DataContainer, typename DerivedClass>
enum cafer_core::ManagerBase::io

The io enum type of traitement to do with incoming data.

Enumerator
ADD 

Definition at line 67 of file manager.hpp.

Constructor & Destructor Documentation

template<typename Msg, typename DataContainer, typename DerivedClass>
cafer_core::ManagerBase< Msg, DataContainer, DerivedClass >::ManagerBase ( std::string  type,
std::string  name,
std::string  description = "" 
)
inline

Manager constructor.

Parameters
typespecify which of data manager (and not the type of data)
nameof the manager
descriptiona short description of the manager (optionnal)

Definition at line 77 of file manager.hpp.

Member Function Documentation

template<typename Msg, typename DataContainer, typename DerivedClass>
void cafer_core::ManagerBase< Msg, DataContainer, DerivedClass >::add_cb ( const shared_ptr< Msg > &  msg)
inline

The callback function used to process messages from the listened topic.

Parameters
msg

Definition at line 117 of file manager.hpp.

template<typename Msg, typename DataContainer, typename DerivedClass>
size_t cafer_core::ManagerBase< Msg, DataContainer, DerivedClass >::data_size ( )
inline

Returns the number of elements in the data container.

Returns
The manager container's size.

Definition at line 137 of file manager.hpp.

template<typename Msg, typename DataContainer, typename DerivedClass>
void cafer_core::ManagerBase< Msg, DataContainer, DerivedClass >::disconnect_from_ros ( void  )
inline

Definition at line 96 of file manager.hpp.

template<typename Msg, typename DataContainer, typename DerivedClass>
bool cafer_core::ManagerBase< Msg, DataContainer, DerivedClass >::is_initialized ( )
inline

Definition at line 103 of file manager.hpp.

template<typename Msg, typename DataContainer, typename DerivedClass>
void cafer_core::ManagerBase< Msg, DataContainer, DerivedClass >::listen_to ( const std::string &  topic,
io  type_io = ADD 
)
inline

Connects to a specific topic and listen to it.

Parameters
Thetopic to listen to.

Definition at line 126 of file manager.hpp.

template<typename Msg, typename DataContainer, typename DerivedClass>
void cafer_core::ManagerBase< Msg, DataContainer, DerivedClass >::update ( )
inline

Definition at line 108 of file manager.hpp.

Member Data Documentation

template<typename Msg, typename DataContainer, typename DerivedClass>
std::mutex cafer_core::ManagerBase< Msg, DataContainer, DerivedClass >::_container_mutex
protected

Mutex to protect the _data_set from concurrent access.

Definition at line 189 of file manager.hpp.

template<typename Msg, typename DataContainer, typename DerivedClass>
DataContainer cafer_core::ManagerBase< Msg, DataContainer, DerivedClass >::_data_set
protected

the data container. All messages are stored in this container.

Definition at line 176 of file manager.hpp.

template<typename Msg, typename DataContainer, typename DerivedClass>
std::string cafer_core::ManagerBase< Msg, DataContainer, DerivedClass >::_description
protected

Definition at line 180 of file manager.hpp.

template<typename Msg, typename DataContainer, typename DerivedClass>
std::mt19937 cafer_core::ManagerBase< Msg, DataContainer, DerivedClass >::_gen
protected

Definition at line 187 of file manager.hpp.

template<typename Msg, typename DataContainer, typename DerivedClass>
long int cafer_core::ManagerBase< Msg, DataContainer, DerivedClass >::_id
protected

Definition at line 178 of file manager.hpp.

template<typename Msg, typename DataContainer, typename DerivedClass>
std::string cafer_core::ManagerBase< Msg, DataContainer, DerivedClass >::_name
protected

Definition at line 179 of file manager.hpp.

template<typename Msg, typename DataContainer, typename DerivedClass>
std::unique_ptr<ros::Publisher> cafer_core::ManagerBase< Msg, DataContainer, DerivedClass >::_publisher
protected

Definition at line 183 of file manager.hpp.

template<typename Msg, typename DataContainer, typename DerivedClass>
std::unique_ptr<ros::Subscriber> cafer_core::ManagerBase< Msg, DataContainer, DerivedClass >::_subcriber
protected

subscriber to retrieve data

Definition at line 186 of file manager.hpp.

template<typename Msg, typename DataContainer, typename DerivedClass>
std::string cafer_core::ManagerBase< Msg, DataContainer, DerivedClass >::_type
protected

Definition at line 181 of file manager.hpp.


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