PUMA Library Reference Manual
Loading...
Searching...
No Matches
Puma::CTypeInfo Class Reference

#include <Puma/CTypeInfo.h>

+ Inheritance diagram for Puma::CTypeInfo:

Description

Type information for an entity (class, function, object, etc).

There are two kinds of types: fundamental types like 'int', and compound types like 'class X {int i;}'. Types describe objects, references, or functions.

A type is identified by its ID.

// check if type is a function type
if (type.Id() == Puma::CTypeInfo::TYPE_FUNCTION) {
...
}
// same check
if (type.TypeFunction()) {
...
}
// same check
if (type.isFunction()) {
...
}
@ TYPE_FUNCTION
Function type.
Definition CTypeInfo.h:157

Public Types

enum  TypeId {
  TYPE_BOOL ,
  TYPE_C_BOOL ,
  TYPE_SIGNED_CHAR ,
  TYPE_UNSIGNED_CHAR ,
  TYPE_CHAR ,
  TYPE_UNSIGNED_SHORT ,
  TYPE_SHORT ,
  TYPE_UNSIGNED_INT ,
  TYPE_WCHAR_T ,
  TYPE_INT ,
  TYPE_UNSIGNED_LONG ,
  TYPE_LONG ,
  TYPE_UNSIGNED_LONG_LONG ,
  TYPE_LONG_LONG ,
  TYPE_UNSIGNED_INT128 ,
  TYPE_INT128 ,
  TYPE_FLOAT ,
  TYPE_DOUBLE ,
  TYPE_LONG_DOUBLE ,
  TYPE_VOID ,
  TYPE_UNDEFINED ,
  TYPE_UNKNOWN_T ,
  TYPE_ELLIPSIS ,
  TYPE_CLASS ,
  TYPE_UNION ,
  TYPE_ENUM ,
  TYPE_POINTER ,
  TYPE_ADDRESS ,
  TYPE_MEMBER_POINTER ,
  TYPE_FUNCTION ,
  TYPE_ARRAY ,
  TYPE_VAR_ARRAY ,
  TYPE_QUALIFIED ,
  TYPE_BIT_FIELD ,
  TYPE_TEMPLATE_PARAM ,
  TYPE_EMPTY
}
 Type identifiers. More...
 

Public Member Functions

 CTypeInfo (CTypeInfo *base, TypeId id)
 Constructor.
 
 ~CTypeInfo ()
 Destructor.
 
bool operator== (const CTypeInfo &type) const
 Check if this type equals the given type.
 
bool operator!= (const CTypeInfo &type) const
 Check if this type not equals the given type.
 
bool equals (const CTypeInfo &type, bool matchTemplateParams=false, bool noDependentFctParams=false) const
 Check if this type equals the given type.
 
bool equalsUnqualified (const CTypeInfo &type) const
 Check if this type equals the given type if both types top-level qualifiers removed.
 
void print (std::ostream &os) const
 Print the textual representation of this type on the given stream.
 
void TypeText (std::ostream &os, const char *name=(const char *) 0, bool abs=false, bool tdef=false, bool elaborated_type_spec=false, bool unnamed=false) const
 Print the textual representation of this type on the given stream.
 
long int Dimension () const
 Get the dimension of an array type.
 
long int Size () const
 Get the size in bits of a type.
 
long int Align () const
 Get the alignment of a type.
 
TypeId Id () const
 Get the type identifier.
 
CTypeInfoBaseType () const
 Get the base type of a compound type.
 
void BaseType (CTypeInfo *base)
 Set the base type of a compount type.
 
bool isTypedef () const
 Check if this is a typedef type.
 
CObjectInfoTypedefInfo () const
 Get the typedef information if this is a typedef type.
 
CTypeInfoTypedefInfo (CObjectInfo *)
 Set the typedef information if this is a typedef type.
 
bool isComplete (unsigned long pos=0) const
 Check if this is a complete type.
 
bool isDependent (bool consider_unknown_t=true, bool is_named_type=false) const
 Check if this type or one of its base types depends on a template parameter.
 
bool isLocal () const
 Check if this is a local type.
 
bool isConst () const
 Check if this type is const qualified.
 
bool isVolatile () const
 Check if this type is volatile qualified.
 
bool isRestrict () const
 Check if this type is restrict qualified.
 
CRecordRecord () const
 Get the class or union of a class or union type.
 
CClassInfoClassInfo () const
 Get the class information if this is a class type.
 
CUnionInfoUnionInfo () const
 Get the union information if this is a union type.
 
CEnumInfoEnumInfo () const
 Get the enumeration information if this is an enumeration type.
 
