15#pragma warning (disable:4251)
19 class __declspec(dllexport) QueueDestroyableObject {
28 typedef Flags<CleanupFlag> CleanupFlags;
30 QueueDestroyableObject() : m_cleanupFlags(DeleteAtEnd) {};
31 QueueDestroyableObject(CleanupFlag _cleanupFlags) : m_cleanupFlags(_cleanupFlags) {};
32 virtual ~QueueDestroyableObject() {};
34 void setCleanupFlag(CleanupFlag _flag,
bool _active =
true) { m_cleanupFlags.setFlag(_flag, _active); };
35 void setCleanupFlags(
const CleanupFlags& _flags) { m_cleanupFlags = _flags; };
36 const CleanupFlags& cleanupFlags(
void)
const {
return m_cleanupFlags; };
39 CleanupFlags m_cleanupFlags;
41 QueueDestroyableObject(
const QueueDestroyableObject&) =
delete;
42 QueueDestroyableObject& operator = (
const QueueDestroyableObject&) =
delete;
51 class __declspec(dllexport) QueueData :
public QueueDestroyableObject {
53 QueueData(CleanupFlag _cleanupFlags = DeleteAtEnd) : QueueDestroyableObject(_cleanupFlags) {};
54 virtual ~QueueData() {};
58 QueueData(
const QueueData&) =
delete;
59 QueueData& operator = (
const QueueData&) =
delete;
70 class __declspec(dllexport) QueueObject :
public QueueDestroyableObject {
73 enum QueueResultFlag {
82 QueueObject(CleanupFlag _cleanupFlags = DeleteAtEnd) : QueueDestroyableObject(_cleanupFlags) {};
83 virtual ~QueueObject() {};
87 virtual QueueResultFlags activateFromQueue(AbstractQueue* _queue, QueueData* _args) = 0;
90 QueueObject(
const QueueObject&) =
delete;
91 QueueObject& operator = (
const QueueObject&) =
delete;
106 class __declspec(dllexport) AbstractQueue {
109 virtual ~AbstractQueue() {};
114 virtual void queue(QueueObject* _obj, QueueData * _args = (QueueData *)
nullptr)
noexcept = 0;
119 virtual void queueNext(QueueObject* _obj, QueueData* _args = (QueueData*)
nullptr)
noexcept = 0;
122 virtual bool executeQueue(
void) = 0;
125 AbstractQueue(
const AbstractQueue&) =
delete;
126 AbstractQueue& operator = (
const AbstractQueue&) =
delete;
143 virtual void queue(QueueObject* _obj, QueueData* _arg = (QueueData*)
nullptr)
noexcept override;
148 virtual void queueNext(QueueObject* _obj, QueueData* _arg = (QueueData*)
nullptr)
noexcept override;
151 virtual bool executeQueue(
void)
override;
154 void clearQueue(
void);
160 void checkAndDestroy(QueueDestroyableObject* _obj);
163 void clearGarbage(
void);
165 std::list<std::pair<QueueObject*, QueueData*>> m_queue;
166 std::list<std::pair<QueueDestroyableObject*, bool>> m_garbage;
167 unsigned int m_garbageCounter;
#define OT_CORE_API_EXPORT
Dll import.
Definition CoreAPIExport.h:8
#define OT_ADD_FLAG_FUNCTIONS(___enumName)
Will add the default bitwise operations for the provided private 32/64 bit bitfield....
Definition Flags.h:129
The Flags class is a wrapper around a enum that allows bitwise operations (flags)....
Definition Flags.h:214