#include <QueueManager.hpp>
Public Member Functions | |
DataQueue (const char *ds, int di) | |
DataQueue (SessionID s, const char *ds, int di) | |
DataQueue (const char *name, const char *ds, int di) | |
~DataQueue () | |
void | setName (const char *name) |
void | add (ServiceMessage &message) |
void | addLifo (QueueItem *item) |
void | addFifo (QueueItem *item) |
void | clear () |
QueueItem * | getFirst () |
void | addWaiter () |
void | removeWaiter () |
void | checkWaiters () |
void | waitForData () |
bool | hasWaiters () |
void | pull (ServerQueueManager *manager, ServiceMessage &message) |
bool | pullData (ServerQueueManager *manager, ServiceMessage &message) |
void | addReference () |
size_t | removeReference () |
bool | hasReferences () |
void | init () |
size_t | getItemCount () |
Protected Attributes | |
DataQueue * | next |
size_t | itemCount |
size_t | waiters |
size_t | references |
SysSemaphore | waitSem |
QueueItem * | firstItem |
QueueItem * | lastItem |
const char * | queueName |
SessionID | session |
const char * | dbgds |
int | dbgdi |
Friends | |
class | QueueTable |
Definition at line 90 of file QueueManager.hpp.
|
inline |
Definition at line 94 of file QueueManager.hpp.
References init().
|
inline |
Definition at line 99 of file QueueManager.hpp.
|
inline |
Definition at line 105 of file QueueManager.hpp.
DataQueue::~DataQueue | ( | ) |
Perform cleanup for a delete data queue.
Definition at line 69 of file QueueManager.cpp.
References clear(), SysSemaphore::close(), queueName, and waitSem.
void DataQueue::add | ( | ServiceMessage & | message | ) |
Process a queue add operation.
message | The service message for the add operation. |
Definition at line 103 of file QueueManager.cpp.
References addFifo(), addLifo(), ServiceMessage::clearMessageData(), ServiceMessage::getMessageData(), ServiceMessage::parameter1, ServiceMessage::parameter2, QUEUE_ITEM_ADDED, QUEUE_LIFO, and ServiceMessage::setResult().
Referenced by ServerQueueManager::addToNamedQueue(), and ServerQueueManager::addToSessionQueue().
void DataQueue::addFifo | ( | QueueItem * | item | ) |
Add an item to the queue in FIFO order.
item | The item to add. |
Definition at line 147 of file QueueManager.cpp.
References checkWaiters(), firstItem, itemCount, lastItem, and QueueItem::next.
Referenced by add().
void DataQueue::addLifo | ( | QueueItem * | item | ) |
Add an item to a queue in LIFO order.
item | The item to add. |
Definition at line 129 of file QueueManager.cpp.
References checkWaiters(), firstItem, itemCount, lastItem, and QueueItem::next.
Referenced by add().
|
inline |
Definition at line 157 of file QueueManager.hpp.
References references.
Referenced by ServerQueueManager::createSessionQueue().
|
inline |
|
inline |
Definition at line 136 of file QueueManager.hpp.
References SysSemaphore::post(), waiters, and waitSem.
void DataQueue::clear | ( | ) |
Clear all entries from the data queue.
Definition at line 82 of file QueueManager.cpp.
References firstItem, itemCount, lastItem, and QueueItem::next.
Referenced by ServerQueueManager::clearNamedQueue(), ServerQueueManager::clearSessionQueue(), and ~DataQueue().
QueueItem * DataQueue::getFirst | ( | ) |
Pull the first item off the queue.
Definition at line 171 of file QueueManager.cpp.
References firstItem, itemCount, lastItem, and QueueItem::next.
Referenced by pullData().
|
inline |
Definition at line 174 of file QueueManager.hpp.
References itemCount.
Referenced by ServerQueueManager::getNamedQueueCount().
|
inline |
Definition at line 159 of file QueueManager.hpp.
References references.
|
inline |
Definition at line 149 of file QueueManager.hpp.
References waiters.
Referenced by ServerQueueManager::deleteNamedQueue(), and ServerQueueManager::deleteSessionQueue().
|
inline |
Definition at line 161 of file QueueManager.hpp.
References SysSemaphore::create(), firstItem, itemCount, lastItem, next, queueName, references, session, waiters, and waitSem.
Referenced by DataQueue().
void DataQueue::pull | ( | ServerQueueManager * | manager, |
ServiceMessage & | message | ||
) |
Pull an item from the front of the queue.
message | The message from the client. |
Definition at line 236 of file QueueManager.cpp.
References addWaiter(), if(), ServerQueueManager::lock, ServiceMessage::parameter1, pullData(), QUEUE_EMPTY, QUEUE_WAIT_FOR_DATA, removeWaiter(), ServiceMessage::setResult(), and waitForData().
Referenced by ServerQueueManager::pullFromNamedQueue(), and ServerQueueManager::pullFromSessionQueue().
bool DataQueue::pullData | ( | ServerQueueManager * | manager, |
ServiceMessage & | message | ||
) |
Attempt to pull data from a data queue and attach it to a return message.
message | The message being processed. |
Definition at line 196 of file QueueManager.cpp.
References QueueItem::addTime, QueueItem::clear(), QueueItem::elementData, getFirst(), ServerQueueManager::lock, ServiceMessage::nameArg, ServiceMessage::parameter1, QUEUE_ITEM_PULLED, SysSemaphore::reset(), ServiceMessage::retainMessageData, ServiceMessage::setMessageData(), ServiceMessage::setResult(), QueueItem::size, and waitSem.
Referenced by pull().
|
inline |
Definition at line 158 of file QueueManager.hpp.
References references.
Referenced by ServerQueueManager::deleteSessionQueue().
|
inline |
|
inline |
Definition at line 113 of file QueueManager.hpp.
References dupString(), and queueName.
Referenced by ServerQueueManager::createUniqueQueue(), and DataQueue().
|
inline |
Definition at line 144 of file QueueManager.hpp.
References dbgdi, dbgds, SysSemaphore::wait(), and waitSem.
Referenced by pull().
|
friend |
Definition at line 92 of file QueueManager.hpp.
|
protected |
Definition at line 188 of file QueueManager.hpp.
Referenced by waitForData().
|
protected |
Definition at line 187 of file QueueManager.hpp.
Referenced by waitForData().
|
protected |
Definition at line 183 of file QueueManager.hpp.
Referenced by addFifo(), addLifo(), clear(), getFirst(), and init().
|
protected |
Definition at line 179 of file QueueManager.hpp.
Referenced by addFifo(), addLifo(), clear(), getFirst(), getItemCount(), and init().
|
protected |
Definition at line 184 of file QueueManager.hpp.
Referenced by addFifo(), addLifo(), clear(), getFirst(), and init().
|
protected |
Definition at line 178 of file QueueManager.hpp.
Referenced by QueueTable::add(), init(), QueueTable::locate(), QueueTable::remove(), and QueueTable::removeQueue().
|
protected |
Definition at line 185 of file QueueManager.hpp.
Referenced by init(), QueueTable::locate(), QueueTable::remove(), setName(), and ~DataQueue().
|
protected |
Definition at line 181 of file QueueManager.hpp.
Referenced by addReference(), hasReferences(), init(), and removeReference().
|
protected |
Definition at line 186 of file QueueManager.hpp.
Referenced by DataQueue(), init(), QueueTable::locate(), and QueueTable::remove().
|
protected |
Definition at line 180 of file QueueManager.hpp.
Referenced by addWaiter(), checkWaiters(), hasWaiters(), init(), and removeWaiter().
|
protected |
Definition at line 182 of file QueueManager.hpp.
Referenced by checkWaiters(), init(), pullData(), waitForData(), and ~DataQueue().