32#ifndef _QORE_QOREQUEUE_H
34#define _QORE_QOREQUEUE_H
36#include <qore/QoreThreadLock.h>
37#include <qore/QoreCondition.h>
41class qore_queue_private;
44 friend class qore_queue_private;
47 qore_queue_private* priv;
51 DLLEXPORT QoreQueue(
int n_max = -1);
54 DLLEXPORT QoreQueue(
const QoreQueue& orig);
59 DLLEXPORT ~QoreQueue();
62 DLLEXPORT
void pushAndTakeRef(QoreValue n);
65 DLLEXPORT
void push(ExceptionSink* xsink, QoreValue n,
int timeout_ms = 0,
bool* to = 0);
68 DLLEXPORT
void insert(ExceptionSink* xsink, QoreValue n,
int timeout_ms = 0,
bool* to = 0);
74 DLLEXPORT
void push(ExceptionSink* xsink, QoreObject* self, QoreValue n,
int timeout_ms = 0,
bool* to =
nullptr);
80 DLLEXPORT
void insert(ExceptionSink* xsink, QoreObject* self, QoreValue n,
int timeout_ms = 0,
bool* to =
nullptr);
83 DLLEXPORT QoreValue shift(ExceptionSink* xsink,
int timeout_ms = 0,
bool* to =
nullptr);
86 DLLEXPORT QoreValue pop(ExceptionSink* xsink,
int timeout_ms = 0,
bool* to =
nullptr);
92 DLLEXPORT QoreValue shift(ExceptionSink* xsink, QoreObject* self,
int timeout_ms = 0,
bool* to =
nullptr);
98 DLLEXPORT QoreValue pop(ExceptionSink* xsink, QoreObject* self,
int timeout_ms = 0,
bool* to =
nullptr);
101 DLLEXPORT
bool empty()
const;
104 DLLEXPORT
size_t size()
const;
107 DLLEXPORT ptrdiff_t getMax()
const;
110 DLLEXPORT
size_t getReadWaiting()
const;
113 DLLEXPORT
size_t getWriteWaiting()
const;
116 DLLEXPORT
void clear(ExceptionSink* xsink);
122 DLLEXPORT
void clear(ExceptionSink* xsink, QoreObject* self);
129 DLLEXPORT
void setError(
const char* err,
const QoreStringNode* desc, ExceptionSink* xsink);
136 DLLEXPORT
void setError(
const char* err,
const QoreStringNode* desc, QoreObject* self, ExceptionSink* xsink);
142 DLLEXPORT
void clearError();
147 DLLEXPORT
virtual ~Queue();
150 DLLEXPORT Queue(
int max = -1);
152 DLLEXPORT Queue(
const Queue& old);
154 DLLEXPORT Queue* queueRefSelf()
const;
156 DLLEXPORT
virtual void deref(ExceptionSink* xsink);
the base class for all data to be used as private data of Qore objects
Definition AbstractPrivateData.h:44
virtual DLLLOCAL void deref()
decrements the reference count of the object without the possibility of throwing a Qore-language exce...
Definition AbstractPrivateData.h:65