Encapsuled pointer class for pointers pointing to derived classes.
More...
#include </home/werner/origo/vish/memcore/DynPtr.hpp>
List of all members.
Public Types
Public Member Functions
-
const DynPtr & getDynPtr () const throw ()
- Convenience type cast to dynamic pointer class.
-
const type_info & getType () const throw ()
- Return type info of associated object, typeid(NullPtr) or typeid(void) if none.
- bool isAssignable (const DynPtr< ObjectBase, ObjectBase > &Other) const throw ()
- Check whether a given pointer to a base class may be assigned to a pointer of the derived class.
-
Object * rawptr () const throw ()
-
void speak (const char *s, const char *prefix="") const throw ()
- Print some debug messages to the console.
|
- operator void * () const throw ()
- Check if the pointer is valid.
- bool operator! () const throw ()
- Check if the pointer is invalid.
Static Public Member Functions
-
static const DynPtr & getNullPtr () throw ()
- Associated static NullPtr - avoids creation of a temporary object when a reference is needed.
Protected Types
-
typedef DynPtr< ObjectBase,
ObjectBase > DynPtrBase_t
Protected Member Functions
-
void assignReferer (const DynPtr< ObjectBase, ObjectBase > &P) throw ()
-
void assignReferer (const NullPtr &Null) throw ()
-
DynPtr (Object *Obj, const SelfInitialize &) throw ()
-
DynPtr (const NullPtr &) throw ()
-
DynPtr (Object *Obj, const NotNullPtr &) throw ()
-
DynPtr (Referer< ObjectBase > *SomeReferer) throw ()
-
template<class AnyObject > DynPtr (const DynPtr< AnyObject, ObjectBase > &Other) throw ()
- Implicit type conversion within the same class hierarchy Any pointer.
-
void force_destroy () throw ()
-
void invalidateReferer () throw ()
-
void operator= (const DynPtr< ObjectBase, ObjectBase > &P) throw ()
Protected Attributes
Related Functions
(Note that these are not member functions.)
-
void Speak (const char *s, const char *prefix="") const
- Verbose information printing for this pointer.
Detailed Description
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
bool MemCore::DynPtr::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.
MemCore::DynPtr::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.
bool MemCore::DynPtr::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: