ConstReferenceCounting< ReferencedClass > Class Template Reference

#include <ReferenceCounting.hpp>

Inheritance diagram for ConstReferenceCounting< ReferencedClass >:

Inheritance graph
[legend]
Collaboration diagram for ConstReferenceCounting< ReferencedClass >:

Collaboration graph
[legend]

List of all members.

Public Member Functions

std::string typeName () const
bool operator== (const ReferencedClass *ref) const
bool operator!= (const ReferencedClass *ref) const
bool operator== (const ReferenceCounting< ReferencedClass > &rc) const
bool operator!= (const ReferenceCounting< ReferencedClass > &rc) const
bool operator== (const ConstReferenceCounting< ReferencedClass > &rc) const
bool operator!= (const ConstReferenceCounting< ReferencedClass > &rc) const
const size_t & numberOfReferences () const
 Access to the number of references.
 operator const ReferencedClass * () const
 Implicit const cast to ReferencedClass*.
const ReferencedClassoperator-> () const
const ReferencedClassoperator* () const
const ConstReferenceCounting
< ReferencedClass > & 
operator= (const ConstReferenceCounting< ReferencedClass > &O)
 operator=
 ConstReferenceCounting (const ConstReferenceCounting< ReferencedClass > &O)
 copy constructor
 ConstReferenceCounting (const ReferenceCounting< ReferencedClass > &O)
 copy constructor
 ConstReferenceCounting (const ReferencedClass *ref)
 copy constructor
 ConstReferenceCounting ()
 Allows construction.
 ~ConstReferenceCounting ()
 Destructor.

Private Member Functions

void eraseData ()
 destroys the datas.

Private Attributes

ReferenceCountingCenterRCC
 The ReferenceCountingCenter.
const ReferencedClass__ref
 The address of the referenced object.

Friends

class ReferenceCountingCenter
class ReferenceCounting< ReferencedClass >


Detailed Description

template<typename ReferencedClass>
class ConstReferenceCounting< ReferencedClass >

Definition at line 147 of file ReferenceCounting.hpp.


Constructor & Destructor Documentation

template<typename ReferencedClass>
ConstReferenceCounting< ReferencedClass >::ConstReferenceCounting ( const ConstReferenceCounting< ReferencedClass > &  O  )  [inline]

copy constructor

Definition at line 267 of file ReferenceCounting.hpp.

00268     : RCC(ReferenceCountingCenter::instance()),
00269       __ref(O.__ref)
00270   {
00271 #ifndef NDEBUG
00272     fflog(4) << __ref << ':' << numberOfReferences()
00273              << ": create ConstReferenceCounting on "
00274              << typeid(__ref).name() << '\n';
00275 #endif // NDEBUG
00276     RCC.addReference(*this);
00277   }

template<typename ReferencedClass>
ConstReferenceCounting< ReferencedClass >::ConstReferenceCounting ( const ReferenceCounting< ReferencedClass > &  O  )  [inline]

copy constructor

Definition at line 280 of file ReferenceCounting.hpp.

00281     : RCC(ReferenceCountingCenter::instance()),
00282       __ref(O.__ref)
00283   {
00284 #ifndef NDEBUG
00285     fflog(4) << __ref << ':' << numberOfReferences()
00286              << ": create ~copy ConstReferenceCounting on "
00287              << typeid(__ref).name() << '\n';
00288 #endif // NDEBUG
00289     RCC.addReference(*this);
00290   }

template<typename ReferencedClass>
ConstReferenceCounting< ReferencedClass >::ConstReferenceCounting ( const ReferencedClass ref  )  [inline]

copy constructor

Definition at line 293 of file ReferenceCounting.hpp.

00294     : RCC(ReferenceCountingCenter::instance()),
00295       __ref(ref)
00296   {
00297 #ifndef NDEBUG
00298     fflog(4) << __ref << ':' << numberOfReferences()
00299              << ": create ConstReferenceCounting on "
00300              << typeid(__ref).name() << '\n';
00301 #endif // NDEBUG
00302     RCC.addReference(*this);
00303   }

template<typename ReferencedClass>
ConstReferenceCounting< ReferencedClass >::ConstReferenceCounting (  )  [inline]

Allows construction.

Definition at line 306 of file ReferenceCounting.hpp.

00307     : RCC(ReferenceCountingCenter::instance()),
00308       __ref(0)
00309   {
00310 #ifndef NDEBUG
00311     fflog(4) << __ref << ':' << numberOfReferences()
00312              << ": create ConstReferenceCounting on "
00313              << typeid(__ref).name() << '\n';
00314 #endif // NDEBUG
00315     RCC.addReference(*this);
00316   }

template<typename ReferencedClass>
ConstReferenceCounting< ReferencedClass >::~ConstReferenceCounting (  )  [inline]

Destructor.

Definition at line 319 of file ReferenceCounting.hpp.

00320   {
00321 #ifndef NDEBUG
00322     fflog(4) << __ref << ':' << numberOfReferences()
00323              << ": remove ConstReferenceCounting on "
00324              << typeid(__ref).name() << '\n';
00325 #endif // NDEBUG
00326     RCC.removeReference(*this);
00327   }


Member Function Documentation

