SHM
Shared-memory based Handy-communication Manager
Public Member Functions | List of all members
irlab::shm::Subscriber< T > Class Template Reference

Class representing a subscriber that retrieves topics from shared memory This class is used to load a type or class given as template class as a topic. It also has an API that waits until the topic is updated. More...

#include <shm_pub_sub.hpp>

Public Member Functions

 Subscriber (std::string name="")
 Constructor Shared-memory name None Access to shared memory.
 
 Subscriber (const Subscriber &)=delete
 
Subscriberoperator= (const Subscriber &)=delete
 
 Subscriber (Subscriber &&other) noexcept=default
 
const T subscribe (bool *state)
 Subscribe a topic Const reference to the loaded topic. The topic with the most recent timestamp is loaded. It is recommended to duplicate the data by copy constructor or assignment, since it returns a direct reference to memory so that it can be later extended to variable-length classes.
 
bool waitFor (uint64_t timeout_usec)
 
void setDataExpiryTime_us (uint64_t time_us)
 

Detailed Description

template<typename T>
class irlab::shm::Subscriber< T >

Class representing a subscriber that retrieves topics from shared memory This class is used to load a type or class given as template class as a topic. It also has an API that waits until the topic is updated.

Examples
test1.cpp.

Definition at line 94 of file shm_pub_sub.hpp.


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