1#ifndef DUNE_FEM_REFERENCECOUNTER_HH
2#define DUNE_FEM_REFERENCECOUNTER_HH
97 return asImp().getObject();
111 return asImp().getObject();
131 template<
class ReferenceCounter >
135 static const bool v = std::is_convertible< ReferenceCounter, ReferenceCounterInterfaceType >::value;
151 template<
class RCT >
222 template<
class ReferenceCounter >
233 typedef typename ReferenceCounterType::ObjectType
ObjectType;
Definition: bindguard.hh:11
Definition: bartonnackmaninterface.hh:17
const Implementation & asImp() const
Definition: bartonnackmaninterface.hh:37
interface for objects capable of reference counting
Definition: referencecounter.hh:36
Traits::ObjectType ObjectType
type of the object, this is a reference counter for
Definition: referencecounter.hh:51
void deleteObject()
delete to object
Definition: referencecounter.hh:81
void removeReference() const
remove a reference to this object
Definition: referencecounter.hh:123
RCT Traits
type of the traits
Definition: referencecounter.hh:42
ObjectType & getObject()
access the real object (non-const version)
Definition: referencecounter.hh:108
const Implementation & asImp() const
Definition: bartonnackmaninterface.hh:37
void addReference() const
add a reference to this object
Definition: referencecounter.hh:66
Traits::ReferenceCounterType ReferenceCounterType
type of the implementation (Barton-Nackman)
Definition: referencecounter.hh:45
ThisType ReferenceCounterInterfaceType
type of the reference counter interface
Definition: referencecounter.hh:48
const ObjectType & getObject() const
access the real object (const version)
Definition: referencecounter.hh:94
Definition: referencecounter.hh:133
ReferenceCounterInterface< typename ReferenceCounter::Traits > ReferenceCounterInterfaceType
Definition: referencecounter.hh:134
static const bool v
Definition: referencecounter.hh:135
default implementation of ReferenceCounterInterface
Definition: referencecounter.hh:154
ReferenceCounterDefault(const ThisType &)=delete
ThisType & operator=(const ThisType &)=delete
unsigned int referenceCounter() const
return current reference count
Definition: referencecounter.hh:206
BaseType::ReferenceCounterType ReferenceCounterType
type of the implementation (Barton-Nackman)
Definition: referencecounter.hh:160
const Implementation & asImp() const
Definition: bartonnackmaninterface.hh:37
unsigned int refcount_
Definition: referencecounter.hh:209
ReferenceCounterDefault(unsigned int refcount=1)
constructor initializing the reference counter
Definition: referencecounter.hh:177
void removeReference() const
:: ReferenceCounterInterface :: removeReference
Definition: referencecounter.hh:197
void deleteObject()
:: ReferenceCounterInterface :: deleteObject
Definition: referencecounter.hh:191
void addReference() const
:: ReferenceCounterInterface :: addReference
Definition: referencecounter.hh:185
models a pointer to a reference countable object
Definition: referencecounter.hh:224
ReferenceCounter ReferenceCounterType
type of the object, this pointer points to
Definition: referencecounter.hh:231
ObjectType & operator*() const
dereference the ObjectPointer
Definition: referencecounter.hh:294
ObjectPointer(const ThisType &other)
copy constructor
Definition: referencecounter.hh:254
ReferenceCounterType::ObjectType ObjectType
Definition: referencecounter.hh:233
unsigned int referenceCounter() const
return current reference count
Definition: referencecounter.hh:301
~ObjectPointer()
destructor
Definition: referencecounter.hh:266
ObjectPointer(ReferenceCounterType *const object=0)
initialize a pointer (with a standard C++ pointer)
Definition: referencecounter.hh:240
ReferenceCounterType * object_
Definition: referencecounter.hh:304
ThisType & operator=(const ThisType &other)
assign another pointer to this one.
Definition: referencecounter.hh:274