123456789101112131415161718192021222324252627282930 |
- #pragma once
- #include <ReferenceCounter.h>
- #include <Array.h>
- #include <condition_variable>
- class Block;
- class TickQueue : public virtual Framework::ReferenceCounter
- {
- private:
- int maxSize;
- int readPosition;
- int writePosition;
- Block** queue;
- std::mutex mutex;
- std::condition_variable hasBlocks;
- std::condition_variable hasNoBlocks;
- bool exit;
- public:
- TickQueue();
- ~TickQueue();
- void startNextTick( Framework::Array<Block*>* zSources );
- void addToQueue( Block* zBlock );
- Block* zNextBlock( bool& waiting );
- void requestExit();
- void waitForEmpty();
- };
|