Cheetah - SKA - PSS - Prototype Time Domain Search Pipeline
Public Member Functions | Protected Attributes | List of all members
ska::cheetah::psrdada::DadaClientBase Class Reference

A general base class for DADA readers and writers. More...

#include <cheetah/psrdada/DadaClientBase.h>

Inheritance diagram for ska::cheetah::psrdada::DadaClientBase:
Inheritance graph
Collaboration diagram for ska::cheetah::psrdada::DadaClientBase:
Collaboration graph

Public Member Functions

 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.
 

Protected Attributes

key_t _key
 
dada_hdu_t * _hdu
 
bool _connected
 
detail::MultiLog _log
 
std::string _id
 

Detailed Description

A general base class for DADA readers and writers.

Definition at line 50 of file DadaClientBase.h.

Constructor & Destructor Documentation

◆ DadaClientBase()

ska::cheetah::psrdada::DadaClientBase::DadaClientBase ( key_t  key,
std::string const &  logger_name 
)

Create a new basic DADA client instance.

Parameters
[in]keyThe hexidecimal shared memory key
logger_nameA name to give the internal multilog instance

Definition at line 63 of file DadaClientBase.cpp.

64  : _key(key)
65  , _log(detail::generate_logger_tag(logger_name))
66 {
67  std::stringstream _key_string_stream;
68  _key_string_stream.exceptions(std::ifstream::failbit);
69  _key_string_stream << "["<< std::hex << _key << std::dec << "]["<<_log.name()<<"] ";
70  _id = _key_string_stream.str();
71  connect();
72 }
std::string const & name() const
Return the name of the logger.
Definition: MultiLog.cpp:62
void connect()
Connect to ring buffer.
Here is the call graph for this function:

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