Go to the documentation of this file.
18 std::function<
void(
const std::any&)>&& func,
19 std::function<
void()>&& cleanup)
20 : m_func(std::move(func)), m_cleanup(std::move(cleanup))
26 std::function<
void(
const std::any&)>&& func,
27 std::function<
void()>&& cleanup)
29 return Ptr(
new Subscriber(std::move(func), std::move(cleanup)));
34 Topic::Topic(std::function<
void()>&& cleanup) : m_cleanup(std::move(cleanup)) {}
38 std::lock_guard<std::mutex> lock(
m_mutex);
47 std::lock_guard<std::mutex> lock(
m_mutex);
56 std::lock_guard<std::mutex> lock(
m_mutex);
std::function< void()> m_cleanup
The central directory of existing topics for pub/sub.
Subscriber(std::function< void(const std::any &)> &&func, std::function< void()> &&cleanup)
std::function< void()> m_cleanup
std::unordered_map< std::string, std::weak_ptr< Topic > > m_mapService
std::shared_ptr< Subscriber > Ptr
std::list< std::weak_ptr< Subscriber > > m_subs
Serial and networking devices and utilities.
Topic(std::function< void()> &&cleanup)
void publish(const std::any &any)
void cleanupTopic(const std::string &key)
void cleanupSubscriber(std::list< std::weak_ptr< Subscriber >>::iterator it)
std::function< void(const std::any &)> m_func
void pub(const std::any &a)
static Ptr create(std::function< void(const std::any &)> &&func, std::function< void()> &&cleanup)
std::shared_ptr< TopicDirectory > Ptr
Page generated by Doxygen 1.8.17 for MRPT 2.0.3 at Fri May 29 13:06:46 UTC 2020 | |