RTC Toolkit  1.0.0
Public Member Functions | Protected Attributes | List of all members
rtctk::telRepub::PubThread< T, Q_SIZE, TDW > Class Template Reference

#include <ddsPubThread.hpp>

Inheritance diagram for rtctk::telRepub::PubThread< T, Q_SIZE, TDW >:
rtctk::telRepub::PubThreadBase< 300 >

Public Member Functions

 PubThread (TDW *dw, std::uint32_t queue_size=300)
 
 ~PubThread ()
 
void ReadQueuePub ()
 Thread worker that reads (pops) agnostic topic from queue and publishes it via DDS. More...
 
void SimPub ()
 Thread worker in case of simulation i.e. More...
 
void CreateSimThread (u_int16_t f)
 Create thread for simulation. More...
 
void CreateThread ()
 Create thread for publishing data from the queue. More...
 
void JoinThread ()
 Join thread. More...
 
void SetAffinity (unsigned int cpu)
 set affinity of the thread. More...
 
void PrintAffinity ()
 Print to the log the set CPU thread affinity. More...
 
- Public Member Functions inherited from rtctk::telRepub::PubThreadBase< 300 >
 PubThreadBase (const char *topic_name, std::uint32_t queue_size)
 
 PubThreadBase (const std::string &topic_name, std::uint32_t queue_size)
 
virtual ~PubThreadBase ()
 
std::string getTopicName ()
 
RepubBuf< rtctk::AgnosticTopic > * GetRepubBuf ()
 Get internal queue/buffer. More...
 

Protected Attributes

boost::thread m_thread
 
std::atomic< bool > m_loop
 
unsigned long m_framecounter
 
uint32_t m_sample_id = 0
 
uint32_t m_last_sample_id = 0
 
m_message
 
T * m_msg
 
TDW * m_data_writer
 
useconds_t m_sim_loop_sleep
 
- Protected Attributes inherited from rtctk::telRepub::PubThreadBase< 300 >
bool push_ret
 
RepubBuf< rtctk::AgnosticTopic > * m_repub_buf
 
unsigned long rcvSamples_m
 
unsigned long skipedSamples_m
 
uint32_t lastSkipedSample_m
 
std::string topic_name_m
 
boost::mutex mut
 
boost::condition_variable cond
 

Constructor & Destructor Documentation

◆ PubThread()

template<typename T = rtctk::AgnosticTopic, uint16_t Q_SIZE = 300, typename TDW = TypedDataWriter>
rtctk::telRepub::PubThread< T, Q_SIZE, TDW >::PubThread ( TDW *  dw,
std::uint32_t  queue_size = 300 
)
inline

◆ ~PubThread()

template<typename T = rtctk::AgnosticTopic, uint16_t Q_SIZE = 300, typename TDW = TypedDataWriter>
rtctk::telRepub::PubThread< T, Q_SIZE, TDW >::~PubThread ( )
inline

Member Function Documentation

◆ CreateSimThread()

template<typename T = rtctk::AgnosticTopic, uint16_t Q_SIZE = 300, typename TDW = TypedDataWriter>
void rtctk::telRepub::PubThread< T, Q_SIZE, TDW >::CreateSimThread ( u_int16_t  f)
inline

Create thread for simulation.

Is either created thread for publish simulated or "real" topic samples.

Parameters
frate (frequency) with which the simulated (dummy) topic sample are published

◆ CreateThread()

template<typename T = rtctk::AgnosticTopic, uint16_t Q_SIZE = 300, typename TDW = TypedDataWriter>
void rtctk::telRepub::PubThread< T, Q_SIZE, TDW >::CreateThread ( )
inline

Create thread for publishing data from the queue.

Is either created thread for publish simulated or "real" topic samples.

◆ JoinThread()

template<typename T = rtctk::AgnosticTopic, uint16_t Q_SIZE = 300, typename TDW = TypedDataWriter>
void rtctk::telRepub::PubThread< T, Q_SIZE, TDW >::JoinThread ( )
inline

