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