8 #ifndef DAQ_CONVERSION_HPP_
9 #define DAQ_CONVERSION_HPP_
16 #include <string_view>
25 daqif::DaqStatus&
operator<<(daqif::DaqStatus& status, Status
const& rhs);
27 template <
class Clock,
class Duration =
typename Clock::duration>
28 double FromTimePoint(std::chrono::time_point<Clock, Duration>
const& time);
30 template <
class Clock,
class Duration =
typename Clock::duration>
31 std::chrono::time_point<Clock, Duration>
ToTimePoint(
double time);
36 Status&
operator<<(Status& status, daqif::DaqStatus
const& rhs);
41 std::filesystem::space_info&
42 operator<<(std::filesystem::space_info& space, daqif::StorageStatus
const& rhs);
47 daqif::StorageStatus&
operator<<(daqif::StorageStatus& storage, std::filesystem::space_info& rhs);
62 std::string_view
ToString(daqif::DaqState state) noexcept;
67 std::string_view
ToString(daqif::DaqSubState state) noexcept;
69 template <
class Clock,
class Duration>
70 double FromTimePoint(std::chrono::time_point<Clock, Duration>
const& time) {
71 using Seconds = std::chrono::duration<double, std::ratio<1>>;
72 return std::chrono::time_point_cast<Seconds>(time).time_since_epoch().count();
75 template <
class Clock,
class Duration>
76 std::chrono::time_point<Clock, Duration>
ToTimePoint(
double duration) {
77 using Seconds = std::chrono::duration<double, std::ratio<1>>;
78 return std::chrono::time_point<Clock, Duration>(
79 std::chrono::duration_cast<Duration>(Seconds(duration)));
Contains State support functions for daqif.
daqif::FullState MakeState(State state) noexcept
Converts daq::State to DaqSubstate.
std::string_view ToString(daqif::DaqState state) noexcept
std::ostream & operator<<(std::ostream &os, AsyncProcessIf const &proc)
Formats proc representation in the form [<pid>] <args>
State
Observable states of the data acquisition process.
double FromTimePoint(std::chrono::time_point< Clock, Duration > const &time)
std::chrono::time_point< Clock, Duration > ToTimePoint(double time)
Describes the full state and substate.
Config class header file.