Xrtti::Structure Class Reference

#include <Xrtti.h>

Inheritance diagram for Xrtti::Structure:

Xrtti::Context Xrtti::Struct Xrtti::Union Xrtti::Class

List of all members.

Public Member Functions

virtual ~Structure ()
bool operator== (const Structure &other) const
bool operator!= (const Structure &other) const
virtual bool IsIncomplete () const =0
virtual bool HasSizeof () const =0
virtual u32 GetSizeof () const =0
virtual bool HasStructureName () const =0
virtual AccessType GetAccessType () const =0
virtual const std::type_info * GetTypeInfo () const =0
virtual u32 GetBaseCount () const =0
virtual const BaseGetBase (u32 index) const =0
virtual u32 GetFriendCount () const =0
virtual const StructureGetFriend (u32 index) const =0
virtual u32 GetFieldCount () const =0
virtual const FieldGetField (u32 index) const =0
virtual bool IsAnonymous () const =0
virtual u32 GetConstructorCount () const =0
virtual const ConstructorGetConstructor (u32 index) const =0
virtual bool HasDestructor () const =0
virtual const DestructorGetDestructor () const =0
virtual bool IsCreatable () const =0
virtual void * Create () const =0
virtual void * CreateArray (u32 count) const =0
virtual bool IsDeletable () const =0
virtual void Delete (void *pInstance) const =0
virtual void DeleteArray (void *pInstanceArray) const =0


Detailed Description

************************************************************************** Structure is the base class for Class, Struct, and Union. It defines the members that are shared by these three context types.

Constructor & Destructor Documentation

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


Member Function Documentation

