rtmlib
Public Types | Public Member Functions | Protected Attributes | List of all members
RTML_reader< B > Class Template Reference

#include <reader.h>

Public Types

enum  error_t { AVAILABLE = 0, UNAVAILABLE, OVERFLOW, BUFFER_READ }
 
typedef B buffer_t
 

Public Member Functions

 RTML_reader (const B &)
 
error_t pull (typename B::event_t &)
 
error_t pop (typename B::event_t &)
 
bool synchronize ()
 
bool gap () const
 
size_t length () const
 
void debug () const
 

Protected Attributes

const B & buffer
 
size_t top
 
size_t bottom
 
timespanw timestamp
 

Detailed Description

template<typename B>
class RTML_reader< B >

Reader to support local RTML_buffer management.

Author
André Pedro
Date

Member Typedef Documentation

◆ buffer_t

template<typename B >
typedef B RTML_reader< B >::buffer_t

Member Enumeration Documentation

◆ error_t

template<typename B >
enum RTML_reader::error_t
Enumerator
AVAILABLE 
UNAVAILABLE 
OVERFLOW 
BUFFER_READ 

Constructor & Destructor Documentation

◆ RTML_reader()

template<typename B >
RTML_reader< B >::RTML_reader ( const B &  _buffer)

Constructs a new RTML_reader.

Construct the new event reader that reads and manage events from a buffer.

Parameters
buffera constant pointer that points to the buffer.

Member Function Documentation

◆ debug()

template<typename B >
void RTML_reader< B >::debug ( ) const

Debug function

◆ gap()

template<typename B >
bool RTML_reader< B >::gap ( ) const

Detects a gap. It compares the current RTML_reader absolute timestamp with the current absolute timestamp of the buffer.

Returns
true if there is a gap in the buffer, false otherwise.

◆ length()

template<typename B >
size_t RTML_reader< B >::length ( ) const

Get reader length

Returns
the template parameter N.

◆ pop()

template<typename B >
RTML_reader< B >::error_t RTML_reader< B >::pop ( typename B::event_t &  event)

Pop event from the buffer.

Returns
an errot_t

◆ pull()

template<typename B >
RTML_reader< B >::error_t RTML_reader< B >::pull ( typename B::event_t &  event)

Pull event from the buffer.

Returns
an errot_t

◆ synchronize()

template<typename B >
bool RTML_reader< B >::synchronize ( )

Synchronizes the RTML_reader with the buffer

Returns
true if the RTML_reader have been synchronized, false otherwise.

Member Data Documentation

◆ bottom

template<typename B >
size_t RTML_reader< B >::bottom
protected

The bottom of the reader

◆ buffer

template<typename B >
const B& RTML_reader< B >::buffer
protected

Constant reference to a ring Buffer this RTML_reader reads from.

See also
RTML_buffer

◆ timestamp

template<typename B >
timespanw RTML_reader< B >::timestamp
protected

The timestamp of the reader to detect gaps

◆ top

template<typename B >
size_t RTML_reader< B >::top
protected

The reader contains a top and a bottom


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