mrs_lib
Various reusable classes, functions and utilities for use in MRS projects
mrs_lib::SubscribeHandler< MessageType >::ImplThreadsafe< MessageType > Class Template Reference
+ Inheritance diagram for mrs_lib::SubscribeHandler< MessageType >::ImplThreadsafe< MessageType >:
+ Collaboration diagram for mrs_lib::SubscribeHandler< MessageType >::ImplThreadsafe< MessageType >:

Public Types

using timeout_callback_t = typename impl_class_t::timeout_callback_t
 
using message_callback_t = typename impl_class_t::message_callback_t
 
- Public Types inherited from mrs_lib::SubscribeHandler< MessageType >::Impl< MessageType >
using timeout_callback_t = typename SubscribeHandler< MessageType >::timeout_callback_t
 
using message_callback_t = typename SubscribeHandler< MessageType >::message_callback_t
 
using data_callback_t = std::function< void(const typename MessageType::ConstPtr &)>
 

Public Member Functions

 ImplThreadsafe (const SubscribeHandlerOptions &options, const message_callback_t &message_callback=message_callback_t())
 
virtual bool hasMsg () const override
 
virtual bool newMsg () const override
 
virtual bool usedMsg () const override
 
virtual MessageType::ConstPtr getMsg () override
 
virtual MessageType::ConstPtr peekMsg () const override
 
virtual ros::Time lastMsgTime () const override
 
virtual std::string topicName () const override
 
virtual void start () override
 
virtual void stop () override
 
- Public Member Functions inherited from mrs_lib::SubscribeHandler< MessageType >::Impl< MessageType >
 Impl (const SubscribeHandlerOptions &options, const message_callback_t &message_callback=message_callback_t())
 
virtual MessageType::ConstPtr waitForNew (const ros::WallDuration &timeout)
 
virtual uint32_t getNumPublishers () const
 
virtual void setNoMessageTimeout (const ros::Duration &timeout)
 

Protected Member Functions

virtual void data_callback (const typename MessageType::ConstPtr &msg) override
 
- Protected Member Functions inherited from mrs_lib::SubscribeHandler< MessageType >::Impl< MessageType >
void default_timeout_callback (const std::string &topic_name, const ros::Time &last_msg)
 
void process_new_message (const typename MessageType::ConstPtr &msg)
 

Friends

class SubscribeHandler< MessageType >
 

Additional Inherited Members

- Protected Attributes inherited from mrs_lib::SubscribeHandler< MessageType >::Impl< MessageType >
ros::NodeHandle m_nh
 
ros::Subscriber m_sub
 
std::string m_topic_name
 
std::string m_node_name
 
bool m_got_data
 
std::mutex m_new_data_mtx
 
std::condition_variable m_new_data_cv
 
bool m_new_data
 
bool m_used_data
 
std::shared_ptr< mrs_lib::TimeoutManagerm_timeout_manager
 
std::optional< mrs_lib::TimeoutManager::timeout_id_t > m_timeout_id
 
mrs_lib::TimeoutManager::callback_t m_timeout_mgr_callback
 
ros::Time m_latest_message_time
 
MessageType::ConstPtr m_latest_message
 
message_callback_t m_message_callback
 

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