bool Xrtti::Structure::operator== ( const Structure 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::Structure::operator!= ( const Structure 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 bool Xrtti::Structure::IsIncomplete (  )  const [pure virtual]

If the Structure is Incomplete, its definition is not present in the Xrtti system. None of the remaining methods of the class will return anything meaningful; only the methods of Context will return any valid information.

Returns:
true if the Structure is incomplete, meaning that although it was declared, no definition was given for it and virtually no information will be available about it

virtual bool Xrtti::Structure::HasSizeof (  )  const [pure virtual]

Returns true if this Structure object can report the size of the described C++ structure via the GetSizeof() method, false if it cannot.

Returns:
true if this Structure object can report the size of the described C++ structure via the GetSizeof() method, false if it cannot.

virtual u32 Xrtti::Structure::GetSizeof (  )  const [pure virtual]

Returns the size of an instance of this Structure in memory, as would be the result of a sizeof() operation on the C++ type described by this Structure.

Returns:
the size of an instance of this Structure in memory, as would be the result of a sizeof() operation on the C++ type described by this Structure.

virtual bool Xrtti::Structure::HasStructureName (  )  const [pure virtual]

Each Structure type (class, struct, union) can be defined in three possible ways in C++, as illustrated by this example:

struct a { };

typedef struct b { } b;

typedef struct { } c;

(a) and (b) are essentially equivalent in C++; for (a), an implicit typedef of "a" to "struct a" will be in effect, *unless* there is another symbol defined as "a" (for example, a function name).

(c) is different in that there is no "struct c" construct, there is only a typedef of "c" defining an unnamed structured type.

In Xrtti, a Structure object will be created for all of (a), (b), and (c), and they will be indistinguishable, except that HasStructureName() will return true for (a) and (b), and false for (c).

If HasStructureName returns true, then it is safe (and sometimes necessary) to refer to the structure as "struct a" (or "class a" or "union a" depending on the actual type of the Structure). If HasStructureName returns false, then the Structure can only be referred to by name, never by "struct a", "class b", or "union c".

Returns:
true if "class/struct/union <this->GetFullName()>" is a valid C++ construct, false if not

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

Returns the access type of the Struct within the context in which it is defined.

Returns:
the access type of the Struct within the context in which it is defined.

virtual const std::type_info* Xrtti::Structure::GetTypeInfo (  )  const [pure virtual]

If the -r option was specified to the xrttigen program, then C++ RTTI type_info objects will be associated with each Structure. This method will then return the type_info object associated with the C++ class/struct/union described by this Structure.

If -r was not used with xrttigen, then C++ RTTI is not supported, and this method will return NULL.

Returns:
the C++ RTTI type_info object associated with the C++ class/ struct/union described by this Structure, or NULL if RTTI options were not enabled for xrttigen when it produced the Generated object resulting in this Structure.

virtual u32 Xrtti::Structure::GetBaseCount (  )  const [pure virtual]

This is the number of base structures of this Structure. Base structures are, in essential, base classes, although they are not necessarily classes; they may be structs or unions as well. The Base class identifies both the base Structure, and the offset from this structure to the base class.

Returns:
the number of base structures of this Structure

virtual const Base& Xrtti::Structure::GetBase ( u32  index  )  const [pure virtual]

Returns a base structure of this Structure.

Parameters:
index is the number of the base Structure to return
Returns:
a base structure of this Structure.

virtual u32 Xrtti::Structure::GetFriendCount (  )  const [pure virtual]

Returns the number of friends of this Structure.

Returns:
the number of friends of this Structure.

virtual const Structure& Xrtti::Structure::GetFriend ( u32  index  )  const [pure virtual]

Returns a Structure which was declared to be a friend of this Structure.

Parameters:
index is the number of the friend to return
Returns:
a friend of this Structure.

virtual u32 Xrtti::Structure::GetFieldCount (  )  const [pure virtual]

Returns the number of Fields in this Context.

Returns:
the number of Fields in this Context.

virtual const Field& Xrtti::Structure::GetField ( u32  index  )  const [pure virtual]

Returns a Field of this Structure. These are in the same order as in defined in the C++ class described by this Structure. The number of Fields in this Structure is given by the return value of GetFieldCount().

Parameters:
index is the number of the Field to return
Returns:
a Field of this Structure.

virtual bool Xrtti::Structure::IsAnonymous (  )  const [pure virtual]

Returns true if the Structure is anonymous. Anonymous structures have no type name and thus cannot be instantiated. Therefore, the Constructors will not be invokeable; and the Create and CreateArray methods will return NULL. If this structure or any containing structure is anonymous, then this will return true.

Returns:
true if the Structure is anonymous; false if not.

virtual u32 Xrtti::Structure::GetConstructorCount (  )  const [pure virtual]

This is the number of constructors of this Structure.

Returns:
the number of constructors of this Structure

virtual const Constructor& Xrtti::Structure::GetConstructor ( u32  index  )  const [pure virtual]

Returns a constructor of this Structure.

Parameters:
index is the number of the Constructor to return
Returns:
a constructor of this Structure.

virtual bool Xrtti::Structure::HasDestructor (  )  const [pure virtual]

Returns true if this Structure has a destructor, false if not.

Returns:
true if this Structure has a destructor, false if not.

virtual const Destructor& Xrtti::Structure::GetDestructor (  )  const [pure virtual]

Returns the destructor of this Structure, if one exists; this method should only by called if HasDestructor returns true.

Returns:
the destructor of this Structure, if one exists

virtual bool Xrtti::Structure::IsCreatable (  )  const [pure virtual]

Returns true if the Structure can be created. Only if this method returns true may the Create() method or CreateArray() methods be called.

Returns:
true if the Structure can be created. Only if this method returns true may the Create() method or CreateArray() methods be called.

virtual void* Xrtti::Structure::Create (  )  const [pure virtual]

Returns a newly-constructed object of this Structure type; the default constructor is used. The returned object must be deleted using the Delete() method. If the Structure is not creatable, this method must not be called.

Returns:
a newly-constructed object of this Structure type; the default constructor is used.

virtual void* Xrtti::Structure::CreateArray ( u32  count  )  const [pure virtual]

Returns a newly-constructed array of objects of this Structure type; the default array constructor is used. The returned array must be deleted using the DeleteArray() method. If the Structure is not creatable, this method must not be called.

Parameters:
count is the number of elements in the array to be created
Returns:
a newly-created array of objects of this Structure type; the default constructor is used.

virtual bool Xrtti::Structure::IsDeletable (  )  const [pure virtual]

Returns true if the Structure can be deleted. Only if this method returns true may the Delete() method or DeleteArray() methods be called.

Returns:
true if the Structure can be deleted. Only if this method returns true may the Delete() method or DeleteArray() methods be called.

virtual void Xrtti::Structure::Delete ( void *  pInstance  )  const [pure virtual]

Deletes an object created by the Create() method.

Parameters:
pInstance is the object to be deleted.

virtual void Xrtti::Structure::DeleteArray ( void *  pInstanceArray  )  const [pure virtual]

Deletes an array of objects created by the CreateArray() method.

Parameters:
pInstanceArray is the array of objects to be deleted.


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