RTC Toolkit 5.1.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Attributes | List of all members
rtctk::componentFramework::DataPointRecordingUnit< DpType > Class Template Reference

Recording Unit that can record datapoints. More...

#include <dataPointRecordingUnit.hpp>

Inheritance diagram for rtctk::componentFramework::DataPointRecordingUnit< DpType >:
rtctk::componentFramework::RecordingUnit

Public Types

using CaptureMask = uint32_t
 
using TimepointType = taiclock::TaiClock::time_point::rep
 
using OutputDpType = std::conditional_t<IS_SPAN_CONVERTIBLE<DpType>, AsSpan<DpType>, DpType>
 
using OutputStageType = DataRecorder<TimepointType, OutputDpType>
 
- Public Types inherited from rtctk::componentFramework::RecordingUnit
enum class  State : uint8_t {
  STOPPED , PREPARING , IDLE , WAITING ,
  RUNNING , FINISHED , FAILED
}
 

Public Member Functions

 DataPointRecordingUnit (const std::string &comp_id, const std::string &unit_id, ServiceContainer &services, const DataPointPath &dp_path, DataPointRecordingSource source=DataPointRecordingSource::RUNTIMEREPO, std::unique_ptr< OutputStageType > &&output_stage={}, std::optional< size_t > fixed_recording_length=std::nullopt)
 Create a new recording unit.
 
virtual ~DataPointRecordingUnit ()
 
void Prepare (const std::filesystem::path &file_path) override
 Prepare the recording.
 
void Start () override
 Start the recording.
 
std::vector< std::filesystem::path > Stop () override
 Stop the recording and wait for it's termination.
 
- Public Member Functions inherited from rtctk::componentFramework::RecordingUnit
 RecordingUnit (const std::string &comp_id, const std::string &unit_id, const std::string &unit_type, ServiceContainer &services)
 Create a new RecordingIngestion.
 
 RecordingUnit ()=delete
 
virtual ~RecordingUnit ()=default
 
void ConnectWithLeaders (RecUnitListType &units)
 
std::string GetId ()
 Get the unit_it of this RecordingUnit.
 
State GetState ()
 Get the current state of the Recording Unit.
 
virtual void CheckErrors ()
 Check for Errors, will rethrow errors thrown in the recorder.
 
virtual void Update ()
 Update dynamic settings.
 
boost::signals2::connection Connect (const std::function< void(const std::string &, const State &)> &function)
 Connect to State change signal.
 

Static Public Attributes

static constexpr uint32_t CAPTURE_ON_START = 1
 
static constexpr uint32_t CAPTURE_ON_STOP = 2
 
static constexpr uint32_t CAPTURE_ON_CHANGE = 4
 
static constexpr OutputStageType::ColumnDescription COLUMNS
 

Additional Inherited Members

- Public Attributes inherited from rtctk::componentFramework::RecordingUnit
const std::map< State, std::string > m_state_text
 
- Protected Member Functions inherited from rtctk::componentFramework::RecordingUnit
bool SetState (State state, State precondition)
 Sets the new state, only goes to new state, if expected state matches.
 
void SetState (State state, State precondition, const std::string &error_message)
 Sets the new state, only goes to new state, if expected state matches.
 
void SetFailed (const std::exception_ptr &exception)
 Set the unit into failed state, with the given exception.
 
void SetStopped ()
 Set the Unit state to STOPPED independent of the current State.
 
bool HasLeaders ()
 Check if this unit is following any leaders.
 
bool HasFirstLeaderStarted ()
 This function is used to determine if this unit should start recording when waiting for leaders.
 
bool HasLastLeaderFinished ()
 This function is used to determine if this unit should stop recording when waiting for leaders.
 
void ResetLeaderStates ()
 
- Protected Attributes inherited from rtctk::componentFramework::RecordingUnit
std::string m_comp_id
 
std::string m_unit_id
 
RuntimeRepoIfm_rtr
 
OldbIfm_oldb
 
ComponentMetricsIfm_metrics
 
std::optional< std::filesystem::path > m_file_path
 
boost::signals2::signal< void(const std::string &, const State &) m_signal )
 

Detailed Description

template<typename DpType>
class rtctk::componentFramework::DataPointRecordingUnit< DpType >

Recording Unit that can record datapoints.

Member Typedef Documentation

◆ CaptureMask

◆ OutputDpType

◆ OutputStageType

◆ TimepointType

template<typename DpType >
using rtctk::componentFramework::DataPointRecordingUnit< DpType >::TimepointType = taiclock::TaiClock::time_point::rep

Constructor & Destructor Documentation

◆ DataPointRecordingUnit()

template<typename DpType >
rtctk::componentFramework::DataPointRecordingUnit< DpType >::DataPointRecordingUnit ( const std::string & comp_id,
const std::string & unit_id,
ServiceContainer & services,
const DataPointPath & dp_path,
DataPointRecordingSource source = DataPointRecordingSource::RUNTIMEREPO,
std::unique_ptr< OutputStageType > && output_stage = {},
std::optional< size_t > fixed_recording_length = std::nullopt )
inline

Create a new recording unit.

Parameters
comp_idname of the component
unit_idname of the recording unit
servicesrequired services
dp_pathof the datapoint that should be recorded
sourceof the datapoint that should be recorded (RUNTIMEREPO or OLDB)
output_stagecustom output stage if required, default is FitsRecorder
fixed_recording_lengthcustom fixed length or retrieve size dynamically (default)

◆ ~DataPointRecordingUnit()

Member Function Documentation

◆ Prepare()

template<typename DpType >
void rtctk::componentFramework::DataPointRecordingUnit< DpType >::Prepare ( const std::filesystem::path & file_path)
inlineoverridevirtual

Prepare the recording.

Parameters
file_pathfile to record to

Implements rtctk::componentFramework::RecordingUnit.

◆ Start()

template<typename DpType >
void rtctk::componentFramework::DataPointRecordingUnit< DpType >::Start ( )
inlineoverridevirtual

Start the recording.

Implements rtctk::componentFramework::RecordingUnit.

◆ Stop()

template<typename DpType >
std::vector< std::filesystem::path > rtctk::componentFramework::DataPointRecordingUnit< DpType >::Stop ( )
inlineoverridevirtual

Stop the recording and wait for it's termination.

Returns
the created files

Implements rtctk::componentFramework::RecordingUnit.

Member Data Documentation

◆ CAPTURE_ON_CHANGE

template<typename DpType >
constexpr uint32_t rtctk::componentFramework::DataPointRecordingUnit< DpType >::CAPTURE_ON_CHANGE = 4
staticconstexpr

◆ CAPTURE_ON_START

template<typename DpType >
constexpr uint32_t rtctk::componentFramework::DataPointRecordingUnit< DpType >::CAPTURE_ON_START = 1
staticconstexpr

◆ CAPTURE_ON_STOP

template<typename DpType >
constexpr uint32_t rtctk::componentFramework::DataPointRecordingUnit< DpType >::CAPTURE_ON_STOP = 2
staticconstexpr

◆ COLUMNS

Initial value:
=
typename OutputStageType::ColumnDescription{{{"timestamp"sv, ""sv}, {"payload"sv, ""sv}}}
const std::array< ColumnMetaData, sizeof...(T)> ColumnDescription
Definition dataRecorder.hpp:49

The documentation for this class was generated from the following file: