ifw-ccf  2.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 <core/utils/param/parameterSet.hpp>
11 
12 namespace ccf::common {
13 
15  std::string GetImageDir();
16 
18  std::string PackParameters(const core::utils::param::ParameterSet& parameters);
19 
21  void UnpackParameters(const std::string& parameters,
22  core::utils::param::ParameterSet& par_set);
23 
26  public:
29 
31  void Reset();
32 
34  void SetNbOfSamples(const uint16_t nb);
35 
38  void Update(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  std::string ToString() const;
89 
91 
92  protected:
93  std::string p_id;
94  uint16_t p_nb_samples;
95 
96  double p_start_time;
97  double p_last_update;
98  uint64_t p_frame_count;
99  uint64_t p_volume;
100  uint64_t p_lost_frames;
102  std::vector<double> p_fr_recv_timestamps;
104  std::vector<uint64_t> p_fr_recv_fr_counts;
105  std::vector<double> p_fr_handling_times;
106 
107  private:
108 
109  };
110 
111 }
112 
113 #endif // CCF_COMMON_UTILITIES_HPP_H_
ccf::common::FrameStatistics::p_last_update
double p_last_update
Definition: utilities.hpp:97
ccf::common::FrameStatistics::GetStartTime
double GetStartTime() const
Get the start time for the recording.
Definition: utilities.cpp:147
ccf::common::FrameStatistics::GetFrRecvTimestamps
const std::vector< double > & GetFrRecvTimestamps() const
Get a vector with the timestamps for receiving the frames.
Definition: utilities.cpp:167
ccf::common::PackParameters
std::string PackParameters(const core::utils::param::ParameterSet &parameters)
Serialise the parameters contained in the parameter set.
Definition: utilities.cpp:40
ccf::common::FrameStatistics::GetFrameCount
uint64_t GetFrameCount() const
Get the number of frames handled.
Definition: utilities.cpp:157
ccf::common::FrameStatistics::p_volume
uint64_t p_volume
Definition: utilities.hpp:99
ccf::common::FrameStatistics::p_start_time
double p_start_time
Definition: utilities.hpp:96
ccf::common::FrameStatistics::SetLostFramesCounter
void SetLostFramesCounter(const uint64_t lost_frames)
Set the lost frames counter.
Definition: utilities.cpp:218
ccf::common::FrameStatistics::GetVolume
uint64_t GetVolume() const
Get the volume (in bytes) of the frames handled.
Definition: utilities.cpp:162
ccf::common::FrameStatistics::SetNbOfSamples
void SetNbOfSamples(const uint16_t nb)
Set the number of samples to keep in the sliding window.
Definition: utilities.cpp:95
ccf::common::FrameStatistics::p_skipped_frames
uint64_t p_skipped_frames
Definition: utilities.hpp:101
ccf::common::FrameStatistics::p_fr_recv_fr_counts
std::vector< uint64_t > p_fr_recv_fr_counts
Definition: utilities.hpp:104
ccf::common::FrameStatistics::GetLastUpdate
double GetLastUpdate() const
Get the time for the last update of the samples.
Definition: utilities.cpp:152
ccf::common::FrameStatistics::ToString
std::string ToString() const
Generate a string summery of the contents of the object.
Definition: utilities.cpp:242
ccf::common::FrameStatistics::p_frame_count
uint64_t p_frame_count
Definition: utilities.hpp:98
ccf::common::FrameStatistics::Update
void Update(const double fr_recv_timestamp, const double fr_handling_time, const uint32_t fr_size)
Definition: utilities.cpp:110
ccf::common::FrameStatistics::p_first_recv_time
double p_first_recv_time
Definition: utilities.hpp:103
ccf::common::FrameStatistics::FrameStatistics
FrameStatistics()
Definition: utilities.cpp:68
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:132
ccf::common::FrameStatistics::GetSkippedFrames
uint64_t GetSkippedFrames() const
Get the number of skipped frames.
Definition: utilities.cpp:232
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:172
ccf::common::FrameStatistics::operator=
FrameStatistics & operator=(const FrameStatistics &source)
Definition: utilities.cpp:200
ccf::common::FrameStatistics::~FrameStatistics
~FrameStatistics()
Definition: utilities.cpp:73
ccf::common::FrameStatistics::p_id
std::string p_id
Definition: utilities.hpp:93
ccf::common::FrameStatistics::IncSkippedFramesCounter
uint64_t IncSkippedFramesCounter()
Increment the frames handled counter.
Definition: utilities.cpp:225
ccf::common::FrameStatistics::GetLostFrames
uint64_t GetLostFrames() const
Get the number of lost frames.
Definition: utilities.cpp:237
ccf::common::FrameStatistics::p_fr_recv_timestamps
std::vector< double > p_fr_recv_timestamps
Definition: utilities.hpp:102
ccf::common
Definition: appBase.cpp:8
ccf::common::UnpackParameters
void UnpackParameters(const std::string &parameters, core::utils::param::ParameterSet &par_set)
Unpacke the serialised parameters and store the information in the provided parameter set object.
Definition: utilities.cpp:51
ccf::common::FrameStatistics::GetNbOfSamples
uint16_t GetNbOfSamples() const
Get the number of samples used in the sliding window.
Definition: utilities.cpp:142
ccf::common::FrameStatistics::GetId
std::string GetId() const
Get the ID of the object.
Definition: utilities.cpp:137
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:94
ccf::common::FrameStatistics::p_lost_frames
uint64_t p_lost_frames
Definition: utilities.hpp:100
ccf::common::FrameStatistics::Reset
void Reset()
Reset the frame statistics object.
Definition: utilities.cpp:77
ccf::common::FrameStatistics::GetFrHandlingTimes
const std::vector< double > & GetFrHandlingTimes() const
Get vector with the timestamp for handling the frames.
Definition: utilities.cpp:177
ccf::common::FrameStatistics::p_fr_handling_times
std::vector< double > p_fr_handling_times
Definition: utilities.hpp:105
ccf::common::FrameStatistics::GetDataSnapshot
void GetDataSnapshot(FrameStatistics &trg_obj) const
Get a snapshot of the data in the object.
Definition: utilities.cpp:182