Roomba App  1.0
frameBuffer.hh
Go to the documentation of this file.
1 
12 #ifndef FRAMEBUFFER_HH
13 #define FRAMEBUFFER_HH
14 
15 #include <list>
16 #include <mutex>
17 #include <string>
18 #include <thread>
19 
24 {
28  std::list<std::string> _frameList;
29 
33  mutable std::mutex _access;
34 
35  public:
39  FrameBuffer();
40 
44  ~FrameBuffer();
45 
50  void addFrame(const std::string& frame);
51 
59  bool getFrame(std::string& frame);
60 
67  bool isFrame() const;
68 };
69 
70 #endif // FRAMEBUFFER_HH
The FrameBuffer class.
Definition: frameBuffer.hh:24
bool isFrame() const
Check if list contain any frame.
Definition: frameBuffer.cpp:45
FrameBuffer()
Construct new FrameBuffer object.
Definition: frameBuffer.cpp:18
std::list< std::string > _frameList
List containing individual frames.
Definition: frameBuffer.hh:28
std::mutex _access
Mutex that provides single access to the list.
Definition: frameBuffer.hh:33
void addFrame(const std::string &frame)
Add one frame to the end of the list.
Definition: frameBuffer.cpp:22
~FrameBuffer()
Desctruct FrameBuffer object.
Definition: frameBuffer.cpp:20
bool getFrame(std::string &frame)
Get one frame from the top of the list.
Definition: frameBuffer.cpp:33