Using CCirBuffer

This document describes how to use CCirBuffer.

Before adding/removing objects

The buffer itself is not allocated until the CCirBufBase::SetLengthL() member function is called. Therefore, the first steps must always be to construct the CCirBuffer object and then call its SetLengthL() member function.

Also note that SetLengthL() can leave so it's useful to call it under a trap harness.

CCirBuffer* cbInt=new CCirBuffer;
TRAPD(ret,cbInt->SetLengthL(3));            // max capacity is 3
                                            // and allocates buffer
cbInt->Put(123);     // Can now start adding/removing integer objects
delete cbInt;