#include <Xrtti.h>
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 Base & | GetBase (u32 index) const =0 |
virtual u32 | GetFriendCount () const =0 |
virtual const Structure & | GetFriend (u32 index) const =0 |
virtual u32 | GetFieldCount () const =0 |
virtual const Field & | GetField (u32 index) const =0 |
virtual bool | IsAnonymous () const =0 |
virtual u32 | GetConstructorCount () const =0 |
virtual const Constructor & | GetConstructor (u32 index) const =0 |
virtual bool | HasDestructor () const =0 |
virtual const Destructor & | GetDestructor () 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 |
virtual Xrtti::Structure::~Structure | ( | ) | [inline, virtual] |
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.
other | is the other object to compare against |
bool Xrtti::Structure::operator!= | ( | const Structure & | 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 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.
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.
virtual u32 Xrtti::Structure::GetSizeof | ( | ) | const [pure virtual] |
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".
virtual AccessType Xrtti::Structure::GetAccessType | ( | ) | const [pure virtual] |
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.
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.
virtual u32 Xrtti::Structure::GetFriendCount | ( | ) | const [pure virtual] |
virtual u32 Xrtti::Structure::GetFieldCount | ( | ) | const [pure virtual] |
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.
virtual u32 Xrtti::Structure::GetConstructorCount | ( | ) | const [pure virtual] |
virtual const Constructor& Xrtti::Structure::GetConstructor | ( | u32 | index | ) | const [pure virtual] |
Returns a constructor of this Structure.
index | is the number of the Constructor to return |
virtual bool Xrtti::Structure::HasDestructor | ( | ) | const [pure virtual] |
virtual const Destructor& Xrtti::Structure::GetDestructor | ( | ) | const [pure virtual] |
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.
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.
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.
count | is the number of elements in the array to be created |
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.
virtual void Xrtti::Structure::Delete | ( | void * | pInstance | ) | const [pure virtual] |
Deletes an object created by the Create() method.
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.
pInstanceArray | is the array of objects to be deleted. |