cgv
Loading...
Searching...
No Matches
cgv::type::info Namespace Reference

namespace for templates that provide type information More...

Classes

struct  name_type_id_pair
 
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_id< bool >
 
struct  type_id< flt32_type >
 
struct  type_id< flt64_type >
 
struct  type_id< int16_type >
 
struct  type_id< int32_type >
 
struct  type_id< int64_type >
 
struct  type_id< int8_type >
 
struct  type_id< std::string >
 
struct  type_id< std::wstring >
 
struct  type_id< uint16_type >
 
struct  type_id< uint32_type >
 
struct  type_id< uint64_type >
 
struct  type_id< uint8_type >
 
struct  type_id< void >
 
struct  type_id< wchar_type >
 
struct  type_name
 traits class with a static function get_name() of type const char* that returns the type name of the template argument T. More...
 
struct  type_name< cgv::media::illum::light_source >
 
struct  type_ptr
 template to cast a pointer into a type known at compile time and specified as TypeId More...
 
struct  type_ptr< TI_BOOL >
 
struct  type_ptr< TI_FLT32 >
 
struct  type_ptr< TI_FLT64 >
 
struct  type_ptr< TI_INT16 >
 
struct  type_ptr< TI_INT32 >
 
struct  type_ptr< TI_INT64 >
 
struct  type_ptr< TI_INT8 >
 
struct  type_ptr< TI_STRING >
 
struct  type_ptr< TI_UINT16 >
 
struct  type_ptr< TI_UINT32 >
 
struct  type_ptr< TI_UINT64 >
 
struct  type_ptr< TI_UINT8 >
 
struct  type_ptr< TI_WCHAR >
 
struct  type_ptr< TI_WSTRING >
 

Typedefs

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

Enumerations

enum  TypeId {
  TI_UNDEF , 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

TypeId get_new_type_id ()
 
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
 
bool is_signed_integral (TypeId tid)
 
bool is_integral (TypeId tid)
 
bool is_floating (TypeId tid)
 
bool is_number (TypeId tid)
 
bool is_fundamental (TypeId tid)
 
bool is_compound (TypeId tid)
 
bool is_type (TypeId tid)
 
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
 

Variables

struct CGV_API type_interface
 

Detailed Description

namespace for templates that provide type information

Typedef Documentation

◆ const_type_ptr

typedef cgv::data::ref_ptr<const type_interface,true> cgv::type::info::const_type_ptr

pointer to const type interface

Definition at line 17 of file base.h.

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

Definition at line 12 of file type_id.h.

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

Definition at line 9 of file type_name.cxx.

References cgv::utils::replace().

◆ get_new_type_id()

CGV_API TypeId cgv::type::info::get_new_type_id ( )

Definition at line 10 of file type_id.cxx.

◆ get_type_id()

◆ get_type_name()

CGV_API const char * cgv::type::info::get_type_name ( TypeId  tid)

function that returns the name of a type specified through TypeId

Definition at line 117 of file type_id.cxx.

Referenced by cgv::type::variant< T >::get(), cgv::render::gl::gl_context::read_frame_buffer(), and cgv::type::variant< T >::set().

◆ get_type_size()

◆ is_compound()

bool cgv::type::info::is_compound ( TypeId  tid)
inline

Definition at line 77 of file type_id.h.

◆ is_floating()

bool cgv::type::info::is_floating ( TypeId  tid)
inline

Definition at line 74 of file type_id.h.

◆ is_fundamental()

bool cgv::type::info::is_fundamental ( TypeId  tid)
inline

Definition at line 76 of file type_id.h.

◆ is_integral()

bool cgv::type::info::is_integral ( TypeId  tid)
inline

Definition at line 73 of file type_id.h.

◆ is_number()

bool cgv::type::info::is_number ( TypeId  tid)
inline

Definition at line 75 of file type_id.h.

◆ is_signed_integral()

bool cgv::type::info::is_signed_integral ( TypeId  tid)
inline

Definition at line 72 of file type_id.h.

◆ is_type()

bool cgv::type::info::is_type ( TypeId  tid)
inline

Definition at line 78 of file type_id.h.

◆ is_unsigned_integral()

bool cgv::type::info::is_unsigned_integral ( TypeId  tid)
inline

query if a kind is an unsigned integral type

Definition at line 71 of file type_id.h.

References TI_UINT64, and TI_UINT8.

Variable Documentation

◆ type_interface

struct CGV_API cgv::type::info::type_interface

Definition at line 14 of file base.h.