Support Forum G3D Web Page |
Dynamic queue that works with timestamps to allow simulating latency.
More...
Public Member Functions | |
void | clear (bool freeStorage=true) |
Removes all elements (invoking their destructors). More... | |
bool | contains (const T &e) const |
Returns true if the given element is in the queue. More... | |
bool | empty () const |
void | enqueue (const T &e, RealTime time) |
pushBack More... | |
void | fastClear () |
Clear without freeing the underlying array. More... | |
bool | getPopBack (RealTime time, T &value) |
Remove the last element from the queue if its time stamp is less than or equal to and return true, otherwise return false. More... | |
bool | getPopFront (RealTime time, T &value) |
Remove the first element from the queue if its time stamp is less than or equal to and return true, otherwise return false. More... | |
const T & | last () const |
Returns the back element. More... | |
T & | last () |
int | length () const |
Number of elements in the queue. More... | |
T & | operator[] (int n) |
Performs bounds checks in debug mode More... | |
const T & | operator[] (int n) const |
Performs bounds checks in debug mode More... | |
void | pushBack (const T &e, RealTime time) |
Insert a new element at the end of the queue that must emerge no earlier than More... | |
void | pushFront (const T &e, RealTime time) |
Insert a new element into the front of the queue that must emerge no earlier than (a traditional queue only uses pushBack). More... | |
int | size () const |
Number of elements in the queue. More... | |
Dynamic queue that works with timestamps to allow simulating latency.
Faster than std::deque for objects with constructors.
Typical use:
|
inline |
Removes all elements (invoking their destructors).
freeStorage | If false, the underlying array is not deallocated (allowing fast push in the future), however, the size of the Queue is reported as zero. |
Referenced by G3D::TimeQueue< T >::fastClear().
|
inline |
Returns true if the given element is in the queue.
|
inline |
|
inline |
pushBack
|
inline |
Clear without freeing the underlying array.
|
inline |
Remove the last element from the queue if its time stamp is less than or equal to and return true, otherwise return false.
|
inline |
Remove the first element from the queue if its time stamp is less than or equal to and return true, otherwise return false.
|
inline |
Returns the back element.
|
inline |
|
inline |
Number of elements in the queue.
None may be available for popping based on the time.
|
inline |
Performs bounds checks in debug mode
|
inline |
Performs bounds checks in debug mode
|
inline |
Insert a new element at the end of the queue that must emerge no earlier than
|
inline |
Insert a new element into the front of the queue that must emerge no earlier than (a traditional queue only uses pushBack).
If you push an event with a time later than the first event in the queue it will block subsequent events until that time is used with popFront().
|
inline |
Number of elements in the queue.
None may be available for popping based on the time.
Referenced by G3D::TimeQueue< T >::contains(), G3D::TimeQueue< T >::empty(), G3D::TimeQueue< T >::last(), and G3D::TimeQueue< T >::length().