RTC Toolkit  2.0.0
dataRecorder.hpp
Go to the documentation of this file.
1 
11 #ifndef RTCTK_COMPONENTFRAMEWORK_DATARECORDER_HPP
12 #define RTCTK_COMPONENTFRAMEWORK_DATARECORDER_HPP
13 
14 #include <array>
15 #include <tuple>
16 #include <filesystem>
17 
18 namespace rtctk::componentFramework {
19 
20 template <class... T>
21 class DataRecorder {
22 public:
26  typedef const std::array<bool, sizeof...(T)> DisabledFields;
32  explicit DataRecorder(const DisabledFields& disable = {})
33  : m_disabled_fields(disable) {
34  }
35  virtual ~DataRecorder() = default;
40  virtual void Write(const std::tuple<T...>& data) = 0;
45  virtual void Open(const std::filesystem::path& file) = 0;
50  virtual void Close() = 0;
51 
52 protected:
57 };
58 
59 } // namespace rtctk::componentFramework
60 
61 #endif // RTCTK_COMPONENTFRAMEWORK_DATARECORDER_HPP
rtctk::componentFramework::DataRecorder::Write
virtual void Write(const std::tuple< T... > &data)=0
Write a row of data.
rtctk::componentFramework
Definition: commandReplier.cpp:20
rtctk::componentFramework::DataRecorder
Definition: dataRecorder.hpp:21
rtctk::componentFramework::DataRecorder::~DataRecorder
virtual ~DataRecorder()=default
rtctk::componentFramework::DataRecorder::DataRecorder
DataRecorder(const DisabledFields &disable={})
create a new recorder
Definition: dataRecorder.hpp:32
rtctk::componentFramework::DataRecorder::Close
virtual void Close()=0
Close the currently open file.
rtctk::componentFramework::DataRecorder< T... >::DisabledFields
const std::array< bool, sizeof...(T)> DisabledFields
type for the disabled fields, an array of bools with the length equal to the size of the data tuple
Definition: dataRecorder.hpp:26
rtctk::componentFramework::DataRecorder::m_disabled_fields
const DisabledFields m_disabled_fields
array of fields that should not be recorded
Definition: dataRecorder.hpp:56
rtctk::componentFramework::DataRecorder::Open
virtual void Open(const std::filesystem::path &file)=0
Open a file.