RTC Toolkit 5.1.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
rtctk::componentFramework::DynamicDataPointRecordingUnit Class Reference

Recording unit that takes datapoints from RuntimeRepo path "/component_id/dynamic/rec_units/unit_id/datapoint_list" in the format "oldb:..." or "rtr:..." and creates internal DataPointRecordingUnits that record the given paths. More...

#include <dynamicDataPointRecordingUnit.hpp>

Inheritance diagram for rtctk::componentFramework::DynamicDataPointRecordingUnit:
rtctk::componentFramework::RecordingUnit

Public Types

using DataRecorderFactory = std::function<void*(std::type_index)>
 
- Public Types inherited from rtctk::componentFramework::RecordingUnit
enum class  State : uint8_t {
  STOPPED , PREPARING , IDLE , WAITING ,
  RUNNING , FINISHED , FAILED
}
 

Public Member Functions

 DynamicDataPointRecordingUnit (const std::string &comp_id, const std::string &unit_id, ServiceContainer &services, std::function< void *(std::type_index)> recorder_factory=&FitsDataRecorderFactory)
 
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.
 
void Update () override
 Update dynamic settings.
 
void CheckErrors () override
 Check for Errors, will rethrow errors thrown in the recorder.
 
virtual ~DynamicDataPointRecordingUnit ()
 
- 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.
 
boost::signals2::connection Connect (const std::function< void(const std::string &, const State &)> &function)
 Connect to State change signal.
 

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

Recording unit that takes datapoints from RuntimeRepo path "/component_id/dynamic/rec_units/unit_id/datapoint_list" in the format "oldb:..." or "rtr:..." and creates internal DataPointRecordingUnits that record the given paths.

Member Typedef Documentation

◆ DataRecorderFactory

Constructor & Destructor Documentation

◆ DynamicDataPointRecordingUnit()

rtctk::componentFramework::DynamicDataPointRecordingUnit::DynamicDataPointRecordingUnit ( const std::string & comp_id,
const std::string & unit_id,
ServiceContainer & services,
std::function< void *(std::type_index)> recorder_factory = &FitsDataRecorderFactory )
Parameters
comp_idname of the component
unit_idname of the recording unit
servicesService container to get OLDB and RTR
recorder_factoryfactory that returns a recorder for a DataPointRecordingUnit for the given type

◆ ~DynamicDataPointRecordingUnit()

rtctk::componentFramework::DynamicDataPointRecordingUnit::~DynamicDataPointRecordingUnit ( )
virtual

Member Function Documentation

◆ CheckErrors()

void rtctk::componentFramework::DynamicDataPointRecordingUnit::CheckErrors ( )
overridevirtual

Check for Errors, will rethrow errors thrown in the recorder.

Reimplemented from rtctk::componentFramework::RecordingUnit.

◆ Prepare()

void rtctk::componentFramework::DynamicDataPointRecordingUnit::Prepare ( const std::filesystem::path & file_path)
overridevirtual

Prepare the recording.

Parameters
file_pathfile path where the data should be recorded

Implements rtctk::componentFramework::RecordingUnit.

◆ Start()

void rtctk::componentFramework::DynamicDataPointRecordingUnit::Start ( )
overridevirtual

Start the recording.

Implements rtctk::componentFramework::RecordingUnit.

◆ Stop()

std::vector< std::filesystem::path > rtctk::componentFramework::DynamicDataPointRecordingUnit::Stop ( )
overridevirtual

Stop the recording and wait for it's termination.

Returns
file that was recorded

Implements rtctk::componentFramework::RecordingUnit.

◆ Update()

void rtctk::componentFramework::DynamicDataPointRecordingUnit::Update ( )
overridevirtual

Update dynamic settings.

Reimplemented from rtctk::componentFramework::RecordingUnit.


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