add clear()

This commit is contained in:
David Rose 2005-01-13 20:03:02 +00:00
parent 5ba29949be
commit 6cc498ed97
2 changed files with 13 additions and 0 deletions

View File

@ -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;
}

View File

@ -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;