Cheetah - SKA - PSS - Prototype Time Domain Search Pipeline
|
Class that provides means for writing to a DADA ring buffer. More...
#include <cheetah/psrdada/DadaWriteClient.h>
Public Member Functions | |
DadaWriteClient (key_t key, NewSequenceCallback const &new_sequence_callback) | |
Instatiate new DadaWriteClient. More... | |
DadaWriteClient (DadaWriteClient const &)=delete | |
template<typename Iterator , typename DataType = typename std::iterator_traits<Iterator>::value_type> | |
void | write (Iterator &begin, Iterator const &end) |
Write to the data ring buffer. More... | |
void | new_sequence () |
Start a new writing sequence in the buffer. More... | |
void | write_eod () |
: Write an EOD marker without writing a next header | |
![]() | |
DadaClientBase (key_t key, std::string const &logger_name) | |
Create a new basic DADA client instance. More... | |
DadaClientBase (DadaClientBase const &)=delete | |
std::size_t | data_buffer_size () const |
Get the sizes of each data block in the ring buffer. | |
std::size_t | header_buffer_size () const |
Get the sizes of each header block in the ring buffer. | |
std::size_t | data_buffer_count () const |
Get the number of data blocks in the ring buffer. | |
std::size_t | header_buffer_count () const |
Get the number of header blocks in the ring buffer. | |
void | connect () |
Connect to ring buffer. | |
void | disconnect () |
Disconnect from ring buffer. | |
void | reconnect () |
Reconnect to the ring buffer. | |
std::string const & | id () const |
Return a string identifier based on the buffer key and log name. | |
Additional Inherited Members | |
![]() | |
key_t | _key |
dada_hdu_t * | _hdu |
bool | _connected |
detail::MultiLog | _log |
std::string | _id |
Class that provides means for writing to a DADA ring buffer.
This class provides writer-like access to a ring of DADA HDU memory buffers.
Definition at line 59 of file DadaWriteClient.h.
ska::cheetah::psrdada::DadaWriteClient::DadaWriteClient | ( | key_t | key, |
NewSequenceCallback const & | new_sequence_callback | ||
) |
Instatiate new DadaWriteClient.
[in] | key | Hexidecimal key to DADA shared memory block |
new_sequence_callback | A callback to be called on the start of each new sequence in the DADA buffer. |
Upon instantiaton the DadaWriteClient instance will connect to the DADA buffer identified by the key and open a header block for writing, this header block is passed to the new_sequence_callback in the form of a std::ostream reference.
To end writing for the current sequence and start a new sequence, use the new_sequence method.
Definition at line 34 of file DadaWriteClient.cpp.
void ska::cheetah::psrdada::DadaWriteClient::new_sequence | ( | ) |
Start a new writing sequence in the buffer.
This call will insert and end-of-data marker into the ring buffer and invoke the new_sequence_callback with a std::ostream reference into the next header block.
Definition at line 51 of file DadaWriteClient.cpp.
void ska::cheetah::psrdada::DadaWriteClient::write | ( | Iterator & | begin, |
Iterator const & | end | ||
) |
Write to the data ring buffer.
begin | An iterator pointing to the start of the sequence to write. |
end | An iterator pointing to the end of the sequence to write. |
DataType | The data type to be written to the buffer. |
Iterator | The iterator type. |
Data will be cast to DataType upon writing to the buffer. It is the responsibility of the caller to ensure that this cast does not result in under or overflow.
Definition at line 35 of file DadaWriteClient.cpp.