RTC Toolkit  1.0.0
fitsRecorder.hpp
Go to the documentation of this file.
1 
12 #ifndef RTCTK_REUSABLECOMPONENT_TELEMETRYRECORDER_FITSRECORDER_HPP
13 #define RTCTK_REUSABLECOMPONENT_TELEMETRYRECORDER_FITSRECORDER_HPP
14 
15 #include <CCfits/FITS.h>
16 #include <CCfits/FitsError.h>
17 #include <string>
18 #include <memory>
19 #include <functional>
20 #include <optional>
21 #include <string_view>
22 
24 
26 
27 namespace rtctk::telemetryRecorder {
28 
36 template<typename T>
37 class FitsRecorder : public RecorderIf<T>
38 {
39  public:
43  class FitsException : public ::elt::error::CiiBaseException {
44  public:
45  using ::elt::error::CiiBaseException::CiiBaseException;
46  explicit FitsException(CCfits::FitsException const& error) :
47  CiiBaseException(error.message()) {}
48  };
49  FitsRecorder() = default;
50  FitsRecorder(const FitsRecorder&) = delete;
51  FitsRecorder(FitsRecorder&&) noexcept = default;
52  FitsRecorder& operator=(const FitsRecorder&) = delete;
53  FitsRecorder& operator=(FitsRecorder&&) noexcept = default;
54 
59  explicit FitsRecorder(const std::string& file);
60  virtual ~FitsRecorder() = default;
61 
66  void Open(const std::string& file) override;
70  void Close() override;
71 
72  protected:
76  std::unique_ptr<CCfits::FITS> m_fits_handle;
77 };
78 
79 }
80 
81 #include <rtctk/telemetryRecorder/detail/fitsRecorderDetail.hpp>
82 
83 #endif // RTCTK_REUSABLECOMPONENT_TELEMETRYRECORDER_FITSRECORDER_HPP
exceptions.hpp
Provides macros and utilities for exception handling.
rtctk::telemetryRecorder::FitsRecorder::m_fits_handle
std::unique_ptr< CCfits::FITS > m_fits_handle
the handle to access the opened file
Definition: fitsRecorder.hpp:76
rtctk::telemetryRecorder::FitsRecorder::FitsRecorder
FitsRecorder(const FitsRecorder &)=delete
rtctk::telemetryRecorder::FitsRecorder::Close
void Close() override
If a FITS file is currently open, close the file.
Definition: fitsRecorderDetail.hpp:34
rtctk::telemetryRecorder::RecorderIf
Definition: recorderIf.hpp:25
rtctk::telemetryRecorder::FitsRecorder::FitsException::FitsException
FitsException(CCfits::FitsException const &error)
Definition: fitsRecorder.hpp:46
rtctk::telemetryRecorder::FitsRecorder::Open
void Open(const std::string &file) override
Open the FITS file given.
Definition: fitsRecorderDetail.hpp:24
rtctk::telemetryRecorder::FitsRecorder::FitsRecorder
FitsRecorder()=default
rtctk::telemetryRecorder
Definition: businessLogic.hpp:20
rtctk::telemetryRecorder::FitsRecorder::FitsException
This class encapsulates the CCFits exceptions in CiiBaseExceptions.
Definition: fitsRecorder.hpp:43
recorderIf.hpp
Recorder Interface of the Telemetry Recorder.
rtctk::telemetryRecorder::FitsRecorder
The FitsRecorder is a abstract class that can be used to implement a specific recorder for a Topic.
Definition: fitsRecorder.hpp:38
std
Definition: mudpiProcessingError.hpp:119
rtctk::telemetryRecorder::FitsRecorder::FitsRecorder
FitsRecorder(FitsRecorder &&) noexcept=default
error
void error(const char *msg)
Definition: main.cpp:38