CFunctionInfoFunctionInfo () const
 Get the function information if this is a function type.
 
CTypeInfoPtrBaseType () const
 Get the base type of a pointer type.
 
CTypeListArgTypes () const
 Get the argument type list of a function or qualified type.
 
CTypeInfoVirtualType () const
 Get the virtual type of this type.
 
CTypeInfoUnqualType () const
 Get the unqualified version of this type.
 
CTypeInfoNonReferenceType () const
 Get the non-reference type version of this type.
 
CTypeFunctionPtrToFct () const
 Get the function type of a pointer-to-function type.
 
CTypeArrayPtrToArray () const
 Get the array type of a pointer-to-array type.
 
CTypeQualifiedTypeQualified () const
 Get the pointer to CTypeQualified if this is a qualified type.
 
CTypeFunctionTypeFunction () const
 Get the pointer to CTypeFunction if this is a function type.
 
CTypeBitFieldTypeBitField () const
 Get the pointer to CTypeBitField if this is a bit-field type.
 
CTypePointerTypePointer () const
 Get the pointer to CTypePointer if this is a pointer type.
 
CTypeMemberPointerTypeMemberPointer () const
 Get the pointer to CTypeMemberPointer if this is a member pointer type.
 
CTypeAddressTypeAddress () const
 Get the pointer to CTypeAddress if this is a reference type.
 
CTypeArrayTypeArray () const
 Get the pointer to CTypeArray if this is an array type.
 
CTypeVarArrayTypeVarArray () const
 Get the pointer to CTypeVarArray if this is a variable length array type.
 
CTypeClassTypeClass () const
 Get the pointer to CTypeClass if this is a class type.
 
CTypeUnionTypeUnion () const
 Get the pointer to CTypeUnion if this is a union type.
 
CTypeRecordTypeRecord () const
 Get the pointer to CTypeRecord if this is a class or union type.
 
CTypeEnumTypeEnum () const
 Get the pointer to CTypeEnum if this is an enumeration type.
 
CTypePrimitiveTypePrimitive () const
 Get the pointer to CTypePrimitive if this is a primitive type.
 
CTypeInfoTypeEmpty () const
 Get the pointer to CTypeInfo if this is type Puma::CTYPE_EMPTY.
 
CTypeTemplateParamTypeTemplateParam () const
 Get the pointer to CTypeTemplateParam if this is a template parameter type.
 
bool isQualified () const
 Check if this is a qualified type.
 
bool isPointer () const
 Check if this is a pointer type.
 
bool isPointerOrArray () const
 Check if this is a pointer or array type.
 
bool isAddress () const
 Check if this is a reference type.
 
bool isRecord () const
 Check if this is a class or union type.
 
bool isClass () const
 Check if this is a class type.
 
bool isUnion () const
 Check if this is a union type.
 
bool isClassOrUnion () const
 Check if this is a class or union type.
 
bool isArray () const
 Check if this is an array type.
 
bool isFixedArray () const
 Check if this is a fixed length array type.
 
bool isVarArray () const
 Check if this is a variable length type.
 
bool isArithmetic () const
 Check if this is an arithmetic type.
 
bool isScalar () const
 Check if this is a pointer or arithmetic type.
 
bool isAggregate () const
 Check if this is an array, class, or union type.
 
bool isInteger () const
 Check if this is an integer type.
 
bool isVoid () const
 Check if this is type void.
 
bool isEnum () const
 Check if this is an enumeration type.
 
bool isReal () const
 Check if this is a floating point type.
 
bool isMemberPointer () const
 Check if this is a member pointer type.
 
bool isUndefined () const
 Check if this is an undefined type.
 
bool isFunction () const
 Check if this is a function type.
 
bool isBitField () const
 Check if this is a bit-field type.
 
bool isMethod () const
 Check if this is a class member function type.
 
bool isStdFunction () const
 Check if this is a non-class-member function type.
 
bool isTemplate () const
 Check if this is a template type.
 
bool isTemplateInstance () const
 Check if this is a template instance type.
 
bool isTemplateParam () const
 Check if this is a template parameter type.
 
bool isTypeParam () const
 Check if this is a type template parameter type.
 
bool isNonTypeParam () const
 Check if this is a non-type template parameter type.
 
bool isObject (unsigned long pos=0) const
 Check if this is an object type.
 
bool isPOD () const
 Check if this is a plain old data (POD) type.
 
bool isTrivial () const
 Check if this is a trivial type: (1) a scalar type (2) a trivial class type (3) an array of (1), (2), or (3)
 
