Xrtti::Base Class Reference

#include <Xrtti.h>

List of all members.

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 StructureGetStructure () const =0
virtual bool IsCastable () const =0
virtual void * CastSubclass (void *pObject) const =0


Detailed Description

************************************************************************** Base describes a super class (or super struct or super union) of a class, struct, or union. It gives both the Structure that is the base class, and also the offset from the sub class to the super class; this is the value which, when added to a pointer to a sub class, yields a pointer to the base class.

Constructor & Destructor Documentation

virtual Xrtti::Base::~Base (  )  [inline, virtual]


Member Function Documentation

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.

Parameters:
other is the other object to compare against
Returns:
true if this object is functionally equal to the other, false if not

bool Xrtti::Base::operator!= ( const Base other  )  const [inline]

Inequality operator - returns false when the == operator would return true, and vice versa.

Parameters:
other is the other object to compare against
Returns:
false when the == operator would return true, and vice versa.

virtual AccessType Xrtti::Base::GetAccessType (  )  const [pure virtual]

Returns the access privileges granted to the subclass by this base class.

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.

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.

Returns:
the structure which is the base class/struct/union.

virtual bool Xrtti::Base::IsCastable (  )  const [pure virtual]

Returns true if this Base is "castable", meaning that the CastSubclass method of this class may be called. If this method returns false, then the CastSubclass method must NOT be called.

Returns:
true if this Base is "accessible", meaning that the CastSubclass method of this class may be called

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()

Parameters:
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()
Returns:
pObject cast to an instance of the base class described by this Base object


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

Generated on Sat Feb 14 22:48:49 2009 by  doxygen 1.5.7.1