dune-fem 2.8.0
|
models a pointer to a reference countable object More...
#include <dune/fem/storage/referencecounter.hh>
Public Types | |
typedef ReferenceCounter | ReferenceCounterType |
type of the object, this pointer points to | |
typedef ReferenceCounterType::ObjectType | ObjectType |
Public Member Functions | |
ObjectPointer (ReferenceCounterType *const object=0) | |
initialize a pointer (with a standard C++ pointer) | |
ObjectPointer (const ThisType &other) | |
copy constructor | |
~ObjectPointer () | |
destructor | |
ThisType & | operator= (const ThisType &other) |
assign another pointer to this one. | |
ObjectType & | operator* () const |
dereference the ObjectPointer | |
unsigned int | referenceCounter () const |
return current reference count | |
Protected Attributes | |
ReferenceCounterType * | object_ |
models a pointer to a reference countable object
ObjectPointer tries to behave like a normal pointer to an object implementing the ReferenceCounterInterface. Internally, however, it calls the object's addReference and removeReference methods whenever the pointer is created, assign or deleted.
typedef ReferenceCounterType::ObjectType Dune::Fem::ObjectPointer< ReferenceCounter >::ObjectType |
typedef ReferenceCounter Dune::Fem::ObjectPointer< ReferenceCounter >::ReferenceCounterType |
type of the object, this pointer points to
|
inlineexplicit |
initialize a pointer (with a standard C++ pointer)
[in] | object | C++ pointer to initialize this pointer with; the default value is 0 |
|
inline |
copy constructor
Copying an ObjectPointer will also increase the reference counter of the object pointed to.
[in] | other | pointer to assign to this one |
|
inline |
destructor
When the pointer is deleted, the reference counter of the object pointed to is automatically decreased.
|
inline |
dereference the ObjectPointer
|
inline |
assign another pointer to this one.
|
inline |
return current reference count
|
protected |