Join thread.

◆ PrintAffinity()

template<typename T = rtctk::AgnosticTopic, uint16_t Q_SIZE = 300, typename TDW = TypedDataWriter>
void rtctk::telRepub::PubThread< T, Q_SIZE, TDW >::PrintAffinity ( )
inline

Print to the log the set CPU thread affinity.

◆ ReadQueuePub()

template<typename T = rtctk::AgnosticTopic, uint16_t Q_SIZE = 300, typename TDW = TypedDataWriter>
void rtctk::telRepub::PubThread< T, Q_SIZE, TDW >::ReadQueuePub ( )
inline

Thread worker that reads (pops) agnostic topic from queue and publishes it via DDS.

◆ SetAffinity()

template<typename T = rtctk::AgnosticTopic, uint16_t Q_SIZE = 300, typename TDW = TypedDataWriter>
void rtctk::telRepub::PubThread< T, Q_SIZE, TDW >::SetAffinity ( unsigned int  cpu)
inline

set affinity of the thread.

Parameters
cpunumber of CPU(core)

◆ SimPub()

template<typename T = rtctk::AgnosticTopic, uint16_t Q_SIZE = 300, typename TDW = TypedDataWriter>
void rtctk::telRepub::PubThread< T, Q_SIZE, TDW >::SimPub ( )
inline

Thread worker in case of simulation i.e.

just dummy agnostic topic is published with certain configure rate

Member Data Documentation

◆ m_data_writer

template<typename T = rtctk::AgnosticTopic, uint16_t Q_SIZE = 300, typename TDW = TypedDataWriter>
TDW* rtctk::telRepub::PubThread< T, Q_SIZE, TDW >::m_data_writer
protected

◆ m_framecounter

template<typename T = rtctk::AgnosticTopic, uint16_t Q_SIZE = 300, typename TDW = TypedDataWriter>
unsigned long rtctk::telRepub::PubThread< T, Q_SIZE, TDW >::m_framecounter
protected

◆ m_last_sample_id

template<typename T = rtctk::AgnosticTopic, uint16_t Q_SIZE = 300, typename TDW = TypedDataWriter>
uint32_t rtctk::telRepub::PubThread< T, Q_SIZE, TDW >::m_last_sample_id = 0
protected

◆ m_loop

template<typename T = rtctk::AgnosticTopic, uint16_t Q_SIZE = 300, typename TDW = TypedDataWriter>
std::atomic<bool> rtctk::telRepub::PubThread< T, Q_SIZE, TDW >::m_loop
protected

◆ m_message

template<typename T = rtctk::AgnosticTopic, uint16_t Q_SIZE = 300, typename TDW = TypedDataWriter>
T rtctk::telRepub::PubThread< T, Q_SIZE, TDW >::m_message
protected

◆ m_msg

template<typename T = rtctk::AgnosticTopic, uint16_t Q_SIZE = 300, typename TDW = TypedDataWriter>
T* rtctk::telRepub::PubThread< T, Q_SIZE, TDW >::m_msg
protected

◆ m_sample_id

template<typename T = rtctk::AgnosticTopic, uint16_t Q_SIZE = 300, typename TDW = TypedDataWriter>
uint32_t rtctk::telRepub::PubThread< T, Q_SIZE, TDW >::m_sample_id = 0
protected

◆ m_sim_loop_sleep

template<typename T = rtctk::AgnosticTopic, uint16_t Q_SIZE = 300, typename TDW = TypedDataWriter>
useconds_t rtctk::telRepub::PubThread< T, Q_SIZE, TDW >::m_sim_loop_sleep
protected

◆ m_thread

template<typename T = rtctk::AgnosticTopic, uint16_t Q_SIZE = 300, typename TDW = TypedDataWriter>
boost::thread rtctk::telRepub::PubThread< T, Q_SIZE, TDW >::m_thread
protected

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