8#ifndef DAQ_CONVERSION_HPP_
9#define DAQ_CONVERSION_HPP_
25daqif::DaqStatus&
operator<<(daqif::DaqStatus& status, Status
const& rhs);
30daqif::InternalDaqStatus&
operator<<(daqif::InternalDaqStatus& status, Status
const& rhs);
35Status&
operator<<(Status& status, daqif::InternalDaqStatus
const& rhs);
37template <
class Clock,
class Duration =
typename Clock::duration>
38double FromTimePoint(std::chrono::time_point<Clock, Duration>
const& time);
40template <
class Clock,
class Duration =
typename Clock::duration>
41std::chrono::time_point<Clock, Duration>
ToTimePoint(
double time);
46Status&
operator<<(Status& status, daqif::DaqStatus
const& rhs);
51std::filesystem::space_info&
52operator<<(std::filesystem::space_info& space, daqif::StorageStatus
const& rhs);
57daqif::StorageStatus&
operator<<(daqif::StorageStatus& storage, std::filesystem::space_info& rhs);
72std::string_view
ToString(daqif::DaqState state)
noexcept;
77std::string_view
ToString(daqif::DaqSubState state)
noexcept;
79template <
class Clock,
class Duration>
80double FromTimePoint(std::chrono::time_point<Clock, Duration>
const& time) {
81 using Seconds = std::chrono::duration<double, std::ratio<1>>;
82 return std::chrono::time_point_cast<Seconds>(time).time_since_epoch().count();
85template <
class Clock,
class Duration>
86std::chrono::time_point<Clock, Duration>
ToTimePoint(
double duration) {
87 using Seconds = std::chrono::duration<double, std::ratio<1>>;
88 return std::chrono::time_point<Clock, Duration>(
89 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.