mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 08:44:19 -04:00
add clear()
This commit is contained in:
parent
5ba29949be
commit
6cc498ed97
@ -217,3 +217,14 @@ push_back(const Thing &t) {
|
||||
_in = (_in+1)%(max_size+1);
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: CircBuffer::clear
|
||||
// Access: Public
|
||||
// Description: Removes all items from the queue.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class Thing, int max_size>
|
||||
INLINE void CircBuffer<Thing, max_size>::
|
||||
clear() {
|
||||
_in = _out = 0;
|
||||
}
|
||||
|
@ -60,6 +60,8 @@ public:
|
||||
INLINE Thing &back();
|
||||
INLINE void push_back(const Thing &t);
|
||||
|
||||
INLINE void clear();
|
||||
|
||||
private:
|
||||
Thing _array[max_size+1];
|
||||
int _in, _out;
|
||||
|
Loading…
x
Reference in New Issue
Block a user