BazisLib::ObjectManager::ManagedPointer< _ManagedType > Class Template Reference

Represents a managed pointer to an object. More...

#include <objmgr.h>

Inherits ConstManagedPointer< _ManagedType >.

Collaboration diagram for BazisLib::ObjectManager::ManagedPointer< _ManagedType >:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 ManagedPointer (_ManagedType *pTarget=NULL)
 ManagedPointer (const ManagedPointer &ref)
 ManagedPointer (const ConstManagedPointer &ref)
 ~ManagedPointer ()
ManagedPointer< _ManagedType > & operator= (_ManagedType *pObj)
ManagedPointer< _ManagedType > & operator= (const ManagedPointer &pObj)
ManagedPointer< _ManagedType > & operator= (const ConstManagedPointer &pObj)
_ManagedType * operator-> () const
 operator bool ()
 operator bool () const

Private Member Functions

void EnsureCorrectAllocation ()
 Ensures that the object is NOT a part of a heap-allocated managed object.
 operator _ManagedType * ()
ManagedPointer< _ManagedType > & Assign (_ManagedType *pObj, bool Release)
 Sets a new value for a parent service reference.

Friends

class ParentServiceReference


Detailed Description

template<class _ManagedType>
class BazisLib::ObjectManager::ManagedPointer< _ManagedType >

Represents a managed pointer to an object.

This class represents a managed pointer to an object capable of dealing with the reference count.

Remarks:
Avoid declaring ManagedPointer fields in managed objects. Use the DECLARE_REFERENCE() instead. Note that the debug build of the framework detects such problems.

Constructor & Destructor Documentation

template<class _ManagedType >
BazisLib::ObjectManager::ManagedPointer< _ManagedType >::ManagedPointer ( _ManagedType *  pTarget = NULL  )  [inline]

template<class _ManagedType >
BazisLib::ObjectManager::ManagedPointer< _ManagedType >::ManagedPointer ( const ManagedPointer< _ManagedType > &  ref  )  [inline]

template<class _ManagedType >
BazisLib::ObjectManager::ManagedPointer< _ManagedType >::ManagedPointer ( const ConstManagedPointer< _ManagedType > &  ref  )  [inline]

template<class _ManagedType >
BazisLib::ObjectManager::ManagedPointer< _ManagedType >::~ManagedPointer (  )  [inline]


Member Function Documentation

template<class _ManagedType >
ManagedPointer<_ManagedType>& BazisLib::ObjectManager::ManagedPointer< _ManagedType >::Assign ( _ManagedType *  pObj,
bool  Release 
) [inline, private]

Sets a new value for a parent service reference.

This method is internally used by the assignment operator

Parameters:
pObj Object to assign
Release If this parameter is true, the pointed object will not be retained. It is set to true only when an operator received an unmanaged pointer from user.

template<class _ManagedType >
void BazisLib::ObjectManager::ManagedPointer< _ManagedType >::EnsureCorrectAllocation (  )  [inline, private]

Ensures that the object is NOT a part of a heap-allocated managed object.

template<class _ManagedType >
BazisLib::ObjectManager::ManagedPointer< _ManagedType >::operator _ManagedType * (  )  [inline, private]

template<class _ManagedType >
BazisLib::ObjectManager::ManagedPointer< _ManagedType >::operator bool (  )  const [inline]

template<class _ManagedType >
BazisLib::ObjectManager::ManagedPointer< _ManagedType >::operator bool (  )  [inline]

template<class _ManagedType >
_ManagedType* BazisLib::ObjectManager::ManagedPointer< _ManagedType >::operator-> (  )  const [inline]

template<class _ManagedType >
ManagedPointer<_ManagedType>& BazisLib::ObjectManager::ManagedPointer< _ManagedType >::operator= ( const ConstManagedPointer< _ManagedType > &  pObj  )  [inline]

template<class _ManagedType >
ManagedPointer<_ManagedType>& BazisLib::ObjectManager::ManagedPointer< _ManagedType >::operator= ( const ManagedPointer< _ManagedType > &  pObj  )  [inline]

template<class _ManagedType >
ManagedPointer<_ManagedType>& BazisLib::ObjectManager::ManagedPointer< _ManagedType >::operator= ( _ManagedType *  pObj  )  [inline]


Friends And Related Function Documentation

template<class _ManagedType >
friend class ParentServiceReference [friend]


The documentation for this class was generated from the following file:
SourceForge.net Logo