Class DataSinkBase
Defined in File data_sink.hpp
Inheritance Relationships
Derived Types
public DataTamer::DummySink(Class DummySink)public DataTamer::MCAPSink(Class MCAPSink)public DataTamer::ROS2PublisherSink(Class ROS2PublisherSink)
Class Documentation
-
class DataSinkBase
The DataSinkBase is the base class to use to create your own DataSink.
Subclassed by DataTamer::DummySink, DataTamer::MCAPSink, DataTamer::ROS2PublisherSink
Public Functions
-
DataSinkBase()
-
DataSinkBase(const DataSinkBase &other) = delete
-
DataSinkBase &operator=(const DataSinkBase &other) = delete
-
DataSinkBase(DataSinkBase &&other) = delete
-
DataSinkBase &operator=(DataSinkBase &&other) = delete
-
virtual ~DataSinkBase()
-
virtual void addChannel(const std::string &name, const Schema &schema) = 0
addChannel will register a schema into the sink. That schema will be recognized by its hash.
- Parameters:
name – name of the channel
schema – a schema, suaully obtained from LogChannel::getSchema()
-
virtual bool pushSnapshot(const Snapshot &snapshot)
pushSnapshot will push the data into a concurrent queue, that a different thread will consume, using storeSnapshot()
- Parameters:
snapshot – see type Snapshot for details
- Returns:
false if the queue is full and snapshot was not pushed
Protected Functions
-
virtual bool storeSnapshot(const Snapshot &snapshot) = 0
storeSnapshot contains the code to execute when popping a snapshot from the queue.
- Parameters:
snapshot – data to be pushed into the sink.
- Returns:
true if processed successfully
-
void stopThread()
-
void stopAcceptingSnapshots()
-
void processQueuedSnapshots()
-
void startAcceptingSnapshots()
-
DataSinkBase()