bool is_bool () const
 Check if the ID of this type is CTypeInfo::TYPE_BOOL or CTypeInfo::TYPE_C_BOOL.
 
bool is_char () const
 Check if the ID of this type is CTypeInfo::TYPE_CHAR.
 
bool is_wchar_t () const
 Check if the ID of this type is CTypeInfo::TYPE_WCHAR_T.
 
bool is_short () const
 Check if the ID of this type is CTypeInfo::TYPE_SHORT.
 
bool is_int () const
 Check if the ID of this type is CTypeInfo::TYPE_INT.
 
bool is_long () const
 Check if the ID of this type is CTypeInfo::TYPE_LONG.
 
bool is_long_long () const
 Check if the ID of this type is CTypeInfo::TYPE_LONG_LONG.
 
bool is_int128 () const
 Check if the ID of this type is CTypeInfo::TYPE_INT128.
 
bool is_signed_char () const
 Check if the ID of this type is CTypeInfo::TYPE_SIGNED_CHAR.
 
bool is_unsigned_char () const
 Check if the ID of this type is CTypeInfo::TYPE_UNSIGNED_CHAR.
 
bool is_unsigned_short () const
 Check if the ID of this type is CTypeInfo::TYPE_UNSIGNED_SHORT.
 
bool is_unsigned_int () const
 Check if the ID of this type is CTypeInfo::TYPE_UNSIGNED_INT.
 
bool is_unsigned_long () const
 Check if the ID of this type is CTypeInfo::TYPE_UNSIGNED_LONG.
 
bool is_unsigned_long_long () const
 Check if the ID of this type is CTypeInfo::TYPE_UNSIGNED_LONG_LONG.
 
bool is_unsigned_int128 () const
 Check if the ID of this type is CTypeInfo::TYPE_UNSIGNED_INT128.
 
bool is_float () const
 Check if the ID of this type is CTypeInfo::TYPE_FLOAT.
 
bool is_double () const
 Check if the ID of this type is CTypeInfo::TYPE_DOUBLE.
 
bool is_long_double () const
 Check if the ID of this type is CTypeInfo::TYPE_LONG_DOUBLE.
 
bool is_void () const
 Check if the ID of this type is CTypeInfo::TYPE_VOID.
 
bool is_undefined () const
 Check if the ID of this type is CTypeInfo::TYPE_UNDEFINED.
 
bool is_unknown_t () const
 Check if the ID of this type is CTypeInfo::TYPE_UNKNOWN_T.
 
bool is_ellipsis () const
 Check if the ID of this type is CTypeInfo::TYPE_ELLIPSIS.
 
bool is_signed () const
 Check if this is a signed integer type.
 
bool is_unsigned () const
 Check if this is an unsigned integer type.
 
unsigned conv_rank () const
 Get the arithmetic conversion rank of the type.
 
bool operator> (const CTypeInfo &type) const
 Check if the conversion rank of this type is greater than the conversion rank of the given type.
 
bool operator>= (const CTypeInfo &type) const
 Check if the conversion rank of this type equals or is greater than the conversion rank of the given type.
 
bool operator<= (const CTypeInfo &type) const
 Check if the conversion rank of this type equals or is greater than the conversion rank of the given type.
 
bool operator< (const CTypeInfo &type) const
 Check if the conversion rank of this type is less than the conversion rank of the given type.
 
unsigned rank () const
 Get the rank of this type if it is an arithmetic type.
 
bool isTemplateInstanceArg () const
 Check if this is the type of a template instance argument declaration.
 
CTypeInfoDuplicate () const
 Maka a duplicate of this type.
 
void Mangled (std::ostream &os) const
 Print the mangled textual representation of the type on the given stream.
 
- Public Member Functions inherited from Puma::Printable
virtual ~Printable ()
 Destructor.
 

Static Public Member Functions

static CTypeInfoDuplicate (const CTypeInfo *type)
 Make a duplicate of the given type.
 
static void Destroy (CTypeInfo *type)
 Destroy the given type.
 

Static Public Attributes

static CTypeInfoCTYPE_SIZE_T
 Internal representation of size_t.
 
static CTypeInfoCTYPE_PTRDIFF_T
 Internal representation of ptrdiff_t.
 

Member Enumeration Documentation

◆ TypeId

Type identifiers.

Enumerator
TYPE_BOOL 

bool

TYPE_C_BOOL 

_Bool

TYPE_SIGNED_CHAR 

signed char

TYPE_UNSIGNED_CHAR 

unsiged char

TYPE_CHAR 

char

TYPE_UNSIGNED_SHORT 

unsigned short

