#include <RefCountedBlockPtr.h>
Classes | |
struct | NoInitTag |
Public Member Functions | |
RefBlockController (size_t size) | |
RefBlockController (size_t size, const T &model) | |
RefBlockController (size_t size, const NoInitTag &) | |
RefBlockController (T *p, size_t size) | |
RefBlockController (const RefBlockController &model) | |
~RefBlockController () | |
bool | resize (size_t newsize, const NoInitTag &) |
bool | resize (size_t newsize) |
bool | resize (size_t newsize, const T &model) |
T * | resizeAndCopy (size_t newsize) |
T * | resizeAndCopy (size_t newsize, const T &model) |
T * | resizeAndCopy (size_t newsize, const NoInitTag &) |
T * | begin () const |
T * | end () const |
size_t | size () const |
size_t | capacity () const |
bool | empty () const |
bool | isMine () const |
bool | checkDeref (const T *p) const |
This class holds the pointer to the beginning of the allocated block. It also holds a pointer to one past the end of the allocated block and a pointer to one past the end of the logical size of the block. These two pointers allow the block to be oversized initially so that it can be resized before it has to be replaced. Finally, it holds a bool, the dealloc_m flag, indicating whether or not this data was actually allocated by this class. The begin and logical-end pointers are used to perform optional bounds checking, and dealloc_m allows RefBlockControllers to work with external data.
As this class inherits from RefCounted, deleting the last reference to an object of this type will result in garbage collection (unless dealloc_m is false).
RefBlockController is a model for the Controller concept used by RefCountedBlockPtr defined below.
RefBlockController< T >::RefBlockController | ( | size_t | size | ) | [inline, explicit] |
RefBlockController< T >::RefBlockController | ( | size_t | size, | |
const T & | model | |||
) | [inline] |
RefBlockController< T >::RefBlockController | ( | size_t | size, | |
const NoInitTag & | ||||
) | [inline] |
RefBlockController< T >::RefBlockController | ( | T * | p, | |
size_t | size | |||
) | [inline] |
RefBlockController< T >::RefBlockController | ( | const RefBlockController< T > & | model | ) | [inline] |
RefBlockController< T >::~RefBlockController | ( | ) | [inline] |
bool RefBlockController< T >::resize | ( | size_t | newsize, | |
const NoInitTag & | ||||
) | [inline] |
Referenced by RefBlockController< int >::resize(), and RefBlockController< int >::resizeAndCopy().
bool RefBlockController< T >::resize | ( | size_t | newsize | ) | [inline] |
bool RefBlockController< T >::resize | ( | size_t | newsize, | |
const T & | model | |||
) | [inline] |
T* RefBlockController< T >::resizeAndCopy | ( | size_t | newsize | ) | [inline] |
T* RefBlockController< T >::resizeAndCopy | ( | size_t | newsize, | |
const T & | model | |||
) | [inline] |
T* RefBlockController< T >::resizeAndCopy | ( | size_t | newsize, | |
const NoInitTag & | ||||
) | [inline] |
T* RefBlockController< T >::begin | ( | ) | const [inline] |
T* RefBlockController< T >::end | ( | ) | const [inline] |
size_t RefBlockController< T >::size | ( | ) | const [inline] |
size_t RefBlockController< T >::capacity | ( | ) | const [inline] |
bool RefBlockController< T >::empty | ( | ) | const [inline] |
bool RefBlockController< T >::isMine | ( | ) | const [inline] |
bool RefBlockController< T >::checkDeref | ( | const T * | p | ) | const [inline] |