ifw-ccf 5.0.2
Loading...
Searching...
No Matches
frameQueue.hpp
Go to the documentation of this file.
1
5#ifndef CCF_COMMON_FRAME_QUEUE_HPP_H_
6#define CCF_COMMON_FRAME_QUEUE_HPP_H_
7
10
11
12namespace ifw::ccf::common {
13
15 class FrameQueue: public Base {
16 public:
17
19 FrameQueue(const std::string& name,
20 const uint16_t nb_of_buffers);
21
23
25 void Reset();
26
28 const std::string& GetName() const;
29
33 void GetFreeFrame(const uint16_t consumers,
34 DataFrame** frame);
35
37 void GetFrame(uint16_t frame_number,
38 DataFrame** frame);
39
41 uint16_t GetNbOfBuffers() const;
42
44 uint16_t GetNbOfFreeBuffers();
45
46 protected:
47
48 private:
49 void Allocate(const uint16_t buffers);
50
51 std::string m_name;
52 std::vector<DataFrame> m_frames;
53 uint16_t m_frame_index;
54
55 std::recursive_mutex m_q_mtx;
56 };
57
58}
59
60#endif // CCF_COMMON_FRAME_QUEUE_HPP_H_
Class to be used as parent all CCF classes.
Definition base.hpp:120
Frame class used to store the data and metadata for one frames received from the camera.
Definition dataFrame.hpp:18
The FrameQueue class implements a queue, to manage a set of CCF DataFrame instances as a ring buffer.
Definition frameQueue.hpp:15
void Reset()
Reset the Frame Queue object. This means in practice to reset/free the DataFrame objects in the queue...
Definition frameQueue.cpp:28
uint16_t GetNbOfFreeBuffers()
Return the number of free buffers in the queue.
Definition frameQueue.cpp:88
uint16_t GetNbOfBuffers() const
Return the number of buffers in the queue.
Definition frameQueue.cpp:83
const std::string & GetName() const
Return the name of the Frame Queue.
Definition frameQueue.cpp:23
void GetFreeFrame(const uint16_t consumers, DataFrame **frame)
Definition frameQueue.cpp:56
~FrameQueue()
Definition frameQueue.cpp:19
void GetFrame(uint16_t frame_number, DataFrame **frame)
Get reference to the given frame number in the queue.
Definition frameQueue.cpp:41
FrameQueue(const std::string &name, const uint16_t nb_of_buffers)
Instantiate a Frame Queue with the given name and the given number of buffers (DataFrame instances).
Definition frameQueue.cpp:11
Definition appBase.cpp:9