TYPE_SHORT 

short

TYPE_UNSIGNED_INT 

unsigned int

TYPE_WCHAR_T 

wchar_t

TYPE_INT 

int

TYPE_UNSIGNED_LONG 

unsigned long

TYPE_LONG 

long

TYPE_UNSIGNED_LONG_LONG 

unsigned long long

TYPE_LONG_LONG 

long long

TYPE_UNSIGNED_INT128 

unsigned __int128

TYPE_INT128 

__int128

TYPE_FLOAT 

float

TYPE_DOUBLE 

double

TYPE_LONG_DOUBLE 

long double

TYPE_VOID 

void

TYPE_UNDEFINED 

Undefined type.

TYPE_UNKNOWN_T 

unknown_t

TYPE_ELLIPSIS 

Any type.

TYPE_CLASS 

Class type.

TYPE_UNION 

Union type.

TYPE_ENUM 

Enumeration type.

TYPE_POINTER 

Pointer type.

TYPE_ADDRESS 

Reference type.

TYPE_MEMBER_POINTER 

Member pointer type.

TYPE_FUNCTION 

Function type.

TYPE_ARRAY 

Array type.

TYPE_VAR_ARRAY 

Variable length array type.

TYPE_QUALIFIED 

Qualified type.

TYPE_BIT_FIELD 

Bit field type.

TYPE_TEMPLATE_PARAM 

Template parameter type.

TYPE_EMPTY 

No type.

Constructor & Destructor Documentation

◆ CTypeInfo()

Puma::CTypeInfo::CTypeInfo ( CTypeInfo * base,
CTypeInfo::TypeId id )
inline

Constructor.

Parameters
baseThe base type of a compound type.
idThe type ID.

◆ ~CTypeInfo()

Puma::CTypeInfo::~CTypeInfo ( )
inline

Destructor.

Member Function Documentation

◆ Align()

long int Puma::CTypeInfo::Align ( ) const

Get the alignment of a type.

◆ ArgTypes()

CTypeList * Puma::CTypeInfo::ArgTypes ( ) const
inline

Get the argument type list of a function or qualified type.

◆ BaseType() [1/2]

CTypeInfo * Puma::CTypeInfo::BaseType ( ) const
inline

Get the base type of a compound type.

Returns
The base type or this if not a compound type.

◆ BaseType() [2/2]

void Puma::CTypeInfo::BaseType ( CTypeInfo * base)
inline

Set the base type of a compount type.

Parameters
baseThe base type.

◆ ClassInfo()

CClassInfo * Puma::CTypeInfo::ClassInfo ( ) const

Get the class information if this is a class type.

Returns
The class information or NULL if not a class type.

◆ conv_rank()

unsigned Puma::CTypeInfo::conv_rank ( ) const

Get the arithmetic conversion rank of the type.

Note
Language C only!

◆ Destroy()

static void Puma::CTypeInfo::Destroy ( CTypeInfo * type)
static

Destroy the given type.

Parameters
typeThe type to destroy.

◆ Dimension()

long int Puma::CTypeInfo::Dimension ( ) const
inline

Get the dimension of an array type.

◆ Duplicate() [1/2]

CTypeInfo * Puma::CTypeInfo::Duplicate ( ) const
inline

Maka a duplicate of this type.

◆ Duplicate() [2/2]

static CTypeInfo * Puma::CTypeInfo::Duplicate ( const CTypeInfo * type)
static

Make a duplicate of the given type.

Parameters
typeThe type to duplicate.

◆ EnumInfo()

CEnumInfo * Puma::CTypeInfo::EnumInfo ( ) const
inline

Get the enumeration information if this is an enumeration type.

Returns
The enumeration information or NULL if not an enumeration type.

◆ equals()

bool Puma::CTypeInfo::equals ( const CTypeInfo & type,
bool matchTemplateParams = false,
bool noDependentFctParams = false ) const

Check if this type equals the given type.

Parameters
typeThe type to compare with.
matchTemplateParamsTrue if template parameters are matched.
noDependentFctParamsTrue if dependent function params do not match.

◆ equalsUnqualified()

bool Puma::CTypeInfo::equalsUnqualified ( const CTypeInfo & type) const

Check if this type equals the given type if both types top-level qualifiers removed.

Parameters
typeThe type to compare with.

◆ FunctionInfo()

CFunctionInfo * Puma::CTypeInfo::FunctionInfo ( ) const
inline

Get the function information if this is a function type.

Returns
The function information or NULL if not a function type.

◆ Id()

CTypeInfo::TypeId Puma::CTypeInfo::Id ( ) const
inline

