MRPT  2.0.4
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
mrpt::comms::Topic Class Reference

Detailed Description

Definition at line 51 of file nodelets.h.

#include <mrpt/comms/nodelets.h>

Inheritance diagram for mrpt::comms::Topic:

Public Types

using Ptr = std::shared_ptr< Topic >
 

Public Member Functions

 ~Topic ()
 
template<typename ARG , typename Callable >
Subscriber::Ptr createSubscriber (Callable &&func)
 
void publish (const std::any &any)
 
void cleanupSubscriber (std::list< std::weak_ptr< Subscriber >>::iterator it)
 

Static Public Member Functions

template<typename CLEANUP >
static Ptr create (CLEANUP &&cleanup)
 

Private Member Functions

 Topic (std::function< void()> &&cleanup)
 

Private Attributes

std::mutex m_mutex
 
std::list< std::weak_ptr< Subscriber > > m_subs
 
std::function< void()> m_cleanup
 

Member Typedef Documentation

◆ Ptr

Definition at line 57 of file nodelets.h.

Constructor & Destructor Documentation

◆ Topic()

Topic::Topic ( std::function< void()> &&  cleanup)
private

Definition at line 34 of file nodelets.cpp.

Referenced by create().

Here is the caller graph for this function:

◆ ~Topic()

Topic::~Topic ( )

Definition at line 35 of file nodelets.cpp.

References m_cleanup.

Member Function Documentation

◆ cleanupSubscriber()

void Topic::cleanupSubscriber ( std::list< std::weak_ptr< Subscriber >>::iterator  it)

Definition at line 45 of file nodelets.cpp.

References m_mutex, and m_subs.

◆ create()

template<typename CLEANUP >
static Ptr mrpt::comms::Topic::create ( CLEANUP &&  cleanup)
inlinestatic

Definition at line 96 of file nodelets.h.

References Topic().

Referenced by mrpt::comms::TopicDirectory::getTopic().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ createSubscriber()

template<typename ARG , typename Callable >
Subscriber::Ptr mrpt::comms::Topic::createSubscriber ( Callable &&  func)
inline

Definition at line 62 of file nodelets.h.

References mrpt::comms::Subscriber::create(), mrpt::typemeta::TTypeName< T >::get(), m_mutex, and m_subs.

Here is the call graph for this function:

◆ publish()

void Topic::publish ( const std::any &  any)

Definition at line 36 of file nodelets.cpp.

References m_mutex, and m_subs.

Member Data Documentation

◆ m_cleanup

std::function<void()> mrpt::comms::Topic::m_cleanup
private

Definition at line 104 of file nodelets.h.

Referenced by ~Topic().

◆ m_mutex

std::mutex mrpt::comms::Topic::m_mutex
private

Definition at line 102 of file nodelets.h.

Referenced by cleanupSubscriber(), createSubscriber(), and publish().

◆ m_subs

std::list<std::weak_ptr<Subscriber> > mrpt::comms::Topic::m_subs
private

Definition at line 103 of file nodelets.h.

Referenced by cleanupSubscriber(), createSubscriber(), and publish().




Page generated by Doxygen 1.8.14 for MRPT 2.0.4 Git: 33de1d0ad Sat Jun 20 11:02:42 2020 +0200 at sáb jun 20 17:35:17 CEST 2020