FAST  3.2.0
Framework for Heterogeneous Medical Image Computing and Visualization
QueuedDataChannel.hpp
Go to the documentation of this file.
1 #pragma once
2 
4 #include <queue>
5 #include <FAST/Semaphore.hpp>
6 
7 namespace fast {
8 
14 class FAST_EXPORT QueuedDataChannel : public DataChannel {
16  public:
21  void addFrame(DataObject::pointer data) override;
22 
26  int getSize() override;
27 
31  void setMaximumNumberOfFrames(uint frames) override;
32 
36  void stop() override;
37 
38  // TODO consider removing, it is equal to getSize() > 0 atm
39  bool hasCurrentData() override;
40 
44  DataObject::pointer getFrame() override;
45  protected:
46  std::queue<std::shared_ptr<DataObject>> m_queue;
48  std::unique_ptr<LightweightSemaphore> m_fillCount;
49  std::unique_ptr<LightweightSemaphore> m_emptyCount;
50 
51  DataObject::pointer getNextDataFrame() override;
53 
54 };
55 
56 }
fast::QueuedDataChannel::m_queue
std::queue< std::shared_ptr< DataObject > > m_queue
Definition: QueuedDataChannel.hpp:46
fast
Definition: AffineTransformation.hpp:7
fast::QueuedDataChannel
Definition: QueuedDataChannel.hpp:14
Semaphore.hpp
FAST_OBJECT
#define FAST_OBJECT(className)
Definition: Object.hpp:9
fast::QueuedDataChannel::mMaximumNumberOfFrames
uint mMaximumNumberOfFrames
Definition: QueuedDataChannel.hpp:47
fast::DataChannel
Definition: DataChannel.hpp:10
fast::QueuedDataChannel::m_emptyCount
std::unique_ptr< LightweightSemaphore > m_emptyCount
Definition: QueuedDataChannel.hpp:49
DataChannel.hpp
fast::DataObject::pointer
std::shared_ptr< DataObject > pointer
Definition: DataObject.hpp:16
fast::QueuedDataChannel::m_fillCount
std::unique_ptr< LightweightSemaphore > m_fillCount
Definition: QueuedDataChannel.hpp:48
uint
unsigned int uint
Definition: DataTypes.hpp:16