oasys::PointerHandle< _PtrType > Class Template Reference

#include <PointerHandle.h>

List of all members.


Detailed Description

template<typename _PtrType>
class oasys::PointerHandle< _PtrType >

Implements a handle which can be invalidated. This then can be used to create a set of handles which have some caching/invalidation policy.

Definition at line 34 of file PointerHandle.h.


Public Member Functions

 PointerHandle ()
virtual ~PointerHandle ()
_PtrType * ptr () const
 
Returns:
Original pointer

_PtrType & operator * () const
 referencing operations will resurrect pointers if need be
_PtrType * operator-> () const
 referencing operations will resurrect pointers if need be

Protected Member Functions

virtual void invalidate () const =0
virtual void restore () const =0
virtual void update () const =0
void restore_and_update () const

Protected Attributes

_PtrType * ptr_

Constructor & Destructor Documentation

template<typename _PtrType>
oasys::PointerHandle< _PtrType >::PointerHandle (  )  [inline]

Adds the pointer to the cache.

Definition at line 39 of file PointerHandle.h.

template<typename _PtrType>
virtual oasys::PointerHandle< _PtrType >::~PointerHandle (  )  [inline, virtual]

Unregisters the contained pointer from the cache.

Definition at line 44 of file PointerHandle.h.

References oasys::PointerHandle< _PtrType >::ptr_.


Member Function Documentation

template<typename _PtrType>
_PtrType& oasys::PointerHandle< _PtrType >::operator * (  )  const [inline]

referencing operations will resurrect pointers if need be

Definition at line 47 of file PointerHandle.h.

References oasys::PointerHandle< _PtrType >::ptr_, and oasys::PointerHandle< _PtrType >::restore_and_update().

template<typename _PtrType>
_PtrType* oasys::PointerHandle< _PtrType >::operator-> (  )  const [inline]

referencing operations will resurrect pointers if need be

Definition at line 51 of file PointerHandle.h.

References oasys::PointerHandle< _PtrType >::ptr_, and oasys::PointerHandle< _PtrType >::restore_and_update().

template<typename _PtrType>
_PtrType* oasys::PointerHandle< _PtrType >::ptr (  )  const [inline]

Returns:
Original pointer

Definition at line 58 of file PointerHandle.h.

References oasys::PointerHandle< _PtrType >::ptr_, and oasys::PointerHandle< _PtrType >::restore_and_update().

template<typename _PtrType>
virtual void oasys::PointerHandle< _PtrType >::invalidate (  )  const [protected, pure virtual]

Invalidate and free the resources associated with this pointer. Invalid pointers are null pointers.

template<typename _PtrType>
virtual void oasys::PointerHandle< _PtrType >::restore (  )  const [protected, pure virtual]

Restore the resources associated with this pointer. Assumes the pointer is invalid.

Referenced by oasys::PointerHandle< _PtrType >::restore_and_update().

template<typename _PtrType>
virtual void oasys::PointerHandle< _PtrType >::update (  )  const [protected, pure virtual]

Update usage information (e.g. for LRU)

Referenced by oasys::PointerHandle< _PtrType >::restore_and_update().

template<typename _PtrType>
void oasys::PointerHandle< _PtrType >::restore_and_update (  )  const [inline, protected]

Definition at line 83 of file PointerHandle.h.

References ASSERT, oasys::PointerHandle< _PtrType >::ptr_, oasys::PointerHandle< _PtrType >::restore(), and oasys::PointerHandle< _PtrType >::update().

Referenced by oasys::PointerHandle< _PtrType >::operator *(), oasys::PointerHandle< _PtrType >::operator->(), and oasys::PointerHandle< _PtrType >::ptr().


Member Data Documentation

template<typename _PtrType>
_PtrType* oasys::PointerHandle< _PtrType >::ptr_ [mutable, protected]

Definition at line 64 of file PointerHandle.h.

Referenced by oasys::PointerHandle< _PtrType >::operator *(), oasys::PointerHandle< _PtrType >::operator->(), oasys::PointerHandle< _PtrType >::ptr(), oasys::PointerHandle< _PtrType >::restore_and_update(), and oasys::PointerHandle< _PtrType >::~PointerHandle().


The documentation for this class was generated from the following file:
Generated on Sat Sep 8 08:36:26 2007 for DTN Reference Implementation by  doxygen 1.5.3