ifw-ccf 4.0.0
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
8#include <ccf/common/base.hpp>
10
11namespace ccf::common {
12
14 class FrameQueue: public Base {
15 public:
16
18 FrameQueue(const std::string& name,
19 const uint16_t nb_of_buffers);
20
22
24 void Reset();
25
27 const std::string& GetName() const;
28
32 void GetFreeFrame(const uint16_t consumers,
33 DataFrame** frame);
34
36 void GetFrame(uint16_t frame_number,
37 DataFrame** frame);
38
40 uint16_t GetNbOfBuffers() const;
41
43 uint16_t GetNbOfFreeBuffers();
44
45 protected:
46
47 private:
48 void Allocate(const uint16_t buffers);
49
50 std::string m_name;
51 std::vector<DataFrame> m_frames;
52 uint16_t m_frame_index;
53 };
54
55}
56
57#endif // CCF_COMMON_FRAME_QUEUE_HPP_H_
Class to be used as parent all CCF classes.
Definition: base.hpp:107
Frame class used to store the data and metadata for one frames received from the camera.
Definition: dataFrame.hpp:17
The FrameQueue class implements a queue, to manage a set of CCF DataFrame instances as a ring buffer.
Definition: frameQueue.hpp:14
void GetFreeFrame(const uint16_t consumers, DataFrame **frame)
Definition: frameQueue.cpp:52
void Reset()
Reset the Frame Queue object. This means in practice to reset/free the DataFrame objects in the queue...
Definition: frameQueue.cpp:27
uint16_t GetNbOfFreeBuffers()
Return the number of free buffers in the queue.
Definition: frameQueue.cpp:83
uint16_t GetNbOfBuffers() const
Return the number of buffers in the queue.
Definition: frameQueue.cpp:78
const std::string & GetName() const
Return the name of the Frame Queue.
Definition: frameQueue.cpp:22
void GetFrame(uint16_t frame_number, DataFrame **frame)
Get reference to the given frame number in the queue.
Definition: frameQueue.cpp:38
~FrameQueue()
Definition: frameQueue.cpp:18
Definition: appBase.cpp:8