ShmPub parent class.
More...
#include <shmPub.hpp>
|
| 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 |
| Reads in data from a FITS file. More...
|
|
virtual std::vector< TopicType > | GenData (int num_frames)=0 |
| Generates data to be circulated. More...
|
|
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
-
TopicType | the queue topic. |
WriterType | the 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
|
◆ ShmPub()
template<class TopicType , class WriterType = ipcq::Writer<TopicType>>
◆ ~ShmPub()
template<class TopicType , class WriterType = ipcq::Writer<TopicType>>
◆ GenData()
template<class TopicType , class WriterType = ipcq::Writer<TopicType>>
Generates data to be circulated.
This is a pure virtual function that must be overloaded by a child class in user code. The user code must allocate the necessary vector of the appropriate size (typically num_frames
), fill the vector with generated data, and then return the vector.
If an exception is thrown from this method the process will terminate early with an error message.
- Parameters
-
num_frames | The number of frames for which to generate data. |
- Returns
- A vector of data points of type TopicType, i.e.
std::vector<TopicType>
. The size of the vector should typically be equal to num_frames
.
Implemented in ExampleShmPubScao.
◆ ReadFits()
template<class TopicType , class WriterType = ipcq::Writer<TopicType>>
Reads in data from a FITS file.
This is a pure virtual function that must be overloaded by a child class in user code. The user code must allocate the necessary vector of the appropriate size, perform all FITS file access and handling, and return the filled vector containing the data.
If an exception is thrown from this method the process will terminate early with an error message.
- Parameters
-
filename | The name of the FITS file to read from. |
- Returns
- A vector of data points of type TopicType, i.e.
std::vector<TopicType>
.
Implemented in ExampleShmPubScao.
◆ Run()
template<class TopicType , class WriterType = ipcq::Writer<TopicType>>
Entry point for running the ShmPub.
Calls the required function for creating or loading data to be circulated by the shm writer. then call the main loop WriteToShm
- Returns
- 0 on successful exit.
-
1 if an exception is caught.
The documentation for this class was generated from the following file:
- standaloneTools/shmPub/src/include/rtctk/standaloneTools/shmPub.hpp