RTC Toolkit  2.0.0
Public Member Functions | Static Public Attributes | List of all members
rtctk::standaloneTools::GenDdsPublisher Class Reference

Generic DDS Publisher Class provides functionally to create one DDS Topic and one DDS DataWriter, and one thread that first waits for a given number of data readers/subscribers and after publishing sampels in a loop. More...

#include <rtctkGenDdsPublisher.h>

Public Member Functions

 GenDdsPublisher (rtctk::componentFramework::DdsPub &dds_pub)
 
virtual ~GenDdsPublisher () noexcept
 
 GenDdsPublisher ()=delete
 
 GenDdsPublisher (const GenDdsPublisher &)=delete
 
 GenDdsPublisher (GenDdsPublisher &&)=delete
 
void Initialize (std::string &topic_name, uint16_t &wait_for_n_subs, uint32_t &payload_size, std::chrono::microseconds &sleep_period)
 Creates DDS Topic and Data Writer and publishing thread
More...
 
void Finalize ()
 Stops publishing thread, and join it, delete DDS entities. More...
 

Static Public Attributes

static std::atomic< uint16_t > s_idx =0
 

Detailed Description

Generic DDS Publisher Class provides functionally to create one DDS Topic and one DDS DataWriter, and one thread that first waits for a given number of data readers/subscribers and after publishing sampels in a loop.

So each object in parallel publishes DDS samples

Note
It is intended to be used just internally in rtctkGenDdsPub

Constructor & Destructor Documentation

◆ GenDdsPublisher() [1/4]

GenDdsPublisher::GenDdsPublisher ( rtctk::componentFramework::DdsPub dds_pub)

◆ ~GenDdsPublisher()

GenDdsPublisher::~GenDdsPublisher ( )
virtualnoexcept

◆ GenDdsPublisher() [2/4]

rtctk::standaloneTools::GenDdsPublisher::GenDdsPublisher ( )
delete

◆ GenDdsPublisher() [3/4]

rtctk::standaloneTools::GenDdsPublisher::GenDdsPublisher ( const GenDdsPublisher )
delete

◆ GenDdsPublisher() [4/4]

rtctk::standaloneTools::GenDdsPublisher::GenDdsPublisher ( GenDdsPublisher &&  )
delete

Member Function Documentation

◆ Finalize()

void GenDdsPublisher::Finalize ( )

Stops publishing thread, and join it, delete DDS entities.

◆ Initialize()

void GenDdsPublisher::Initialize ( std::string &  topic_name,
uint16_t &  wait_for_n_subs,
uint32_t &  payload_size,
std::chrono::microseconds &  sleep_period 
)

Creates DDS Topic and Data Writer and publishing thread

Parameters
topic_nametopic name
wait_for_n_subsnumber of data readers / subscribers that must connect before sending the first sample
payload_sizesample payload size (in# floats)
sleep_periodsleep period after each sample is published

Member Data Documentation

◆ s_idx

std::atomic< uint16_t > GenDdsPublisher::s_idx =0
static

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