cgv
cgv::type::info Namespace Reference

namespace for templates that provide type information More...

Classes

struct  type_access
 access value whos type is given by a TypeId More...
 
struct  type_id
 template with a static member function get_id() of type TypeId returning the TypeId of the template argument T. More...
 
struct  type_name
 
struct  type_ptr
 template to cast a pointer into a type known at compile time and specified as TypeId More...
 

Typedefs

typedef cgv::data::ref_ptr< const type_interface, true > const_type_ptr
 pointer to const type interface
 

Enumerations

enum  TypeId { ,
  TI_BIT, TI_VOID, TI_BOOL, TI_INT8,
  TI_INT16, TI_INT32, TI_INT64, TI_UINT8,
  TI_UINT16, TI_UINT32, TI_UINT64, TI_FLT16,
  TI_FLT32, TI_FLT64, TI_WCHAR, TI_STRING,
  TI_WSTRING, TI_ENUM, TI_REFERENCE, TI_POINTER,
  TI_ARRAY, TI_FUNCTION_POINTER, TI_MEMBER_POINTER, TI_METHOD_POINTER,
  TI_STRUCT, TI_CLASS, TI_UNION, TI_CONST,
  TI_EXPRESSION, TI_PARAMETER, TI_SIGNATURE, TI_FUNCTION,
  TI_BASE, TI_MEMBER, TI_METHOD, TI_CONSTRUCTOR,
  TI_INSTANCE, TI_TYPEDEF, TI_TYPENAME, TI_CLASSNAME,
  TI_TEMPLATE, TI_LAST, TI_CHAR = TI_INT8, TI_FIRST = TI_UNDEF,
  TI_FIRST_STD_TYPE = TI_BOOL, TI_LAST_STD_TYPE = TI_WSTRING, TI_FIRST_TYPE = TI_VOID, TI_LAST_TYPE = TI_UNION
}
 ids for the different types and type constructs More...
 

Functions

unsigned int get_type_size (TypeId tid)
 function that returns the size of a type specified through TypeId
 
TypeId get_type_id (const std::string &_type_name)
 function that returns the type id of a type name
 
const char * get_type_name (TypeId tid)
 function that returns the name of a type specified through TypeId
 
bool is_unsigned_integral (TypeId tid)
 query if a kind is an unsigned integral type
 
std::string extract_type_name (const std::type_info &ti)
 extract a type name from an type_info structure that does not contain the class, struct nor enum keywords More...
 

Detailed Description

namespace for templates that provide type information

Enumeration Type Documentation

◆ TypeId

ids for the different types and type constructs

Enumerator
TI_BIT 

used for undefined type

TI_VOID 

bit based types

TI_BOOL 

void

TI_INT8 

boolean

TI_INT16 

signed integer stored in 8 bits

TI_INT32 

signed integer stored in 16 bits

TI_INT64 

signed integer stored in 32 bits

TI_UINT8 

signed integer stored in 64 bits

TI_UINT16 

unsigned integer stored in 8 bits

TI_UINT32 

unsigned integer stored in 16 bits

TI_UINT64 

unsigned integer stored in 32 bits

TI_FLT16 

unsigned integer stored in 64 bits

TI_FLT32 

floating point type stored in 16 bits

TI_FLT64 

floating point type stored in 32 bits

TI_WCHAR 

floating point type stored in 64 bits

TI_STRING 

wide character type

TI_WSTRING 

string type

TI_ENUM 

string type

TI_REFERENCE 

all enum types

TI_POINTER 

reference type construct

TI_ARRAY 

pointer type construct

TI_FUNCTION_POINTER 

array type construct

TI_MEMBER_POINTER 

function pointer type construct

TI_METHOD_POINTER 

member pointer type construct

TI_STRUCT 

method pointer type construct

TI_CLASS 

struct type compound

TI_UNION 

class type compound

TI_CONST 

union type compound

TI_EXPRESSION 

const modifier

TI_PARAMETER 

expression used for default parameters

TI_SIGNATURE 

function or method parameter

TI_FUNCTION 

function or method signature

TI_BASE 

function not a function pointer

TI_MEMBER 

base type of a compound type

TI_METHOD 

member of a compound

TI_CONSTRUCTOR 

method of a compound, not a method pointer

TI_INSTANCE 

constructor of a compound

TI_TYPEDEF 

an instance not a type

TI_TYPENAME 

a type definition

TI_CLASSNAME 

an undefined typename used as template parameter

TI_TEMPLATE 

an undefined class name used as template parameter

TI_LAST 

a template construct

TI_CHAR 

always the index after the last type construct

TI_FIRST 

alias for character type

TI_FIRST_STD_TYPE 

always the first type construct

TI_LAST_STD_TYPE 

always the first standard type

TI_FIRST_TYPE 

always the last standard type

TI_LAST_TYPE 

always the first standard type

Function Documentation

◆ extract_type_name()

CGV_API std::string cgv::type::info::extract_type_name ( const std::type_info &  ti)

extract a type name from an type_info structure that does not contain the class, struct nor enum keywords

extract a type name from a type_info structure that does not contain the class, struct nor enum keywords