ifw-ccf  1.0.0
utilities.hpp
Go to the documentation of this file.
1 
5 #ifndef CCF_COMMON_UTILITIES_HPP_H_
6 #define CCF_COMMON_UTILITIES_HPP_H_
7 
8 #include <string>
9 
10 #include <ctd/param/ParameterSet.hpp>
11 
12 namespace ccf::common {
13 
15  std::string GetImageDir();
16 
18  std::string PackParameters(const ctd::param::ParameterSet& parameters);
19 
21  void UnpackParameters(const std::string& parameters,
22  ctd::param::ParameterSet& par_set);
23 
26  public:
29 
31  void Reset();
32 
34  void SetNbOfSamples(const uint16_t nb);
35 
38  void UpdateFrStat(const double fr_recv_timestamp,
39  const double fr_handling_time,
40  const uint32_t fr_size);
41 
43  void SetLostFramesCounter(const uint64_t lost_frames);
44 
46  uint64_t IncSkippedFramesCounter();
47 
49  void GetDataSnapshot(FrameStatistics& trg_obj) const;
50 
52  std::string GetId() const;
53 
55  uint16_t GetNbOfSamples() const;
56 
58  double GetStartTime() const;
59 
61  double GetLastUpdate() const;
62 
64  double GetTimeFirstFrame() const;
65 
67  uint64_t GetFrameCount() const;
68 
70  uint64_t GetVolume() const;
71 
73  uint64_t GetSkippedFrames() const;
74 
76  uint64_t GetLostFrames() const;
77 
79  const std::vector<double>& GetFrRecvTimestamps() const;
80 
82  const std::vector<uint64_t>& GetFrRecvFrCounts() const;
83 
85  const std::vector<double>& GetFrHandlingTimes() const;
86 
88 
89  protected:
90  std::string p_id;
91  uint16_t p_nb_samples;
92 
93  double p_start_time;
94  double p_last_update;
95  uint64_t p_frame_count;
96  uint64_t p_volume;
97  uint64_t p_lost_frames;
98  uint64_t p_skipped_frames;
99  std::vector<double> p_fr_recv_timestamps;
101  std::vector<uint64_t> p_fr_recv_fr_counts;
102  std::vector<double> p_fr_handling_times;
103 
104  private:
105 
106  };
107 
108 }
109 
110 #endif // CCF_COMMON_UTILITIES_HPP_H_
ccf::common::FrameStatistics::p_last_update
double p_last_update
Definition: utilities.hpp:94
ccf::common::FrameStatistics::GetStartTime
double GetStartTime() const
Get the start time for the recording.
Definition: utilities.cpp:163
ccf::common::FrameStatistics::GetFrRecvTimestamps
const std::vector< double > & GetFrRecvTimestamps() const
Get a vector with the timestamps for receiving the frames.
Definition: utilities.cpp:183
ccf::common::FrameStatistics::GetFrameCount
uint64_t GetFrameCount() const
Get the number of frames handled.
Definition: utilities.cpp:173
ccf::common::FrameStatistics::p_volume
uint64_t p_volume
Definition: utilities.hpp:96
ccf::common::FrameStatistics::p_start_time
double p_start_time
Definition: utilities.hpp:93
ccf::common::PackParameters
std::string PackParameters(const ctd::param::ParameterSet &parameters)
Serialise the parameters contained in the parameter set.
Definition: utilities.cpp:39
ccf::common::FrameStatistics::SetLostFramesCounter
void SetLostFramesCounter(const uint64_t lost_frames)
Set the lost frames counter.
Definition: utilities.cpp:234
ccf::common::FrameStatistics::GetVolume
uint64_t GetVolume() const
Get the volume (in bytes) of the frames handled.
Definition: utilities.cpp:178
ccf::common::FrameStatistics::SetNbOfSamples
void SetNbOfSamples(const uint16_t nb)
Set the number of samples to keep in the sliding window.
Definition: utilities.cpp:111
ccf::common::FrameStatistics::p_skipped_frames
uint64_t p_skipped_frames
Definition: utilities.hpp:98
ccf::common::FrameStatistics::p_fr_recv_fr_counts
std::vector< uint64_t > p_fr_recv_fr_counts
Definition: utilities.hpp:101
ccf::common::FrameStatistics::GetLastUpdate
double GetLastUpdate() const
Get the time for the last update of the samples.
Definition: utilities.cpp:168
ccf::common::FrameStatistics::p_frame_count
uint64_t p_frame_count
Definition: utilities.hpp:95
ccf::common::FrameStatistics::p_first_recv_time
double p_first_recv_time
Definition: utilities.hpp:100
ccf::common::FrameStatistics::FrameStatistics
FrameStatistics()
Definition: utilities.cpp:84
ccf::common::GetImageDir
std::string GetImageDir()
Get the name of the image output folder.
Definition: utilities.cpp:15
ccf::common::FrameStatistics::GetTimeFirstFrame
double GetTimeFirstFrame() const
Get the time stamp of the first frame status registered.
Definition: utilities.cpp:148
ccf::common::FrameStatistics::GetSkippedFrames
uint64_t GetSkippedFrames() const
Get the number of skipped frames.
Definition: utilities.cpp:248
ccf::common::FrameStatistics::GetFrRecvFrCounts
const std::vector< uint64_t > & GetFrRecvFrCounts() const
Get the frame counts of each frame for which data is stored in the object.
Definition: utilities.cpp:188
ccf::common::FrameStatistics::operator=
FrameStatistics & operator=(const FrameStatistics &source)
Definition: utilities.cpp:216
ccf::common::FrameStatistics::~FrameStatistics
~FrameStatistics()
Definition: utilities.cpp:89
ccf::common::FrameStatistics::p_id
std::string p_id
Definition: utilities.hpp:90
ccf::common::FrameStatistics::IncSkippedFramesCounter
uint64_t IncSkippedFramesCounter()
Increment the frames handled counter.
Definition: utilities.cpp:241
ccf::common::FrameStatistics::GetLostFrames
uint64_t GetLostFrames() const
Get the number of lost frames.
Definition: utilities.cpp:253
ccf::common::FrameStatistics::p_fr_recv_timestamps
std::vector< double > p_fr_recv_timestamps
Definition: utilities.hpp:99
ccf::common
Definition: appBase.cpp:8
ccf::common::FrameStatistics::GetNbOfSamples
uint16_t GetNbOfSamples() const
Get the number of samples used in the sliding window.
Definition: utilities.cpp:158
ccf::common::FrameStatistics::GetId
std::string GetId() const
Get the ID of the object.
Definition: utilities.cpp:153
ccf::common::FrameStatistics
Class used by the threads to store info for generating performance statistics.
Definition: utilities.hpp:25
ccf::common::FrameStatistics::p_nb_samples
uint16_t p_nb_samples
Definition: utilities.hpp:91
ccf::common::FrameStatistics::p_lost_frames
uint64_t p_lost_frames
Definition: utilities.hpp:97
ccf::common::FrameStatistics::UpdateFrStat
void UpdateFrStat(const double fr_recv_timestamp, const double fr_handling_time, const uint32_t fr_size)
Definition: utilities.cpp:126
ccf::common::FrameStatistics::Reset
void Reset()
Reset the frame statistics object.
Definition: utilities.cpp:93
ccf::common::UnpackParameters
void UnpackParameters(const std::string &parameters, ctd::param::ParameterSet &par_set)
Unpacke the serialised parameters and store the information in the provided parameter set object.
Definition: utilities.cpp:66
ccf::common::FrameStatistics::GetFrHandlingTimes
const std::vector< double > & GetFrHandlingTimes() const
Get vector with the timestamp for handling the frames.
Definition: utilities.cpp:193
ccf::common::FrameStatistics::p_fr_handling_times
std::vector< double > p_fr_handling_times
Definition: utilities.hpp:102
ccf::common::FrameStatistics::GetDataSnapshot
void GetDataSnapshot(FrameStatistics &trg_obj) const
Get a snapshot of the data in the object.
Definition: utilities.cpp:198