#include <queuedReturn.h>
Public Member Functions | |
void | set_max_queue_size (int max_size) |
Sets the maximum size the queue is allowed to grow to. | |
int | get_max_queue_size () const |
Returns the maximum size the queue is allowed to grow to. | |
int | get_current_queue_size () const |
Returns the current number of things in the queue. | |
Protected Member Functions | |
QueuedReturn () | |
~QueuedReturn () | |
bool | thing_available () const |
Returns true if a thing is available on the queue; call get_thing() to extract the thing. | |
bool | get_thing (Thing &thing) |
If a previous call to thing_available() returned true, this function will return the thing that has become available. | |
bool | enqueue_thing (const Thing &thing) |
Adds a new thing to the queue for later retrieval. | |
bool | enqueue_unique_thing (const Thing &thing) |
The same as enqueue_thing(), except the queue is first checked that it doesn't already have something like thing. | |
Private Attributes | |
PRLock * | _mutex |
pdeque< Thing > | _things |
bool | _available |
int | _max_queue_size |
Definition at line 48 of file queuedReturn.h.
|
Definition at line 98 of file queuedReturn.I. References QueuedReturn< Thing >::_available, and INLINE. |
|
Definition at line 113 of file queuedReturn.I. References QueuedReturn< Thing >::_available, QueuedReturn< Thing >::_mutex, and QueuedReturn< Thing >::_things. |
|
Adds a new thing to the queue for later retrieval. Returns true if successful, false if the queue is full (i.e. has reached _max_queue_size). Definition at line 189 of file queuedReturn.I. |
|
The same as enqueue_thing(), except the queue is first checked that it doesn't already have something like thing. The return value is true if the enqueue operation was successful, false if the queue was full or the thing was already on the queue. Definition at line 219 of file queuedReturn.I. |
|
Returns the current number of things in the queue.
Definition at line 82 of file queuedReturn.I. References QueuedReturn< Thing >::_mutex. |
|
Returns the maximum size the queue is allowed to grow to. See set_max_queue_size(). Definition at line 68 of file queuedReturn.I. References QueuedReturn< Thing >::_available, QueuedReturn< Thing >::_max_queue_size, QueuedReturn< Thing >::_mutex, and get_net_max_response_queue(). |
|
If a previous call to thing_available() returned true, this function will return the thing that has become available. The return value is true if a thing was successfully returned, or false if there was, in fact, no thing available. (This may happen if there are multiple threads accessing the QueuedReturn). Definition at line 159 of file queuedReturn.I. References QueuedReturn< Thing >::_available, QueuedReturn< Thing >::_max_queue_size, QueuedReturn< Thing >::_mutex, and QueuedReturn< Thing >::_things. |
|
Sets the maximum size the queue is allowed to grow to. This is primarily for a sanity check; this is a limit beyond which we can assume something bad has happened. It's also a crude check against unfortunate seg faults due to the queue filling up and quietly consuming all available memory. Definition at line 50 of file queuedReturn.I. References QueuedReturn< Thing >::_max_queue_size. |
|
Returns true if a thing is available on the queue; call get_thing() to extract the thing.
Definition at line 129 of file queuedReturn.I. References QueuedReturn< Thing >::_available, and QueuedReturn< Thing >::_things. |
|
|
Definition at line 68 of file queuedReturn.h. Referenced by QueuedReturn< Thing >::get_max_queue_size(), QueuedReturn< Thing >::get_thing(), and QueuedReturn< Thing >::set_max_queue_size(). |
|
Definition at line 65 of file queuedReturn.h. Referenced by QueuedReturn< Thing >::get_current_queue_size(), QueuedReturn< Thing >::get_max_queue_size(), QueuedReturn< Thing >::get_thing(), RecentConnectionReader::RecentConnectionReader(), and QueuedReturn< Thing >::~QueuedReturn(). |
|
Definition at line 66 of file queuedReturn.h. Referenced by QueuedReturn< Thing >::get_thing(), QueuedReturn< Thing >::thing_available(), and QueuedReturn< Thing >::~QueuedReturn(). |