26 _max_queue_size = max_size;
36 return _max_queue_size;
46 int size = _things.size();
58 return _overflow_flag;
68 _overflow_flag =
false;
78 _max_queue_size = get_net_max_response_queue();
79 _overflow_flag =
false;
108 template<
class Thing>
112 if (_things.empty()) {
118 result = _things.front();
120 _available = !_things.empty();
128 template<
class Thing>
132 bool enqueue_ok = ((int)_things.size() < _max_queue_size);
134 _things.push_back(thing);
136 _overflow_flag =
true;
149 template<
class Thing>
153 bool enqueue_ok = ((int)_things.size() < _max_queue_size);
155 if (find(_things.begin(), _things.end(), thing) == _things.end()) {
157 _things.push_back(thing);
164 _overflow_flag =
true;
bool get_overflow_flag() const
Returns true if the queue has overflowed since the last call to reset_overflow_flag() (implying that ...
void reset_overflow_flag()
Resets the overflow flag so that get_overflow_flag() will return false until a new overflow occurs.
void set_max_queue_size(int max_size)
Sets the maximum size the queue is allowed to grow to.
Similar to MutexHolder, but for a light mutex.
int get_current_queue_size() const
Returns the current number of things in the queue.
This is the implementation of a family of things that queue up their return values for later retrieva...
int get_max_queue_size() const
Returns the maximum size the queue is allowed to grow to.