RTC Toolkit  1.0.0
Public Member Functions | List of all members
rtctk::standaloneTools::ShmPub< TopicType, WriterType > Class Template Referenceabstract

ShmPub parent class. More...

#include <shmPub.hpp>

Public Member Functions

 ShmPub (int argc, char *argv[])
 
virtual ~ShmPub ()=default
 
int Run ()
 Entry point for running the ShmPub. More...
 
virtual std::vector< TopicType > ReadFits (std::string filename)=0
 Pure virtual function to be overloaded by child class. More...
 
virtual std::vector< TopicType > GenData (int num_frames)=0
 Pure virtual function to be overloaded by child class. More...
 

Detailed Description

template<class TopicType, class WriterType = ipcq::Writer<TopicType>>
class rtctk::standaloneTools::ShmPub< TopicType, WriterType >

ShmPub parent class.

Note
Child classes must inherited from this class and must overload functions ReadFits(std::string) and GenData(int).
Template Parameters
TopicTypethe queue topic.
WriterTypethe type of ipcq writer to be used defaults to ipcq::Writer<TopicType>
  Allowed options:
  -h [ --help ]                         produce help message
  -f [ --fits-file ] arg                fits input file: if not provided the
                                          app will generate data
  -q [ --queue-name ] arg (=default_shm_queue)
                                          shm queue name
  -s [ --queue-size ] arg (=1000)       size of the queue
  -d [ --sample-delay ] arg (=10)       inter-sample delay in ms
  -n [ --numa-node ] arg                numa node for shm queue
  -p [ --print-every ] arg (=0)         when to print to screen the number of
                                          sample written
  -g [ --gen-frames ] arg (=100)        Number of frames to generate
  -r [ --repeat-mode ]                  Repeat output when all samples are
                                          written

Constructor & Destructor Documentation

◆ ShmPub()

template<class TopicType , class WriterType = ipcq::Writer<TopicType>>
rtctk::standaloneTools::ShmPub< TopicType, WriterType >::ShmPub ( int  argc,
char *  argv[] 
)
inline

◆ ~ShmPub()

template<class TopicType , class WriterType = ipcq::Writer<TopicType>>
virtual rtctk::standaloneTools::ShmPub< TopicType, WriterType >::~ShmPub ( )
virtualdefault

Member Function Documentation

◆ GenData()

template<class TopicType , class WriterType = ipcq::Writer<TopicType>>
virtual std::vector<TopicType> rtctk::standaloneTools::ShmPub< TopicType, WriterType >::GenData ( int  num_frames)
pure virtual

Pure virtual function to be overloaded by child class.

generates data to be circulated

Returns
std::vector<TopicType> a vector of data points of type TopicType

Implemented in ExampleShmPubScao.

◆ ReadFits()

template<class TopicType , class WriterType = ipcq::Writer<TopicType>>
virtual std::vector<TopicType> rtctk::standaloneTools::ShmPub< TopicType, WriterType >::ReadFits ( std::string  filename)
pure virtual

Pure virtual function to be overloaded by child class.

Reads in fits file using user code

Returns
std::vector<TopicType> a vector of data points of type TopicType

Implemented in ExampleShmPubScao.

◆ Run()

template<class TopicType , class WriterType = ipcq::Writer<TopicType>>
int rtctk::standaloneTools::ShmPub< TopicType, WriterType >::Run ( )
inline

Entry point for running the ShmPub.

calls the requred function for creating or loading data to be circulated by the shm writer. then call the main loop WriteToShm

Returns
0 on sucessfull exit
1 if exception caught

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