RefBlockController< T > Class Template Reference

This class manages the actual data allocation, reference counting, and optional bounds checking for the RefCountedBlockPtr class. More...

#include <RefCountedBlockPtr.h>

Inheritance diagram for RefBlockController< T >:

Inheritance graph
[legend]
Collaboration diagram for RefBlockController< T >:

Collaboration graph
[legend]

List of all members.

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


Detailed Description

template<class T>
class RefBlockController< T >

This class manages the actual data allocation, reference counting, and optional bounds checking for the RefCountedBlockPtr class.

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.


Constructor & Destructor Documentation

template<class T>
RefBlockController< T >::RefBlockController ( size_t  size  )  [inline, explicit]

template<class T>
RefBlockController< T >::RefBlockController ( size_t  size,
const T &  model 
) [inline]

template<class T>
RefBlockController< T >::RefBlockController ( size_t  size,
const NoInitTag  
) [inline]

template<class T>
RefBlockController< T >::RefBlockController ( T *  p,
size_t  size 
) [inline]

template<class T>
RefBlockController< T >::RefBlockController ( const RefBlockController< T > &  model  )  [inline]

template<class T>
RefBlockController< T >::~RefBlockController (  )  [inline]


Member Function Documentation

template<class T>
bool RefBlockController< T >::resize ( size_t  newsize,
const NoInitTag  
) [inline]

template<class T>
bool RefBlockController< T >::resize ( size_t  newsize  )  [inline]

template<class T>
bool RefBlockController< T >::resize ( size_t  newsize,
const T &  model 
) [inline]

template<class T>
T* RefBlockController< T >::resizeAndCopy ( size_t  newsize  )  [inline]

template<class T>
T* RefBlockController< T >::resizeAndCopy ( size_t  newsize,
const T &  model 
) [inline]

template<class T>
T* RefBlockController< T >::resizeAndCopy ( size_t  newsize,
const NoInitTag  
) [inline]

template<class T>
T* RefBlockController< T >::begin (  )  const [inline]

template<class T>
T* RefBlockController< T >::end (  )  const [inline]

template<class T>
size_t RefBlockController< T >::size (  )  const [inline]

template<class T>
size_t RefBlockController< T >::capacity (  )  const [inline]

template<class T>
bool RefBlockController< T >::empty (  )  const [inline]

template<class T>
bool RefBlockController< T >::isMine (  )  const [inline]

template<class T>
bool RefBlockController< T >::checkDeref ( const T *  p  )  const [inline]


The documentation for this class was generated from the following file:

Generated on Wed Mar 16 06:20:29 2011 for FreePOOMA by  doxygen 1.5.9