Main Page | Namespace List | Class Hierarchy | Compound List | File List | Namespace Members | Compound Members | File Members | Related Pages

rfl::Type Class Reference

#include <Type.hh>

Inheritance diagram for rfl::Type:

Inheritance graph
[legend]
Collaboration diagram for rfl::Type:

Collaboration graph
[legend]
List of all members.

Public Types

enum  Id {
  ID_VOID = 0, ID_BOOL, ID_CHAR, ID_UCHAR,
  ID_SHORT, ID_USHORT, ID_INT, ID_UINT,
  ID_LONG, ID_ULONG, ID_FLOAT, ID_DOUBLE,
  ID_FUNDAMENTAL_END, ID_PTR = ID_FUNDAMENTAL_END, ID_ARRAY, ID_CLASS,
  ID_FUNCTION
}

Public Member Functions

 Type (Id id, const::mpu::String &name, std::size_t size, std::size_t alignment, std::size_t elementNum, const std::type_info *typeId, void(*create)(const Type *, void *), void(*cCreate)(const Type *, void *, const void *), void(*destroy)(const Type *, void *), void(*assign)(const Type *, void *, const void *), void *(*newObj)(const Type *), void *(*newCopy)(const Type *, const void *), void(*delObj)(const Type *, void *))
virtual ~Type (void)
Id getId (void) const
const std::type_info * getTypeId (void)
const mpu::String & getName (void) const
std::size_t getSize (void) const
std::size_t getAlignment (void) const
void create (void *addr) const
void create (void *addr, const void *obj) const
void destroy (void *obj) const
void assign (void *dst, const void *src) const
void * newObj (void) const
void * newObj (const void *obj) const
void delObj (void *obj) const
virtual void avStartCall (av_alist &avList, void *fnPtr, void *retVal) const=0
virtual void avPutArg (av_alist &avList, void *arg) const=0
std::size_t getElmNo (void) const
virtual const TypegetElmType (std::size_t idx) const=0
virtual void * getElmAddr (void *obj, std::size_t idx) const=0
const void * getElmAddr (const void *obj, std::size_t idx) const
virtual unsigned long hash (void) const=0
virtual bool operator== (const Type &type) const=0
bool operator!= (const Type &type) const
AspectValueaspectData (Aspect::Id id)
const AspectValueaspectData (Aspect::Id id) const

Static Protected Member Functions

void updateHash (unsigned long &h, unsigned long id)

Protected Attributes

std::size_t elmNo_
mpu::String name_
void(* create_ )(const Type *, void *)
void(* cCreate_ )(const Type *, void *, const void *)
void(* destroy_ )(const Type *, void *)
void(* assign_ )(const Type *, void *, const void *)
void *(* newObj_ )(const Type *)
void *(* newCopy_ )(const Type *, const void *)
void(* delObj_ )(const Type *, void *)

Detailed Description

This is the central class of the reflection system. A Type object describes the structure of arbitrary objects. Theses types can be subdivided into the following kinds:

See also:
FundamentalType, PointerType, ArrayType, ClassType, FunctionType.


Member Enumeration Documentation

enum rfl::Type::Id
 

This enum type should be used to quickly distinguish the different types that can be reflected. In contrast to getTypeId() the Id is always provided by Type objects.

See also:
rfl::Type::getTypeId()
Enumeration values:
ID_VOID 
ID_BOOL 
ID_CHAR 
ID_UCHAR 
ID_SHORT 
ID_USHORT 
ID_INT 
ID_UINT 
ID_LONG 
ID_ULONG 
ID_FLOAT 
ID_DOUBLE 
ID_FUNDAMENTAL_END  Use this to detect fundamental types, e.g.: t.getid() < rfl::Type::ID_FUNDAMENTAL_END
ID_PTR 
ID_ARRAY 
ID_CLASS 
ID_FUNCTION 


Constructor & Destructor Documentation

rfl::Type::Type Id  id,
const ::mpu::String &  name,
std::size_t  size,
std::size_t  alignment,
std::size_t  elementNum,
const std::type_info *  typeId,
void(*  create)(const Type *, void *),
void(*  cCreate)(const Type *, void *, const void *),
void(*  destroy)(const Type *, void *),
void(*  assign)(const Type *, void *, const void *),
void *(*  newObj)(const Type *),
void *(*  newCopy)(const Type *, const void *),
void(*  delObj)(const Type *, void *)
[inline]
 

