DUNE-FEM (unstable)
Dune::Fem::ObjectPointer< ReferenceCounter > Class Template Reference
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 | |
Public Member Functions | |
ObjectPointer (ReferenceCounterType *const object=0) | |
initialize a pointer (with a standard C++ pointer) More... | |
ObjectPointer (const ThisType &other) | |
copy constructor More... | |
~ObjectPointer () | |
destructor More... | |
ThisType & | operator= (const ThisType &other) |
assign another pointer to this one. | |
ObjectType & | operator* () const |
dereference the ObjectPointer More... | |
unsigned int | referenceCounter () const |
return current reference count | |
Detailed Description
template<class ReferenceCounter>
class Dune::Fem::ObjectPointer< ReferenceCounter >
class Dune::Fem::ObjectPointer< ReferenceCounter >
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.
Constructor & Destructor Documentation
◆ ObjectPointer() [1/2]
template<class ReferenceCounter >
|
inlineexplicit |
initialize a pointer (with a standard C++ pointer)
- Parameters
-
[in] object C++ pointer to initialize this pointer with; the default value is 0
◆ ObjectPointer() [2/2]
template<class ReferenceCounter >
|
inline |
copy constructor
Copying an ObjectPointer will also increase the reference counter of the object pointed to.
- Parameters
-
[in] other pointer to assign to this one
◆ ~ObjectPointer()
template<class ReferenceCounter >
|
inline |
destructor
When the pointer is deleted, the reference counter of the object pointed to is automatically decreased.
Member Function Documentation
◆ operator*()
template<class ReferenceCounter >
|
inline |
dereference the ObjectPointer
- Note
- This method asserts that the pointer is not 0.
- Returns
- a reference to the object pointed to.
The documentation for this class was generated from the following file:
- dune/fem/storage/referencecounter.hh
|
Legal Statements / Impressum |
Hosted by TU Dresden |
generated with Hugo v0.111.3
(Nov 13, 23:29, 2024)