Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Related Functions

DynPtr< Object, ObjectBase > Class Template Reference

Encapsuled pointer class for pointers pointing to derived classes. More...

#include <memcore/DynPtr.hpp>

Inheritance diagram for DynPtr< Object, ObjectBase >:
MemCore::WeakPtr< Object, ObjectBase > MemCore::WeakPtr< Object > MemCore::StrongPtr< Object >

List of all members.

Public Types

Public Member Functions

Validity Operators

Static Public Member Functions

Protected Member Functions

Protected Attributes

Related Functions

(Note that these are not member functions.)


Detailed Description

template<class Object, class ObjectBase>
class DynPtr< Object, ObjectBase >

Encapsuled pointer class for pointers pointing to derived classes.

It performs a native dynamic_cast<> on assignment and construction and caches the result.


Member Function Documentation

template<class Object, class ObjectBase>
bool DynPtr< Object, ObjectBase >::isAssignable ( const DynPtr< ObjectBase, ObjectBase > &  Other  )  const throw () [inline]

Check whether a given pointer to a base class may be assigned to a pointer of the derived class.

This function doesn't need to create a new pointer and is thus little lighter than pointer assignment, it basically just involves a dynamic_cast.

template<class Object, class ObjectBase>
DynPtr< Object, ObjectBase >::operator void * (  )  const throw () [inline]

Check if the pointer is valid.

Note that the referred object might still exist, but not be of the appropriate type.

template<class Object, class ObjectBase>
bool DynPtr< Object, ObjectBase >::operator! (  )  const throw () [inline]

Check if the pointer is invalid.

Note that the referred object might still exist, but not be of the appropriate type.


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