RTC Toolkit 5.1.0
Loading...
Searching...
No Matches
csvDataRecorder.hpp
Go to the documentation of this file.
1
12#ifndef RTCTK_COMPONENTFRAMEWORK_CSVDATARECORDER_HPP
13#define RTCTK_COMPONENTFRAMEWORK_CSVDATARECORDER_HPP
14
16
17#include <filesystem>
18#include <fitsio2.h>
19#include <fstream>
20#include <functional>
21#include <gsl/span>
22#include <iostream>
23#include <map>
24#include <memory>
25#include <string_view>
26
28
32template <class... T>
33class CsvDataRecorder : public DataRecorder<T...> {
34public:
43 const std::array<bool, sizeof...(T)>& disabled = {});
44 ~CsvDataRecorder() override = default;
45 void Open(const std::filesystem::path& file) override;
46 void Write(const std::tuple<T...>& data) override;
47 void Close() override;
48
49 std::string DefaultFileExtension() override {
50 return std::string{".csv"};
51 }
52
53private:
54 std::fstream m_output;
55};
56
57} // namespace rtctk::componentFramework
58
60
61#endif // RTCTK_COMPONENTFRAMEWORK_CSVDATARECORDER_HPP
Recorder used for writing data to a CSV file.
Definition csvDataRecorder.hpp:33
std::string DefaultFileExtension() override
Default filename extension for the recorder.
Definition csvDataRecorder.hpp:49
void Close() override
Close the currently open file.
Definition csvDataRecorder.ipp:56
CsvDataRecorder(const ColumnDescription &columns, const std::array< bool, sizeof...(T)> &disabled={})
Create a new recorder.
Definition csvDataRecorder.ipp:31
typename DataRecorder< T... >::ColumnDescription ColumnDescription
Definition csvDataRecorder.hpp:35
void Open(const std::filesystem::path &file) override
Open a file.
Definition csvDataRecorder.ipp:37
void Write(const std::tuple< T... > &data) override
Write a single row of data.
Definition csvDataRecorder.ipp:61
This is an abstract class that can be used to implement an OutputStage for a Recording Unit.
Definition dataRecorder.hpp:29
FitsRecorder allows to write ColumnData to into fits files in a specified directory.
Provides an abstract DataRecorder class as the output stage for a recording unit.
Definition commandReplier.cpp:22
elt::mal::future< std::string > InjectReqRepEvent(StateMachineEngine &engine)
Definition malEventInjector.hpp:23