#include "CTBsharedBuffer.hxx"
Inheritance diagram for CTBsharedBuffer:
Public Methods | |
CTBsharedBuffer () | |
CTBsharedBuffer (CTBint i_size) | |
CTBsharedBuffer (const CTBsharedBuffer< T > &rhs) | |
CTBsharedBuffer (CTBsharedBuffer< T > &rhs, bool b_grab) | |
~CTBsharedBuffer () | |
T * | Data () const |
CTBint | Size () const |
const T & | At (CTBint i_ind) const |
T & | At (CTBint i_ind) |
void | Release () |
void | Unshare () |
void | Resize (CTBint i_size, bool b_keep=true) |
void | Grab (CTBsharedBuffer< T > &rhs) |
void | SharedCopy (const CTBsharedBuffer< T > &rhs) |
void | PrivateCopy (const CTBsharedBuffer< T > &rhs) |
bool | IsNull () const |
bool | IsUnique () const |
bool | IsShared () const |
void | Dump (int i_indent=0, ostream &os=cout, const char *p_text=0) const |
CTBsharedBuffer< T > & | operator= (const CTBsharedBuffer< T > &rhs) |
const T & | operator[] (CTBint i_ind) const |
T & | operator[] (CTBint i_ind) |
bool | operator== (const CTBsharedBuffer< T > &rhs) const |
bool | operator! () const |
operator bool () const | |
Private Methods | |
void | CreateBuffer (CTBint i_size) |
void | CopyData (const T rhs[], CTBint i_size) |
Private Attributes | |
T * | mp_data |
CTBint | mi_size |
CTBreferenceCounter * | mp_refcount |
T()
~T()
T& operator=(const T &)
Definition at line 20 of file CTBsharedBuffer.hxx.
|
Construct empty.
Definition at line 18 of file CTBsharedBuffer.icc. |
|
Construct with size i_size.
Definition at line 28 of file CTBsharedBuffer.icc. |
|
Copy constructor.
Definition at line 37 of file CTBsharedBuffer.icc. |
|
Grab contructor.
Definition at line 49 of file CTBsharedBuffer.icc. |
|
Destructor.
Definition at line 63 of file CTBsharedBuffer.icc. |
|
Returns pointer to buffer.
Definition at line 72 of file CTBsharedBuffer.icc. Referenced by PrivateCopy(), Resize(), and Unshare().
|
|
Returns size of buffer.
Definition at line 81 of file CTBsharedBuffer.icc. Referenced by CTBstring::Append(), CTBstring::AppendData(), CopyData(), CTBstring::EnsureUnsharedCapacity(), PrivateCopy(), Resize(), and Unshare().
|
|
Constant access buffer element.
Definition at line 36 of file CTBsharedBuffer.cxx. Referenced by operator[]().
|
|
Access buffer element.
Definition at line 49 of file CTBsharedBuffer.cxx. |
|
Release buffer.
Definition at line 62 of file CTBsharedBuffer.cxx. Referenced by CTBstring::Clear(), Grab(), CTBstring::NewString(), PrivateCopy(), SharedCopy(), and ~CTBsharedBuffer().
|
|
Ensure that buffer isn't shared.
Definition at line 82 of file CTBsharedBuffer.cxx. Referenced by PrivateCopy().
|
|
Change size of buffer.
Definition at line 98 of file CTBsharedBuffer.cxx. Referenced by CTBstring::EnsureUnsharedCapacity().
|
|
Grab resources. The context of rhs is transfered to this. rhs is afterward in IsNull() state. Definition at line 122 of file CTBsharedBuffer.cxx. Referenced by CTBstring::Grab().
|
|
Get a shared copy of rhs.
Definition at line 142 of file CTBsharedBuffer.cxx. Referenced by operator=().
|
|
Get a private (non-shared) copy of rhs.
Definition at line 160 of file CTBsharedBuffer.cxx. |
|
Returns true if size = 0.
Definition at line 90 of file CTBsharedBuffer.icc. Referenced by CTBstring::IsEmpty(), CTBstring::IsNull(), Resize(), CTBstring::Terminate(), and CTBstring::operator const char *().
|
|
Returns true if size > 0 and not shared.
Definition at line 99 of file CTBsharedBuffer.icc. Referenced by CTBstring::Append(), CTBstring::AppendData(), and CTBstring::Terminate().
|
|
Returns true if size > 0 and shared.
Definition at line 108 of file CTBsharedBuffer.icc. Referenced by CTBstring::Clear(), CTBstring::EnsureUnsharedCapacity(), Resize(), CTBstring::Unshare(), and Unshare().
|
|
Dump.
Definition at line 178 of file CTBsharedBuffer.cxx. Referenced by CTBstring::Dump().
|
|
Obtain a shared copy.
Definition at line 117 of file CTBsharedBuffer.icc. |
|
Constant access element (index checked if CTB__IndexCheck defined).
Definition at line 128 of file CTBsharedBuffer.icc. |
|
Access element (index checked if CTB__IndexCheck defined).
Definition at line 141 of file CTBsharedBuffer.icc. |
|
Returns true if same buffer.
Definition at line 154 of file CTBsharedBuffer.icc. |
|
Returns true size=0 (equivalent to
Definition at line 163 of file CTBsharedBuffer.icc. |
|
Returns true size!=0 and a buffer is allocated.
Definition at line 172 of file CTBsharedBuffer.icc. |
|
Create new buffer.
Definition at line 200 of file CTBsharedBuffer.cxx. Referenced by CTBsharedBuffer(), PrivateCopy(), Resize(), and Unshare().
|
|
Copy data elements.
Definition at line 219 of file CTBsharedBuffer.cxx. Referenced by PrivateCopy(), Resize(), and Unshare().
|
|
buffer area.
Definition at line 69 of file CTBsharedBuffer.hxx. |
|
size of buffer.
Definition at line 70 of file CTBsharedBuffer.hxx. |
|
pointer to reference count.
Definition at line 71 of file CTBsharedBuffer.hxx. |