RTC Toolkit 5.1.0
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Protected Attributes | List of all members
rtctk::componentFramework::DataRecorder< T > Class Template Referenceabstract

This is an abstract class that can be used to implement an OutputStage for a Recording Unit. More...

#include <dataRecorder.hpp>

Classes

struct  ColumnMetaData
 

Public Types

using TupleType = std::tuple<T...>
 Type of the tuple returned by user-defined method AsTuple.
 
using DisabledFields = std::array<bool, sizeof...(T)>
 Type for disabled fields, an array of bools with length equal to size of the data tuple.
 
using ColumnDescription = const std::array<ColumnMetaData, sizeof...(T)>
 

Public Member Functions

 DataRecorder (const ColumnDescription &columns, const DisabledFields &disable={})
 Create a new recorder.
 
virtual ~DataRecorder ()=default
 
void SetDisabledFields (const DisabledFields &disable)
 Disable certain fields so that they are not recorded.
 
virtual void Write (const std::tuple< T... > &data)=0
 Write a single row of data.
 
virtual void Write (const gsl::span< const std::tuple< T... > > data)
 Write multiple rows of data.
 
virtual void Open (const std::filesystem::path &file)=0
 Open a file.
 
virtual void Close ()=0
 Close the currently open file.
 
virtual std::string DefaultFileExtension ()=0
 Default filename extension for the recorder.
 

Protected Attributes

DisabledFields m_disabled_fields
 Array of fields that should not be recorded.
 
const ColumnDescription m_column_description
 

Detailed Description

template<class... T>
class rtctk::componentFramework::DataRecorder< T >

This is an abstract class that can be used to implement an OutputStage for a Recording Unit.

It provides an interface to open and close files, write a tuple and allows removing parts of the tuple from the output. This is used when only a subset of the data should be written.

Member Typedef Documentation

◆ ColumnDescription

template<class... T>
using rtctk::componentFramework::DataRecorder< T >::ColumnDescription = const std::array<ColumnMetaData, sizeof...(T)>

◆ DisabledFields

template<class... T>
using rtctk::componentFramework::DataRecorder< T >::DisabledFields = std::array<bool, sizeof...(T)>

Type for disabled fields, an array of bools with length equal to size of the data tuple.

◆ TupleType

template<class... T>
using rtctk::componentFramework::DataRecorder< T >::TupleType = std::tuple<T...>

Type of the tuple returned by user-defined method AsTuple.

Constructor & Destructor Documentation

◆ DataRecorder()

template<class... T>
rtctk::componentFramework::DataRecorder< T >::DataRecorder ( const ColumnDescription & columns,
const DisabledFields & disable = {} )
inlineexplicit

Create a new recorder.

Parameters
[in]columnsArray of table column descriptions.
[in]disableArray of bools, with the boolean indicating whether fields should be skipped during the recording.

◆ ~DataRecorder()

template<class... T>
virtual rtctk::componentFramework::DataRecorder< T >::~DataRecorder ( )
virtualdefault

Member Function Documentation

◆ Close()

template<class... T>
virtual void rtctk::componentFramework::DataRecorder< T >::Close ( )
pure virtual

◆ DefaultFileExtension()

template<class... T>
virtual std::string rtctk::componentFramework::DataRecorder< T >::DefaultFileExtension ( )
pure virtual

◆ Open()

template<class... T>
virtual void rtctk::componentFramework::DataRecorder< T >::Open ( const std::filesystem::path & file)
pure virtual

◆ SetDisabledFields()

template<class... T>
void rtctk::componentFramework::DataRecorder< T >::SetDisabledFields ( const DisabledFields & disable)
inline

Disable certain fields so that they are not recorded.

Parameters
[in]disableArray of bools, with the boolean indicating whether fields should be skipped during the recording.

◆ Write() [1/2]

template<class... T>
virtual void rtctk::componentFramework::DataRecorder< T >::Write ( const gsl::span< const std::tuple< T... > > data)
inlinevirtual

Write multiple rows of data.

Parameters
[in]dataThe tuple containing all the data, including the disabled fields.

◆ Write() [2/2]

template<class... T>
virtual void rtctk::componentFramework::DataRecorder< T >::Write ( const std::tuple< T... > & data)
pure virtual

Write a single row of data.

Parameters
[in]dataThe tuple containing all the data, including the disabled fields.

Implemented in rtctk::componentFramework::CsvDataRecorder< T >, rtctk::componentFramework::CsvDataRecorder< taiclock::TaiClock::time_point::rep, std::string >, and rtctk::componentFramework::FitsRecorder< T >.

Member Data Documentation

◆ m_column_description

template<class... T>
const ColumnDescription rtctk::componentFramework::DataRecorder< T >::m_column_description
protected

◆ m_disabled_fields

template<class... T>
DisabledFields rtctk::componentFramework::DataRecorder< T >::m_disabled_fields
protected

Array of fields that should not be recorded.


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