|
RTC Toolkit 5.1.0
|
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 |
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.
| using rtctk::componentFramework::DataRecorder< T >::ColumnDescription = const std::array<ColumnMetaData, sizeof...(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.
| using rtctk::componentFramework::DataRecorder< T >::TupleType = std::tuple<T...> |
Type of the tuple returned by user-defined method AsTuple.
|
inlineexplicit |
Create a new recorder.
| [in] | columns | Array of table column descriptions. |
| [in] | disable | Array of bools, with the boolean indicating whether fields should be skipped during the recording. |
|
virtualdefault |
|
pure virtual |
Close the currently open file.
Implemented in rtctk::componentFramework::CsvDataRecorder< T >, rtctk::componentFramework::CsvDataRecorder< taiclock::TaiClock::time_point::rep, std::string >, and rtctk::componentFramework::FitsRecorder< T >.
|
pure virtual |
Default filename extension for the recorder.
Implemented in rtctk::componentFramework::CsvDataRecorder< T >, rtctk::componentFramework::CsvDataRecorder< taiclock::TaiClock::time_point::rep, std::string >, rtctk::componentFramework::FitsRecorder< T >, and FakeRecorder< T >.
|
pure virtual |
Open a file.
| [in] | file | The path to the file. |
Implemented in rtctk::componentFramework::CsvDataRecorder< T >, rtctk::componentFramework::CsvDataRecorder< taiclock::TaiClock::time_point::rep, std::string >, and rtctk::componentFramework::FitsRecorder< T >.
|
inline |
Disable certain fields so that they are not recorded.
| [in] | disable | Array of bools, with the boolean indicating whether fields should be skipped during the recording. |
|
inlinevirtual |
Write multiple rows of data.
| [in] | data | The tuple containing all the data, including the disabled fields. |
|
pure virtual |
Write a single row of data.
| [in] | data | The 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 >.
|
protected |
|
protected |
Array of fields that should not be recorded.