#include <Xrtti.h>
Public Member Functions | |
virtual | ~Base () |
bool | operator== (const Base &other) const |
bool | operator!= (const Base &other) const |
virtual AccessType | GetAccessType () const =0 |
virtual bool | IsVirtual () const =0 |
virtual const Structure & | GetStructure () const =0 |
virtual bool | IsCastable () const =0 |
virtual void * | CastSubclass (void *pObject) const =0 |
virtual Xrtti::Base::~Base | ( | ) | [inline, virtual] |
bool Xrtti::Base::operator== | ( | const Base & | other | ) | const |
Equality operator - returns true if this object is "functionally equivalent" to [other]. The two objects don't have to be exactly identical, but do have to be identical in every meaningful way. Note also that this doesn't test for equality of any base class members; it is a test only at this level of the inheritence hierarcy. To test if an object is completely equals, including for all of its subclasses defined in the Xrtti hierarchy, you must cast this class to its most derived class and call that method.
other | is the other object to compare against |
bool Xrtti::Base::operator!= | ( | const Base & | other | ) | const [inline] |
Inequality operator - returns false when the == operator would return true, and vice versa.
other | is the other object to compare against |
virtual AccessType Xrtti::Base::GetAccessType | ( | ) | const [pure virtual] |
Returns the access privileges granted to the subclass by this base class.
virtual bool Xrtti::Base::IsVirtual | ( | ) | const [pure virtual] |
Returns true if the subclass' inheritence via this base was virtual, false if not.
virtual const Structure& Xrtti::Base::GetStructure | ( | ) | const [pure virtual] |
Returns the structure which is the base class/struct/union.
virtual bool Xrtti::Base::IsCastable | ( | ) | const [pure virtual] |
virtual void* Xrtti::Base::CastSubclass | ( | void * | pObject | ) | const [pure virtual] |
Casts an instance of the immediate subclass/substruct, given by pObject, into an instance of the class/struct represented by this Base object. NOTE that pObject MUST be of the type described by the Structure object of which this Base class represents a base class/struct. Therefore the only proper use of this method is something like:
void *pObject; Structure *pStruct; // Type of pObject
void *pBase = (pStruct->GetBase(0)).CastSubclass(pObject); // The type of pBase is described by pStruct->GetBase(0).GetStructure()
pObject | is an instance of the base class from which this Base object was obtained; pObject will be cast to an object of the type described by GetStructure() |