Field3D
RefBase Class Reference

#include <RefCount.h>

Inheritance diagram for RefBase:
CubicGenericFieldInterp< Field_T > CubicGenericFieldInterp< Field_T > CubicMACFieldInterp< Data_T > CubicMACFieldInterp< Data_T > FieldBase FieldBase FieldInterp< Data_T > FieldInterp< Data_T > FieldIO FieldIO FieldMapping FieldMapping FieldMappingIO FieldMappingIO File::Partition File::Partition LinearGenericFieldInterp< Field_T > LinearGenericFieldInterp< Field_T > LinearMACFieldInterp< Data_T > LinearMACFieldInterp< Data_T > ProceduralFieldLookup< Data_T > ProceduralFieldLookup< Data_T >

List of all members.

Public Types

typedef boost::intrusive_ptr
< RefBase
Ptr
typedef boost::intrusive_ptr
< RefBase
Ptr

Public Member Functions

void ref () const
 Used by boost::intrusive_pointer.
void ref () const
 Used by boost::intrusive_pointer.
size_t refcnt ()
 Used by boost::intrusive_pointer.
size_t refcnt ()
 Used by boost::intrusive_pointer.
void unref () const
 Used by boost::intrusive_pointer.
void unref () const
 Used by boost::intrusive_pointer.
Constructors, destructors, copying
 RefBase ()
 RefBase (const RefBase &)
 Copy constructor.
RefBaseoperator= (const RefBase &)
 Assignment operator.
virtual ~RefBase ()
 Destructor.
 RefBase ()
 RefBase (const RefBase &)
 Copy constructor.
RefBaseoperator= (const RefBase &)
 Assignment operator.
virtual ~RefBase ()
 Destructor.

Private Attributes

long m_counter
 For boost intrusive pointer.
boost::mutex m_refMutex
 Mutex for ref counting.

Detailed Description

Definition at line 64 of file RefCount.h.


Member Typedef Documentation


Constructor & Destructor Documentation

RefBase::RefBase ( ) [inline]

Definition at line 77 of file RefCount.h.

    : m_counter(0) 
  {}
RefBase::RefBase ( const RefBase ) [inline]

Copy constructor.

Definition at line 82 of file RefCount.h.

    : m_counter(0) 
  {}
virtual RefBase::~RefBase ( ) [inline, virtual]

Destructor.

Definition at line 91 of file RefCount.h.

  {}
RefBase::RefBase ( ) [inline]

Definition at line 77 of file RefCount.h.

    : m_counter(0) 
  {}
RefBase::RefBase ( const RefBase ) [inline]

Copy constructor.

Definition at line 82 of file RefCount.h.

    : m_counter(0) 
  {}
virtual RefBase::~RefBase ( ) [inline, virtual]

Destructor.

Definition at line 91 of file RefCount.h.

  {}

Member Function Documentation

RefBase& RefBase::operator= ( const RefBase ) [inline]

Assignment operator.

Definition at line 87 of file RefCount.h.

  { return *this; }
size_t RefBase::refcnt ( ) [inline]

Used by boost::intrusive_pointer.

Definition at line 97 of file RefCount.h.

References m_counter.

Referenced by intrusive_ptr_release().

  { return m_counter; }
void RefBase::ref ( ) const [inline]

Used by boost::intrusive_pointer.

Definition at line 101 of file RefCount.h.

References m_counter, and m_refMutex.

Referenced by intrusive_ptr_add_ref().

  { 
#ifndef FIELD3D_USE_ATOMIC_COUNT
    boost::mutex::scoped_lock lock(m_refMutex);
#endif
    ++m_counter; 
  }
void RefBase::unref ( ) const [inline]

Used by boost::intrusive_pointer.

Definition at line 110 of file RefCount.h.

References m_counter, and m_refMutex.

Referenced by intrusive_ptr_release().

  {
#ifndef FIELD3D_USE_ATOMIC_COUNT
    boost::mutex::scoped_lock lock(m_refMutex);
#endif
    --m_counter; 
    // since we use intrusive_pointer no need
    // to delete the object ourselves.
  }
RefBase& RefBase::operator= ( const RefBase ) [inline]

Assignment operator.

Definition at line 87 of file RefCount.h.

  { return *this; }
size_t RefBase::refcnt ( ) [inline]

Used by boost::intrusive_pointer.

Definition at line 97 of file RefCount.h.

References m_counter.

  { return m_counter; }
void RefBase::ref ( ) const [inline]

Used by boost::intrusive_pointer.

Definition at line 101 of file RefCount.h.

References m_counter, and m_refMutex.

  { 
#ifndef FIELD3D_USE_ATOMIC_COUNT
    boost::mutex::scoped_lock lock(m_refMutex);
#endif
    ++m_counter; 
  }
void RefBase::unref ( ) const [inline]

Used by boost::intrusive_pointer.

Definition at line 110 of file RefCount.h.

References m_counter, and m_refMutex.

  {
#ifndef FIELD3D_USE_ATOMIC_COUNT
    boost::mutex::scoped_lock lock(m_refMutex);
#endif
    --m_counter; 
    // since we use intrusive_pointer no need
    // to delete the object ourselves.
  }

Member Data Documentation

long RefBase::m_counter [mutable, private]

For boost intrusive pointer.

Definition at line 125 of file RefCount.h.

Referenced by ref(), refcnt(), and unref().

boost::mutex RefBase::m_refMutex [mutable, private]

Mutex for ref counting.

Definition at line 127 of file RefCount.h.

Referenced by ref(), and unref().


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