32 _max_queue_size = max_size;
44 return _max_queue_size;
56 int size = _things.size();
71 return _overflow_flag;
83 _overflow_flag =
false;
95 _max_queue_size = get_net_max_response_queue();
96 _overflow_flag =
false;
104 template<
class Thing>
115 template<
class Thing>
134 template<
class Thing>
138 if (_things.empty()) {
144 result = _things.front();
146 _available = !_things.empty();
157 template<
class Thing>
161 bool enqueue_ok = ((int)_things.size() < _max_queue_size);
163 _things.push_back(thing);
165 _overflow_flag =
true;
181 template<
class Thing>
185 bool enqueue_ok = ((int)_things.size() < _max_queue_size);
187 if (find(_things.begin(), _things.end(), thing) == _things.end()) {
189 _things.push_back(thing);
196 _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.