virtual rfl::Type::~Type void   )  [inline, virtual]
 


Member Function Documentation

const AspectValue & rfl::Type::aspectData Aspect::Id  id  )  const [inline]
 

AspectValue & rfl::Type::aspectData Aspect::Id  id  )  [inline]
 

void rfl::Type::assign void *  dst,
const void *  src
const
 

virtual void rfl::Type::avPutArg av_alist &  avList,
void *  arg
const [pure virtual]
 

Implemented in rfl::ArrayType, rfl::CFunctionType, rfl::ClassType, and rfl::PointerType.

virtual void rfl::Type::avStartCall av_alist &  avList,
void *  fnPtr,
void *  retVal
const [pure virtual]
 

Implemented in rfl::ArrayType, rfl::CFunctionType, rfl::ClassType, and rfl::PointerType.

void rfl::Type::create void *  addr,
const void *  obj
const
 

void rfl::Type::create void *  addr  )  const
 

void rfl::Type::delObj void *  obj  )  const
 

void rfl::Type::destroy void *  obj  )  const
 

std::size_t rfl::Type::getAlignment void   )  const [inline]
 

const void * rfl::Type::getElmAddr const void *  obj,
std::size_t  idx
const [inline]
 

virtual void* rfl::Type::getElmAddr void *  obj,
std::size_t  idx
const [pure virtual]
 

Implemented in rfl::ArrayType, rfl::CFunctionType, rfl::ClassType, rfl::FundamentalType, and rfl::PointerType.

std::size_t rfl::Type::getElmNo void   )  const [inline]
 

virtual const Type& rfl::Type::getElmType std::size_t  idx  )  const [pure virtual]
 

Implemented in rfl::ArrayType, rfl::CFunctionType, rfl::ClassType, rfl::FundamentalType, and rfl::PointerType.

Id rfl::Type::getId void   )  const [inline]
 

Retuns the id of the represented Type.

See also:
rfl::Type::Id

const mpu::String& rfl::Type::getName void   )  const [inline]
 

std::size_t rfl::Type::getSize void   )  const [inline]
 

const std::type_info* rfl::Type::getTypeId void   )  [inline]
 

The reflection library knows compiled types and dynamic types. For compiled types there is real compiled C++ code available. If this object represents a compiled type T, you'll get a pointer to the typeid(T). If it's a dynamic type, you'll get a NULL pointer.

virtual unsigned long rfl::Type::hash void   )  const [pure virtual]
 

This is a little helper to identify types with equal structure

Implemented in rfl::ArrayType, rfl::ClassType, rfl::FunctionType, and rfl::PointerType.

void* rfl::Type::newObj const void *  obj  )  const
 

void* rfl::Type::newObj void   )  const
 

bool rfl::Type::operator!= const Type type  )  const [inline]
 

virtual bool rfl::Type::operator== const Type type  )  const [pure virtual]
 

Implemented in rfl::ArrayType, rfl::ClassType, rfl::FunctionType, and rfl::PointerType.

void rfl::Type::updateHash unsigned long &  h,
unsigned long  id
[inline, static, protected]
 


Member Data Documentation

void(* rfl::Type::assign_)( const Type*, void*, const void* ) [protected]
 

void(* rfl::Type::cCreate_)( const Type*, void*, const void* ) [protected]
 

void(* rfl::Type::create_)( const Type*, void* ) [protected]
 

void(* rfl::Type::delObj_)( const Type*, void* ) [protected]
 

void(* rfl::Type::destroy_)( const Type*, void* ) [protected]
 

std::size_t rfl::Type::elmNo_ [protected]
 

mpu::String rfl::Type::name_ [protected]
 

void*(* rfl::Type::newCopy_)( const Type*, const void* ) [protected]
 

void*(* rfl::Type::newObj_)( const Type* ) [protected]
 


The documentation for this class was generated from the following file:
Generated on Thu Dec 18 11:33:03 2003 for Reflection&ServiceLibrary by doxygen 1.3.2