template<typename ReferencedClass>
void ConstReferenceCounting< ReferencedClass >::eraseData (  )  [inline, private]

destroys the datas.

Definition at line 161 of file ReferenceCounting.hpp.

00162   {
00163     delete __ref;
00164   }

template<typename ReferencedClass>
std::string ConstReferenceCounting< ReferencedClass >::typeName (  )  const [inline]

Definition at line 169 of file ReferenceCounting.hpp.

Referenced by OctreeMeshBuilder::buildMesh().

00170   {
00171     return typeid(__ref).name();
00172   }

template<typename ReferencedClass>
bool ConstReferenceCounting< ReferencedClass >::operator== ( const ReferencedClass ref  )  const [inline]

Definition at line 175 of file ReferenceCounting.hpp.

00176   {
00177     return (__ref == ref);
00178   }

template<typename ReferencedClass>
bool ConstReferenceCounting< ReferencedClass >::operator!= ( const ReferencedClass ref  )  const [inline]

Definition at line 180 of file ReferenceCounting.hpp.

00181   {
00182     return (__ref != ref);
00183   }

template<typename ReferencedClass>
bool ConstReferenceCounting< ReferencedClass >::operator== ( const ReferenceCounting< ReferencedClass > &  rc  )  const [inline]

Definition at line 185 of file ReferenceCounting.hpp.

00186   {
00187     return (__ref == rc.__ref);
00188   }

template<typename ReferencedClass>
bool ConstReferenceCounting< ReferencedClass >::operator!= ( const ReferenceCounting< ReferencedClass > &  rc  )  const [inline]

Definition at line 190 of file ReferenceCounting.hpp.

00191   {
00192     return (__ref != rc.__ref);
00193   }

template<typename ReferencedClass>
bool ConstReferenceCounting< ReferencedClass >::operator== ( const ConstReferenceCounting< ReferencedClass > &  rc  )  const [inline]

Definition at line 195 of file ReferenceCounting.hpp.

00196   {
00197     return (__ref == rc.__ref);
00198   }

template<typename ReferencedClass>
bool ConstReferenceCounting< ReferencedClass >::operator!= ( const ConstReferenceCounting< ReferencedClass > &  rc  )  const [inline]

Definition at line 200 of file ReferenceCounting.hpp.

00201   {
00202     return (__ref != rc.__ref);
00203   }

template<typename ReferencedClass>
const size_t& ConstReferenceCounting< ReferencedClass >::numberOfReferences (  )  const [inline]

template<typename ReferencedClass>
ConstReferenceCounting< ReferencedClass >::operator const ReferencedClass * (  )  const [inline]

Implicit const cast to ReferencedClass*.

Definition at line 212 of file ReferenceCounting.hpp.

00213   {
00214     return __ref;
00215   }

template<typename ReferencedClass>
const ReferencedClass* ConstReferenceCounting< ReferencedClass >::operator-> (  )  const [inline]

read-only access to the referenced value

Returns:
the referenced value

Definition at line 223 of file ReferenceCounting.hpp.

00224   {
00225     ASSERT(__ref != 0);
00226     return __ref;
00227   }

template<typename ReferencedClass>
const ReferencedClass& ConstReferenceCounting< ReferencedClass >::operator* (  )  const [inline]

read-only access to the referenced value

Returns:
the referenced value

Definition at line 235 of file ReferenceCounting.hpp.

00236   {
00237     ASSERT(__ref != 0);
00238     return *__ref;
00239   }

template<typename ReferencedClass>
const ConstReferenceCounting<ReferencedClass>& ConstReferenceCounting< ReferencedClass >::operator= ( const ConstReferenceCounting< ReferencedClass > &  O  )  [inline]

operator=

Definition at line 243 of file ReferenceCounting.hpp.

00244   {
00245 #ifndef NDEBUG
00246     fflog(4)
00247       << __ref << ':' << this->numberOfReferences()
00248       << ": remove operator=(ConstReferenceCounting<T>&) ConstReferenceCounting on "
00249       << typeid(__ref).name() << '\n';
00250 #endif // NDEBUG
00251     RCC.removeReference(*this);
00252 
00253     __ref = O.__ref;
00254 
00255 #ifndef NDEBUG
00256     fflog(4)
00257       << __ref << ':' << numberOfReferences()
00258       << ": create operator=(ConstReferenceCounting<T>&) ConstReferenceCounting on "
00259       << typeid(__ref).name() << '\n';
00260 #endif // NDEBUG
00261     RCC.addReference(*this);
00262 
00263     return *this;
00264   }


Friends And Related Function Documentation

template<typename ReferencedClass>
friend class ReferenceCountingCenter [friend]

Definition at line 149 of file ReferenceCounting.hpp.

template<typename ReferencedClass>
friend class ReferenceCounting< ReferencedClass > [friend]

Definition at line 151 of file ReferenceCounting.hpp.


Member Data Documentation

template<typename ReferencedClass>
ReferenceCountingCenter& ConstReferenceCounting< ReferencedClass >::RCC [private]

template<typename ReferencedClass>
const ReferencedClass* ConstReferenceCounting< ReferencedClass >::__ref [private]


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

Generated on Wed Nov 19 00:05:14 2008 for FreeFEM3D (aka ff3d) by  doxygen 1.5.6