#include <RefCountedBlockPtr.h>
Classes | |
struct | NoInitTag |
Public Types | |
typedef std::random_access_iterator_tag | iterator_category |
typedef T | value_type |
typedef ptrdiff_t | difference_type |
typedef T * | pointer |
typedef T & | reference |
typedef T | Element_t |
typedef T | Pointee_t |
typedef ptrdiff_t | Offset_t |
typedef RefCountedBlockPtr< T, BoundsChecked, Controller > | This_t |
typedef RefCountedBlockPtr< T,!BoundsChecked, Controller > | That_t |
Public Member Functions | |
RefCountedBlockPtr () | |
RefCountedBlockPtr (size_t size) | |
RefCountedBlockPtr (size_t size, const T &model) | |
RefCountedBlockPtr (size_t size, const NoInitTag &) | |
RefCountedBlockPtr (T *p, size_t size) | |
RefCountedBlockPtr (const This_t &model) | |
RefCountedBlockPtr (const That_t &model) | |
RefCountedBlockPtr (const This_t &model, Offset_t offset) | |
~RefCountedBlockPtr () | |
This_t & | operator= (const This_t &rhs) |
This_t & | operator= (const That_t &rhs) |
template<class T1 , bool BoundsChecked1, class Controller1 > | |
bool | operator== (const RefCountedBlockPtr< T1, BoundsChecked1, Controller1 > &) const |
template<class T1 , bool BoundsChecked1, class Controller1 > | |
bool | operator!= (const RefCountedBlockPtr< T1, BoundsChecked1, Controller1 > &) const |
bool | operator== (const This_t &a) const |
bool | operator!= (const This_t &a) const |
bool | operator< (const This_t &a) const |
bool | operator> (const This_t &a) const |
bool | operator<= (const This_t &a) const |
bool | operator>= (const This_t &a) const |
bool | operator== (const That_t &a) const |
bool | operator!= (const That_t &a) const |
T & | operator* () const |
T & | operator[] (Offset_t i) const |
T * | operator-> () const |
This_t & | operator++ () |
This_t & | operator-- () |
This_t | operator++ (int) |
This_t | operator-- (int) |
void | operator+= (Offset_t i) |
void | operator-= (Offset_t i) |
This_t | operator+ (Offset_t i) const |
This_t | operator- (Offset_t i) const |
This_t | begin () const |
This_t | end () const |
void | reserve (size_t size) |
bool | resize (size_t size, const NoInitTag &) |
bool | resize (size_t size) |
bool | resize (size_t size, const T &model) |
void | resizeAndCopy (size_t size, const NoInitTag &) |
void | resizeAndCopy (size_t size) |
void | resizeAndCopy (size_t size, const T &model) |
void | invalidate () |
This_t & | makeOwnCopy () |
Offset_t | offset () const |
bool | isValid () const |
bool | isShared () const |
int | count () const |
size_t | size () const |
size_t | capacity () const |
bool | empty () const |
bool | isAtBeginning () const |
bool | isMine () const |
T * | beginPointer () const |
T * | endPointer () const |
T * | currentPointer () const |
Protected Member Functions | |
RefCountedBlockPtr (Controller *con) | |
void | boundsAssert (T *p) const |
Protected Attributes | |
Offset_t | offset_m |
RefCountedPtr< Controller > | blockControllerPtr_m |
Friends | |
class | RefCountedBlockPtr< T,!BoundsChecked, Controller > |
As long as only RefCountedBlockPtrs are used to reference this data block, it will stay around. As soon as the last such object is deleted, the block is deleted.
You create a block with:
RefCountedBlockPtr<T> p(size);
Then you use p like a pointer. Pointer operations are as efficient as they would be with a bare pointer as long as bounds checking is off.
RefCountedBlockPtr's second template parameter, BoundsChecked, is used to enable bounds checking. It defaults to the value of the preprocessor symbol POOMA_BOUNDS_CHECK_DEFAULT. This is usually set to false. However, if Pooma's configure script is passed the --bounds option, it will be set to true.
The third template parameter, Controller, is the object used to store the actual data. The concept is modeled by RefBlockController defined above, and it defaults to RefBlockController<T>. See DataBlockPtr.h for another example.
A RefCountedBlockPtr with bounds checking explicitly turned on is declare as:
RefCountedBlockPtr<T,true> p;
Similarly, a RefCountedBlockPtr with bounds checking explicitly turned off is declared as:
RefCountedBlockPtr<T,false> p;
typedef std::random_access_iterator_tag RefCountedBlockPtr< T, BoundsChecked, Controller >::iterator_category |
typedef T RefCountedBlockPtr< T, BoundsChecked, Controller >::value_type |
typedef ptrdiff_t RefCountedBlockPtr< T, BoundsChecked, Controller >::difference_type |
typedef T* RefCountedBlockPtr< T, BoundsChecked, Controller >::pointer |
typedef T& RefCountedBlockPtr< T, BoundsChecked, Controller >::reference |
typedef T RefCountedBlockPtr< T, BoundsChecked, Controller >::Element_t |
Reimplemented in DataBlockPtr< T, BoundsChecked >, DataBlockPtr< int >, DataBlockPtr< T >, and DataBlockPtr< IndirectionList< int > >.
typedef T RefCountedBlockPtr< T, BoundsChecked, Controller >::Pointee_t |
Reimplemented in DataBlockPtr< T, BoundsChecked >, DataBlockPtr< int >, DataBlockPtr< T >, and DataBlockPtr< IndirectionList< int > >.
typedef ptrdiff_t RefCountedBlockPtr< T, BoundsChecked, Controller >::Offset_t |
typedef RefCountedBlockPtr<T,BoundsChecked,Controller> RefCountedBlockPtr< T, BoundsChecked, Controller >::This_t |
Reimplemented in DataBlockPtr< T, BoundsChecked >, DataBlockPtr< int >, DataBlockPtr< T >, and DataBlockPtr< IndirectionList< int > >.
typedef RefCountedBlockPtr<T,!BoundsChecked,Controller> RefCountedBlockPtr< T, BoundsChecked, Controller >::That_t |
Reimplemented in DataBlockPtr< T, BoundsChecked >, DataBlockPtr< int >, DataBlockPtr< T >, and DataBlockPtr< IndirectionList< int > >.
RefCountedBlockPtr< T, BoundsChecked, Controller >::RefCountedBlockPtr | ( | ) | [inline] |
RefCountedBlockPtr< T, BoundsChecked, Controller >::RefCountedBlockPtr | ( | size_t | size | ) | [inline, explicit] |
RefCountedBlockPtr< T, BoundsChecked, Controller >::RefCountedBlockPtr | ( | size_t | size, | |
const T & | model | |||
) | [inline] |
RefCountedBlockPtr< T, BoundsChecked, Controller >::RefCountedBlockPtr | ( | size_t | size, | |
const NoInitTag & | ||||
) | [inline] |
RefCountedBlockPtr< T, BoundsChecked, Controller >::RefCountedBlockPtr | ( | T * | p, | |
size_t | size | |||
) | [inline] |
RefCountedBlockPtr< T, BoundsChecked, Controller >::RefCountedBlockPtr | ( | const This_t & | model | ) | [inline] |
RefCountedBlockPtr< T, BoundsChecked, Controller >::RefCountedBlockPtr | ( | const That_t & | model | ) | [inline] |
RefCountedBlockPtr< T, BoundsChecked, Controller >::RefCountedBlockPtr | ( | const This_t & | model, | |
Offset_t | offset | |||
) | [inline] |
RefCountedBlockPtr< T, BoundsChecked, Controller >::~RefCountedBlockPtr | ( | ) | [inline] |
RefCountedBlockPtr< T, BoundsChecked, Controller >::RefCountedBlockPtr | ( | Controller * | con | ) | [inline, protected] |
This_t& RefCountedBlockPtr< T, BoundsChecked, Controller >::operator= | ( | const This_t & | rhs | ) | [inline] |
Referenced by DataBlockPtr< IndirectionList< int > >::operator=().
This_t& RefCountedBlockPtr< T, BoundsChecked, Controller >::operator= | ( | const That_t & | rhs | ) | [inline] |
bool RefCountedBlockPtr< T, BoundsChecked, Controller >::operator== | ( | const RefCountedBlockPtr< T1, BoundsChecked1, Controller1 > & | ) | const [inline] |
bool RefCountedBlockPtr< T, BoundsChecked, Controller >::operator!= | ( | const RefCountedBlockPtr< T1, BoundsChecked1, Controller1 > & | ) | const [inline] |
bool RefCountedBlockPtr< T, BoundsChecked, Controller >::operator== | ( | const This_t & | a | ) | const [inline] |
bool RefCountedBlockPtr< T, BoundsChecked, Controller >::operator!= | ( | const This_t & | a | ) | const [inline] |
bool RefCountedBlockPtr< T, BoundsChecked, Controller >::operator< | ( | const This_t & | a | ) | const [inline] |
bool RefCountedBlockPtr< T, BoundsChecked, Controller >::operator> | ( | const This_t & | a | ) | const [inline] |
bool RefCountedBlockPtr< T, BoundsChecked, Controller >::operator<= | ( | const This_t & | a | ) | const [inline] |
bool RefCountedBlockPtr< T, BoundsChecked, Controller >::operator>= | ( | const This_t & | a | ) | const [inline] |
bool RefCountedBlockPtr< T, BoundsChecked, Controller >::operator== | ( | const That_t & | a | ) | const [inline] |
bool RefCountedBlockPtr< T, BoundsChecked, Controller >::operator!= | ( | const That_t & | a | ) | const [inline] |
T& RefCountedBlockPtr< T, BoundsChecked, Controller >::operator* | ( | ) | const [inline] |
T& RefCountedBlockPtr< T, BoundsChecked, Controller >::operator[] | ( | Offset_t | i | ) | const [inline] |
T* RefCountedBlockPtr< T, BoundsChecked, Controller >::operator-> | ( | ) | const [inline] |
This_t& RefCountedBlockPtr< T, BoundsChecked, Controller >::operator++ | ( | ) | [inline] |
Reimplemented in DataBlockPtr< T, BoundsChecked >, DataBlockPtr< int >, DataBlockPtr< T >, and DataBlockPtr< IndirectionList< int > >.
Referenced by DataBlockPtr< IndirectionList< int > >::operator++().
This_t& RefCountedBlockPtr< T, BoundsChecked, Controller >::operator-- | ( | ) | [inline] |
Reimplemented in DataBlockPtr< T, BoundsChecked >, DataBlockPtr< int >, DataBlockPtr< T >, and DataBlockPtr< IndirectionList< int > >.
Referenced by DataBlockPtr< IndirectionList< int > >::operator--().
This_t RefCountedBlockPtr< T, BoundsChecked, Controller >::operator++ | ( | int | ) | [inline] |
Reimplemented in DataBlockPtr< T, BoundsChecked >, DataBlockPtr< int >, DataBlockPtr< T >, and DataBlockPtr< IndirectionList< int > >.
This_t RefCountedBlockPtr< T, BoundsChecked, Controller >::operator-- | ( | int | ) | [inline] |
Reimplemented in DataBlockPtr< T, BoundsChecked >, DataBlockPtr< int >, DataBlockPtr< T >, and DataBlockPtr< IndirectionList< int > >.
void RefCountedBlockPtr< T, BoundsChecked, Controller >::operator+= | ( | Offset_t | i | ) | [inline] |
void RefCountedBlockPtr< T, BoundsChecked, Controller >::operator-= | ( | Offset_t | i | ) | [inline] |
This_t RefCountedBlockPtr< T, BoundsChecked, Controller >::operator+ | ( | Offset_t | i | ) | const [inline] |
Reimplemented in DataBlockPtr< T, BoundsChecked >, DataBlockPtr< int >, DataBlockPtr< T >, and DataBlockPtr< IndirectionList< int > >.
This_t RefCountedBlockPtr< T, BoundsChecked, Controller >::operator- | ( | Offset_t | i | ) | const [inline] |
Reimplemented in DataBlockPtr< T, BoundsChecked >, DataBlockPtr< int >, DataBlockPtr< T >, and DataBlockPtr< IndirectionList< int > >.
This_t RefCountedBlockPtr< T, BoundsChecked, Controller >::begin | ( | ) | const [inline] |
Reimplemented in DataBlockPtr< T, BoundsChecked >, DataBlockPtr< int >, DataBlockPtr< T >, and DataBlockPtr< IndirectionList< int > >.
Referenced by DataBlockPtr< IndirectionList< int > >::begin().
This_t RefCountedBlockPtr< T, BoundsChecked, Controller >::end | ( | ) | const [inline] |
Reimplemented in DataBlockPtr< T, BoundsChecked >, DataBlockPtr< int >, DataBlockPtr< T >, and DataBlockPtr< IndirectionList< int > >.
Referenced by DataBlockPtr< IndirectionList< int > >::end().
void RefCountedBlockPtr< T, BoundsChecked, Controller >::reserve | ( | size_t | size | ) | [inline] |
Referenced by FieldEngine< Mesh, T, EngineTag >::addSubFields().
bool RefCountedBlockPtr< T, BoundsChecked, Controller >::resize | ( | size_t | size, | |
const NoInitTag & | ||||
) | [inline] |
Referenced by FieldEngine< Mesh, T, EngineTag >::addSubFields().
bool RefCountedBlockPtr< T, BoundsChecked, Controller >::resize | ( | size_t | size | ) | [inline] |
bool RefCountedBlockPtr< T, BoundsChecked, Controller >::resize | ( | size_t | size, | |
const T & | model | |||
) | [inline] |
void RefCountedBlockPtr< T, BoundsChecked, Controller >::resizeAndCopy | ( | size_t | size, | |
const NoInitTag & | ||||
) | [inline] |
void RefCountedBlockPtr< T, BoundsChecked, Controller >::resizeAndCopy | ( | size_t | size | ) | [inline] |
void RefCountedBlockPtr< T, BoundsChecked, Controller >::resizeAndCopy | ( | size_t | size, | |
const T & | model | |||
) | [inline] |
void RefCountedBlockPtr< T, BoundsChecked, Controller >::invalidate | ( | ) | [inline] |
This_t& RefCountedBlockPtr< T, BoundsChecked, Controller >::makeOwnCopy | ( | ) | [inline] |
Offset_t RefCountedBlockPtr< T, BoundsChecked, Controller >::offset | ( | ) | const [inline] |
Referenced by RefCountedBlockPtr< Element_t >::currentPointer(), RefCountedBlockPtr< Element_t >::isAtBeginning(), RefCountedBlockPtr< Element_t >::operator!=(), RefCountedBlockPtr< Element_t >::operator<(), RefCountedBlockPtr< Element_t >::operator<=(), RefCountedBlockPtr< Element_t >::operator==(), RefCountedBlockPtr< Element_t >::operator>(), and RefCountedBlockPtr< Element_t >::operator>=().
bool RefCountedBlockPtr< T, BoundsChecked, Controller >::isValid | ( | ) | const [inline] |
Referenced by RefCountedBlockPtr< Element_t >::beginPointer(), RefCountedBlockPtr< Element_t >::boundsAssert(), RefCountedBlockPtr< Element_t >::capacity(), RefCountedBlockPtr< Element_t >::count(), FieldEngine< Mesh, T, EngineTag >::data(), RefCountedBlockPtr< Element_t >::empty(), RefCountedBlockPtr< Element_t >::endPointer(), FieldEngine< Mesh, T, EngineTag >::engine(), RefCountedBlockPtr< Element_t >::isMine(), FieldEngine< Mesh, T, EngineTag >::makeOwnCopy(), DataBlockPtr< IndirectionList< int > >::operator=(), FieldEngine< Mesh, T, EngineTag >::relations(), RefCountedBlockPtr< Element_t >::reserve(), RefCountedBlockPtr< Element_t >::resize(), RefCountedBlockPtr< Element_t >::resizeAndCopy(), and RefCountedBlockPtr< Element_t >::size().
bool RefCountedBlockPtr< T, BoundsChecked, Controller >::isShared | ( | ) | const [inline] |
int RefCountedBlockPtr< T, BoundsChecked, Controller >::count | ( | ) | const [inline] |
size_t RefCountedBlockPtr< T, BoundsChecked, Controller >::size | ( | ) | const [inline] |
size_t RefCountedBlockPtr< T, BoundsChecked, Controller >::capacity | ( | ) | const [inline] |
bool RefCountedBlockPtr< T, BoundsChecked, Controller >::empty | ( | ) | const [inline] |
bool RefCountedBlockPtr< T, BoundsChecked, Controller >::isAtBeginning | ( | ) | const [inline] |
Referenced by Engine< Dim, T, BrickView >::Engine().
bool RefCountedBlockPtr< T, BoundsChecked, Controller >::isMine | ( | ) | const [inline] |
T* RefCountedBlockPtr< T, BoundsChecked, Controller >::beginPointer | ( | ) | const [inline] |
Referenced by RefCountedBlockPtr< Element_t >::currentPointer(), RefCountedBlockPtr< Element_t >::operator!=(), RefCountedBlockPtr< Element_t >::operator<(), RefCountedBlockPtr< Element_t >::operator<=(), RefCountedBlockPtr< Element_t >::operator==(), RefCountedBlockPtr< Element_t >::operator>(), and RefCountedBlockPtr< Element_t >::operator>=().
T* RefCountedBlockPtr< T, BoundsChecked, Controller >::endPointer | ( | ) | const [inline] |
T* RefCountedBlockPtr< T, BoundsChecked, Controller >::currentPointer | ( | ) | const [inline] |
void RefCountedBlockPtr< T, BoundsChecked, Controller >::boundsAssert | ( | T * | p | ) | const [inline, protected] |
friend class RefCountedBlockPtr< T,!BoundsChecked, Controller > [friend] |
Offset_t RefCountedBlockPtr< T, BoundsChecked, Controller >::offset_m [protected] |
Referenced by RefCountedBlockPtr< Element_t >::begin(), RefCountedBlockPtr< Element_t >::end(), RefCountedBlockPtr< Element_t >::invalidate(), RefCountedBlockPtr< Element_t >::offset(), RefCountedBlockPtr< Element_t >::operator++(), RefCountedBlockPtr< Element_t >::operator+=(), RefCountedBlockPtr< Element_t >::operator--(), RefCountedBlockPtr< Element_t >::operator-=(), RefCountedBlockPtr< Element_t >::operator=(), and RefCountedBlockPtr< Element_t >::reserve().
RefCountedPtr<Controller> RefCountedBlockPtr< T, BoundsChecked, Controller >::blockControllerPtr_m [protected] |
Referenced by RefCountedBlockPtr< Element_t >::beginPointer(), RefCountedBlockPtr< Element_t >::boundsAssert(), RefCountedBlockPtr< Element_t >::capacity(), RefCountedBlockPtr< Element_t >::count(), RefCountedBlockPtr< Element_t >::empty(), RefCountedBlockPtr< Element_t >::endPointer(), RefCountedBlockPtr< Element_t >::invalidate(), RefCountedBlockPtr< Element_t >::isMine(), RefCountedBlockPtr< Element_t >::isShared(), RefCountedBlockPtr< Element_t >::isValid(), RefCountedBlockPtr< Element_t >::makeOwnCopy(), RefCountedBlockPtr< Element_t >::operator=(), DataBlockPtr< IndirectionList< int > >::operator=(), RefCountedBlockPtr< Element_t >::RefCountedBlockPtr(), RefCountedBlockPtr< Element_t >::reserve(), RefCountedBlockPtr< Element_t >::resize(), RefCountedBlockPtr< Element_t >::resizeAndCopy(), and RefCountedBlockPtr< Element_t >::size().