Defines a queue with synchronized access. This is a standard data structure that may be used with First-In-First-Out or Last-In-First-Out policies. This is intended for multi-task applications. Use gcgLINKEDLIST if you do not need exclusive accesses in enqueue and dequeue operations.
More...
|
| gcgQUEUE () |
| Constructs a valid and empty queue. More...
|
|
virtual | ~gcgQUEUE () |
| Destroys the queue, releasing the linked list of nodes. After that, it wakes up all threads blocked in waitDequeue(). All entries are deleted. More...
|
|
bool | enqueueTail (gcgLINK *node) |
| Inserts a new entry node at the TAIL of the queue. This entry will be the last to be dequeued. More...
|
|
bool | enqueueHead (gcgLINK *node) |
| Inserts a new entry node at the HEAD of the queue. This entry will be the first to be dequeued. More...
|
|
gcgLINK * | dequeue () |
| Returns the next entry stored in the HEAD of the queue. The entry is removed from the top of the queue. More...
|
|
gcgLINK * | waitDequeue (long timeoutUsec=-1) |
| Returns the HEAD entry of the queue. It is removed from the top of the queue. If the queue is empty, waits for timeoutUsec microseconds. If an entry becomes available during this time, it is returned immediately. If time is out, returns NULL with a GCG_TIMEOUT warning (check GCG_REPORT_MESSAGE(gcgGetReport())). If timeoutUsec is negative, the calling thread is blocked and only returns when an entry is available or an error occurs. More...
|
|
bool | isEmpty () |
| Checks if the queue is empty. More...
|
|
uintptr_t | getCounter () |
| Gets the current number of elements stored in the queue. More...
|
|
bool | deleteAll () |
| Removes all entries from the queue. All objects are deleted. If notification is enabled, calls gcgLOCK::wakeUp(-1) to wake all waiting threads once and after all entries were removed. More...
|
|
gcgLOCK * | wakeUpWhenEnqueued (gcgLOCK *notifyme, int wakeupNumThreads) |
| Sets the gcgLOCK to be used to wake up threads waiting for insertions on this queue. When a entry is added to the queue, gcgQUEUE executes the gcgLOCK::wakeUp() of notifyme, passing wakeupNumThreads as the number of threads to be awaken. This allows asynchronous accesses to the queue. This notification is made by enqueueTail() and enqueueHead(). Only one gcgLOCK instance for enqueuing events is allowed by gcgQUEUE, but the same gcgLOCK instance can be used by several notifying objects. More...
|
|
gcgLOCK * | wakeUpWhenDequeued (gcgLOCK *notifyme, int wakeupNumThreads) |
| Sets the gcgLOCK to be used to wake up threads waiting for removals on this queue. When a entry is removed from the queue, gcgQUEUE executes the gcgLOCK::wakeUp() of notifyme, passing wakeupNumThreads as the number of threads to be awaken. This allows asynchronous accesses to the queue. This notification is made by dequeue(), waitDequeue(), deleteAll() and upon object destruction. The destructor and deleteAll() call notifyme's gcgLOCK::wakeUp(-1) (wakes up all waiting threads) once and after all entries are deleted. Only one dequeuing gcgLOCK instance is allowed by gcgQUEUE, but the same gcgLOCK instance can be used by several notifying objects. More...
|
|
void * | operator new (size_t size) |
| Defines a new operator to be used by instatiations of GCGlib classes instead the global one. More...
|
|
void * | operator new (size_t size, const std::nothrow_t &) throw () |
| Defines a new operator to be used by instantiations of GCGlib classes instead the global one. Returns a NULL pointer instead of throwing an exception if an error occurs. More...
|
|
void * | operator new[] (size_t size) |
| Defines a new operator to be used by GCGlib array allocations instead the global one. More...
|
|
void * | operator new[] (size_t size, const std::nothrow_t &) throw () |
| Defines a new operator to be used by vector allocations instead the global one. More...
|
|
void | operator delete (void *p) |
| Defines a delete operator to free instances of GCGlib classes instead the global one. It is designed to match the new operator. More...
|
|
void | operator delete (void *p, const std::nothrow_t &) throw () |
| Defines a delete operator to free instances of GCGlib classes instead the global one. It is designed to match the new operator. More...
|
|
void | operator delete[] (void *p) |
| Defines a delete operator to free instances of arrays for GCGlib classes instead the global one. It is designed to match the new[] operator. More...
|
|
void | operator delete[] (void *p, const std::nothrow_t &) throw () |
| Defines a delete operator to free instances of arrays for GCGlib classes instead the global one. It is designed to match the new[] operator. More...
|
|
Defines a queue with synchronized access. This is a standard data structure that may be used with First-In-First-Out or Last-In-First-Out policies. This is intended for multi-task applications. Use gcgLINKEDLIST if you do not need exclusive accesses in enqueue and dequeue operations.
- Since
- 0.02.0