Get the type identifier.

◆ is_bool()

bool Puma::CTypeInfo::is_bool ( ) const
inline

Check if the ID of this type is CTypeInfo::TYPE_BOOL or CTypeInfo::TYPE_C_BOOL.

◆ is_char()

bool Puma::CTypeInfo::is_char ( ) const
inline

Check if the ID of this type is CTypeInfo::TYPE_CHAR.

◆ is_double()

bool Puma::CTypeInfo::is_double ( ) const
inline

Check if the ID of this type is CTypeInfo::TYPE_DOUBLE.

◆ is_ellipsis()

bool Puma::CTypeInfo::is_ellipsis ( ) const
inline

Check if the ID of this type is CTypeInfo::TYPE_ELLIPSIS.

◆ is_float()

bool Puma::CTypeInfo::is_float ( ) const
inline

Check if the ID of this type is CTypeInfo::TYPE_FLOAT.

◆ is_int()

bool Puma::CTypeInfo::is_int ( ) const
inline

Check if the ID of this type is CTypeInfo::TYPE_INT.

◆ is_int128()

bool Puma::CTypeInfo::is_int128 ( ) const
inline

Check if the ID of this type is CTypeInfo::TYPE_INT128.

◆ is_long()

bool Puma::CTypeInfo::is_long ( ) const
inline

Check if the ID of this type is CTypeInfo::TYPE_LONG.

◆ is_long_double()

bool Puma::CTypeInfo::is_long_double ( ) const
inline

Check if the ID of this type is CTypeInfo::TYPE_LONG_DOUBLE.

◆ is_long_long()

bool Puma::CTypeInfo::is_long_long ( ) const
inline

Check if the ID of this type is CTypeInfo::TYPE_LONG_LONG.

◆ is_short()

bool Puma::CTypeInfo::is_short ( ) const
inline

Check if the ID of this type is CTypeInfo::TYPE_SHORT.

◆ is_signed()

bool Puma::CTypeInfo::is_signed ( ) const

Check if this is a signed integer type.

◆ is_signed_char()

bool Puma::CTypeInfo::is_signed_char ( ) const
inline

Check if the ID of this type is CTypeInfo::TYPE_SIGNED_CHAR.

◆ is_undefined()

bool Puma::CTypeInfo::is_undefined ( ) const
inline

Check if the ID of this type is CTypeInfo::TYPE_UNDEFINED.

◆ is_unknown_t()

bool Puma::CTypeInfo::is_unknown_t ( ) const
inline

Check if the ID of this type is CTypeInfo::TYPE_UNKNOWN_T.

◆ is_unsigned()

bool Puma::CTypeInfo::is_unsigned ( ) const

Check if this is an unsigned integer type.

◆ is_unsigned_char()

bool Puma::CTypeInfo::is_unsigned_char ( ) const
inline

Check if the ID of this type is CTypeInfo::TYPE_UNSIGNED_CHAR.

◆ is_unsigned_int()

bool Puma::CTypeInfo::is_unsigned_int ( ) const
inline

Check if the ID of this type is CTypeInfo::TYPE_UNSIGNED_INT.

◆ is_unsigned_int128()

bool Puma::CTypeInfo::is_unsigned_int128 ( ) const
inline

Check if the ID of this type is CTypeInfo::TYPE_UNSIGNED_INT128.

◆ is_unsigned_long()

bool Puma::CTypeInfo::is_unsigned_long ( ) const
inline

Check if the ID of this type is CTypeInfo::TYPE_UNSIGNED_LONG.

◆ is_unsigned_long_long()

bool Puma::CTypeInfo::is_unsigned_long_long ( ) const
inline

Check if the ID of this type is CTypeInfo::TYPE_UNSIGNED_LONG_LONG.

◆ is_unsigned_short()

bool Puma::CTypeInfo::is_unsigned_short ( ) const
inline

Check if the ID of this type is CTypeInfo::TYPE_UNSIGNED_SHORT.

◆ is_void()

bool Puma::CTypeInfo::is_void ( ) const
inline

Check if the ID of this type is CTypeInfo::TYPE_VOID.

◆ is_wchar_t()

bool Puma::CTypeInfo::is_wchar_t ( ) const
inline

Check if the ID of this type is CTypeInfo::TYPE_WCHAR_T.

◆ isAddress()

bool Puma::CTypeInfo::isAddress ( ) const
inline

Check if this is a reference type.

◆ isAggregate()

bool Puma::CTypeInfo::isAggregate ( ) const
inline

Check if this is an array, class, or union type.

◆ isArithmetic()

