mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -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);
|
_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 Thing &back();
|
||||||
INLINE void push_back(const Thing &t);
|
INLINE void push_back(const Thing &t);
|
||||||
|
|
||||||
|
INLINE void clear();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Thing _array[max_size+1];
|
Thing _array[max_size+1];
|
||||||
int _in, _out;
|
int _in, _out;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user