bool Puma::CTypeInfo::isArithmetic ( ) const

Check if this is an arithmetic type.

◆ isArray()

bool Puma::CTypeInfo::isArray ( ) const
inline

Check if this is an array type.

◆ isBitField()

bool Puma::CTypeInfo::isBitField ( ) const
inline

Check if this is a bit-field type.

◆ isClass()

bool Puma::CTypeInfo::isClass ( ) const
inline

Check if this is a class type.

◆ isClassOrUnion()

bool Puma::CTypeInfo::isClassOrUnion ( ) const
inline

Check if this is a class or union type.

◆ isComplete()

bool Puma::CTypeInfo::isComplete ( unsigned long pos = 0) const

Check if this is a complete type.

Optionally limited to a specific source code position. A type is complete if it is not undefined, not void, not an fixed length array without dimension, and not a class or enumeration that is only declared but not defined.

Parameters
posOptional source code position.

◆ isConst()

bool Puma::CTypeInfo::isConst ( ) const
inline

Check if this type is const qualified.

◆ isDependent()

bool Puma::CTypeInfo::isDependent ( bool consider_unknown_t = true,
bool is_named_type = false ) const

Check if this type or one of its base types depends on a template parameter.

Parameters
consider_unknown_tConsider unknown_t as dependent.
is_named_typeType of named type.

◆ isEnum()

bool Puma::CTypeInfo::isEnum ( ) const
inline

Check if this is an enumeration type.

◆ isFixedArray()

bool Puma::CTypeInfo::isFixedArray ( ) const
inline

Check if this is a fixed length array type.

◆ isFunction()

bool Puma::CTypeInfo::isFunction ( ) const
inline

Check if this is a function type.

◆ isInteger()

bool Puma::CTypeInfo::isInteger ( ) const
inline

Check if this is an integer type.

◆ isLocal()

bool Puma::CTypeInfo::isLocal ( ) const

Check if this is a local type.

A type is local if it was declared in a local scope.

◆ isMemberPointer()

bool Puma::CTypeInfo::isMemberPointer ( ) const
inline

Check if this is a member pointer type.

◆ isMethod()

bool Puma::CTypeInfo::isMethod ( ) const
inline

Check if this is a class member function type.

◆ isNonTypeParam()

bool Puma::CTypeInfo::isNonTypeParam ( ) const
inline

Check if this is a non-type template parameter type.

◆ isObject()

bool Puma::CTypeInfo::isObject ( unsigned long pos = 0) const
inline

Check if this is an object type.

An object type is a complete non-function type.

Parameters
posOptional source code position.

◆ isPOD()

bool Puma::CTypeInfo::isPOD ( ) const

Check if this is a plain old data (POD) type.

◆ isPointer()

bool Puma::CTypeInfo::isPointer ( ) const
inline

Check if this is a pointer type.

◆ isPointerOrArray()

bool Puma::CTypeInfo::isPointerOrArray ( ) const
inline

Check if this is a pointer or array type.

◆ isQualified()

bool Puma::CTypeInfo::isQualified ( ) const
inline

Check if this is a qualified type.

◆ isReal()

bool Puma::CTypeInfo::isReal ( ) const
inline

Check if this is a floating point type.

◆ isRecord()

bool Puma::CTypeInfo::isRecord ( ) const
inline

Check if this is a class or union type.

◆ isRestrict()

bool Puma::CTypeInfo::isRestrict ( ) const
inline

Check if this type is restrict qualified.

◆ isScalar()

bool Puma::CTypeInfo::isScalar ( ) const
inline

Check if this is a pointer or arithmetic type.

◆ isStdFunction()

bool Puma::CTypeInfo::isStdFunction ( ) const
inline

Check if this is a non-class-member function type.

◆ isTemplate()

bool Puma::CTypeInfo::isTemplate ( ) const

Check if this is a template type.

◆ isTemplateInstance()

bool Puma::CTypeInfo::isTemplateInstance ( ) const

Check if this is a template instance type.

◆ isTemplateInstanceArg()

bool Puma::CTypeInfo::isTemplateInstanceArg ( ) const

Check if this is the type of a template instance argument declaration.

These declarations are generated and have to be handled special.

◆ isTemplateParam()

bool Puma::CTypeInfo::isTemplateParam ( ) const
inline

Check if this is a template parameter type.

◆ isTrivial()

bool Puma::CTypeInfo::isTrivial ( ) const

Check if this is a trivial type: (1) a scalar type (2) a trivial class type (3) an array of (1), (2), or (3)

◆ isTypedef()

bool Puma::CTypeInfo::isTypedef ( ) const
inline

Check if this is a typedef type.

◆ isTypeParam()

bool Puma::CTypeInfo::isTypeParam ( ) const
inline

Check if this is a type template parameter type.

◆ isUndefined()

bool Puma::CTypeInfo::isUndefined ( ) const
inline

Check if this is an undefined type.

◆ isUnion()

bool Puma::CTypeInfo::isUnion ( ) const
inline

Check if this is a union type.

◆ isVarArray()

bool Puma::CTypeInfo::isVarArray ( ) const
inline

Check if this is a variable length type.

◆ isVoid()

bool Puma::CTypeInfo::isVoid ( ) const
inline

Check if this is type void.

◆ isVolatile()

bool Puma::CTypeInfo::isVolatile ( ) const
inline

Check if this type is volatile qualified.

◆ Mangled()

void Puma::CTypeInfo::Mangled ( std::ostream & os) const

Print the mangled textual representation of the type on the given stream.

According to the C++ V3 ABI mangling (see http://www.codesourcery.com/cxx-abi/abi.html).

Parameters
osThe output stream.

◆ NonReferenceType()

CTypeInfo * Puma::CTypeInfo::NonReferenceType ( ) const
inline

Get the non-reference type version of this type.

Returns
The non-reference type or this if not a reference type.

◆ operator!=()

bool Puma::CTypeInfo::operator!= ( const CTypeInfo & type) const
inline

Check if this type not equals the given type.

Parameters
typeThe type to compare with.

◆ operator<()

bool Puma::CTypeInfo::operator< ( const CTypeInfo & type) const

Check if the conversion rank of this type is less than the conversion rank of the given type.

Note
Language C only!
Parameters
typeThe type to compare with.

◆ operator<=()

bool Puma::CTypeInfo::operator<= ( const CTypeInfo & type) const
inline

Check if the conversion rank of this type equals or is greater than the conversion rank of the given type.

Note
Language C only!
Parameters
typeThe type to compare with.

◆ operator==()

bool Puma::CTypeInfo::operator== ( const CTypeInfo & type) const
inline

Check if this type equals the given type.

Parameters
typeThe type to compare with.

◆ operator>()

bool Puma::CTypeInfo::operator> ( const CTypeInfo & type) const

Check if the conversion rank of this type is greater than the conversion rank of the given type.

Note
Language C only!
Parameters
typeThe type to compare with.

◆ operator>=()

bool Puma::CTypeInfo::operator>= ( const CTypeInfo & type) const
inline

Check if the conversion rank of this type equals or is greater than the conversion rank of the given type.

Note
Language C only!
Parameters
typeThe type to compare with.

◆ print()

void Puma::CTypeInfo::print ( std::ostream & os) const
inlinevirtual

Print the textual representation of this type on the given stream.

Parameters
osThe output stream.

Implements Puma::Printable.

◆ PtrBaseType()

CTypeInfo * Puma::CTypeInfo::PtrBaseType ( ) const
inline

Get the base type of a pointer type.

◆ PtrToArray()

CTypeArray * Puma::CTypeInfo::PtrToArray ( ) const

Get the array type of a pointer-to-array type.

Returns
The array type or NULL if not a pointer to array.

◆ PtrToFct()

CTypeFunction * Puma::CTypeInfo::PtrToFct ( ) const

Get the function type of a pointer-to-function type.

Returns
The function type or NULL if not a pointer to function.

◆ rank()

unsigned Puma::CTypeInfo::rank ( ) const

Get the rank of this type if it is an arithmetic type.

Note
Language C++ only!
Returns
The rank or 0 if not an arithmetic type.

◆ Record()

CRecord * Puma::CTypeInfo::Record ( ) const
inline

Get the class or union of a class or union type.

Returns
The class or union, or NULL if not such a type.

◆ Size()

long int Puma::CTypeInfo::Size ( ) const

Get the size in bits of a type.

◆ TypeAddress()

CTypeAddress * Puma::CTypeInfo::TypeAddress ( ) const
inline

Get the pointer to CTypeAddress if this is a reference type.

Returns
The valid pointer or NULL.

◆ TypeArray()

CTypeArray * Puma::CTypeInfo::TypeArray ( ) const
inline

Get the pointer to CTypeArray if this is an array type.

Returns
The valid pointer or NULL.

◆ TypeBitField()

CTypeBitField * Puma::CTypeInfo::TypeBitField ( ) const
inline

Get the pointer to CTypeBitField if this is a bit-field type.

Returns
The valid pointer or NULL.

◆ TypeClass()

CTypeClass * Puma::CTypeInfo::TypeClass ( ) const
inline

Get the pointer to CTypeClass if this is a class type.

Returns
The valid pointer or NULL.

◆ TypedefInfo() [1/2]

CObjectInfo * Puma::CTypeInfo::TypedefInfo ( ) const
inline

Get the typedef information if this is a typedef type.

◆ TypedefInfo() [2/2]

CTypeInfo * Puma::CTypeInfo::TypedefInfo ( CObjectInfo * )

Set the typedef information if this is a typedef type.

◆ TypeEmpty()

CTypeInfo * Puma::CTypeInfo::TypeEmpty ( ) const
inline

Get the pointer to CTypeInfo if this is type Puma::CTYPE_EMPTY.

Returns
The valid pointer or NULL.

◆ TypeEnum()

CTypeEnum * Puma::CTypeInfo::TypeEnum ( ) const
inline

Get the pointer to CTypeEnum if this is an enumeration type.

Returns
The valid pointer or NULL.

◆ TypeFunction()

CTypeFunction * Puma::CTypeInfo::TypeFunction ( ) const
inline

Get the pointer to CTypeFunction if this is a function type.

Returns
The valid pointer or NULL.

◆ TypeMemberPointer()

CTypeMemberPointer * Puma::CTypeInfo::TypeMemberPointer ( ) const
inline

Get the pointer to CTypeMemberPointer if this is a member pointer type.

Returns
The valid pointer or NULL.

◆ TypePointer()

CTypePointer * Puma::CTypeInfo::TypePointer ( ) const
inline

Get the pointer to CTypePointer if this is a pointer type.

Returns
The valid pointer or NULL.

◆ TypePrimitive()

CTypePrimitive * Puma::CTypeInfo::TypePrimitive ( ) const
inline

Get the pointer to CTypePrimitive if this is a primitive type.

Returns
The valid pointer or NULL.

◆ TypeQualified()

CTypeQualified * Puma::CTypeInfo::TypeQualified ( ) const
inline

Get the pointer to CTypeQualified if this is a qualified type.

Returns
The valid pointer or NULL.

◆ TypeRecord()

CTypeRecord * Puma::CTypeInfo::TypeRecord ( ) const
inline

Get the pointer to CTypeRecord if this is a class or union type.

Returns
The valid pointer or NULL.

◆ TypeTemplateParam()

CTypeTemplateParam * Puma::CTypeInfo::TypeTemplateParam ( ) const
inline

Get the pointer to CTypeTemplateParam if this is a template parameter type.

Returns
The valid pointer or NULL.

◆ TypeText()

void Puma::CTypeInfo::TypeText ( std::ostream & os,
const char * name = (const char*)0,
bool abs = false,
bool tdef = false,
bool elaborated_type_spec = false,
bool unnamed = false ) const
inline

Print the textual representation of this type on the given stream.

Parameters
osThe output stream.
nameOptional name of the entity to print.
absPrint qualified names with root qualifier.
tdefPrint the name of a typedef instead of the underlying type.
elaborated_type_specPrint elaborated type specifier before class, union, and enumeration types.
unnamedPrint unnamed namespaces as '<unnamed>'

◆ TypeUnion()

CTypeUnion * Puma::CTypeInfo::TypeUnion ( ) const
inline

Get the pointer to CTypeUnion if this is a union type.

Returns
The valid pointer or NULL.

◆ TypeVarArray()

CTypeVarArray * Puma::CTypeInfo::TypeVarArray ( ) const
inline

Get the pointer to CTypeVarArray if this is a variable length array type.

Returns
The valid pointer or NULL.

◆ UnionInfo()

CUnionInfo * Puma::CTypeInfo::UnionInfo ( ) const

Get the union information if this is a union type.

Returns
The union information or NULL if not a union type.

◆ UnqualType()

CTypeInfo * Puma::CTypeInfo::UnqualType ( ) const
inline

Get the unqualified version of this type.

Returns
The unqualified type or this if not qualified.

◆ VirtualType()

CTypeInfo * Puma::CTypeInfo::VirtualType ( ) const
inline

Get the virtual type of this type.

If this type is a qualified, bit-field, or reference type then the virtual type is the virtual type of the base type of this type.

Returns
The base type or this.

Member Data Documentation

◆ CTYPE_PTRDIFF_T

CTypeInfo* Puma::CTypeInfo::CTYPE_PTRDIFF_T
static

Internal representation of ptrdiff_t.

◆ CTYPE_SIZE_T

CTypeInfo* Puma::CTypeInfo::CTYPE_SIZE_T
static

Internal representation of size_t.