# pygccxml.declarations.cpptypes module

defines classes, that describe C++ types

FUNDAMENTAL_TYPES = {'__int128_t': <pygccxml.declarations.cpptypes.int128_t object>, '__java_boolean': <pygccxml.declarations.cpptypes.jboolean_t object>, '__java_byte': <pygccxml.declarations.cpptypes.jbyte_t object>, '__java_char': <pygccxml.declarations.cpptypes.jchar_t object>, '__java_double': <pygccxml.declarations.cpptypes.jdouble_t object>, '__java_float': <pygccxml.declarations.cpptypes.jfloat_t object>, '__java_int': <pygccxml.declarations.cpptypes.jint_t object>, '__java_long': <pygccxml.declarations.cpptypes.jlong_t object>, '__java_short': <pygccxml.declarations.cpptypes.jshort_t object>, '__uint128_t': <pygccxml.declarations.cpptypes.uint128_t object>, 'bool': <pygccxml.declarations.cpptypes.bool_t object>, 'char': <pygccxml.declarations.cpptypes.char_t object>, 'complex double': <pygccxml.declarations.cpptypes.complex_double_t object>, 'complex float': <pygccxml.declarations.cpptypes.complex_float_t object>, 'complex long double': <pygccxml.declarations.cpptypes.complex_long_double_t object>, 'double': <pygccxml.declarations.cpptypes.double_t object>, 'float': <pygccxml.declarations.cpptypes.float_t object>, 'int': <pygccxml.declarations.cpptypes.int_t object>, 'jboolean': <pygccxml.declarations.cpptypes.jboolean_t object>, 'jbyte': <pygccxml.declarations.cpptypes.jbyte_t object>, 'jchar': <pygccxml.declarations.cpptypes.jchar_t object>, 'jdouble': <pygccxml.declarations.cpptypes.jdouble_t object>, 'jfloat': <pygccxml.declarations.cpptypes.jfloat_t object>, 'jint': <pygccxml.declarations.cpptypes.jint_t object>, 'jlong': <pygccxml.declarations.cpptypes.jlong_t object>, 'jshort': <pygccxml.declarations.cpptypes.jshort_t object>, 'long double': <pygccxml.declarations.cpptypes.long_double_t object>, 'long int': <pygccxml.declarations.cpptypes.long_int_t object>, 'long long int': <pygccxml.declarations.cpptypes.long_long_int_t object>, 'long long unsigned int': <pygccxml.declarations.cpptypes.long_long_unsigned_int_t object>, 'long unsigned int': <pygccxml.declarations.cpptypes.long_unsigned_int_t object>, 'short int': <pygccxml.declarations.cpptypes.short_int_t object>, 'short unsigned int': <pygccxml.declarations.cpptypes.short_unsigned_int_t object>, 'signed char': <pygccxml.declarations.cpptypes.signed_char_t object>, 'signed int': <pygccxml.declarations.cpptypes.int_t object>, 'signed short int': <pygccxml.declarations.cpptypes.short_int_t object>, 'unsigned char': <pygccxml.declarations.cpptypes.unsigned_char_t object>, 'unsigned int': <pygccxml.declarations.cpptypes.unsigned_int_t object>, 'void': <pygccxml.declarations.cpptypes.void_t object>, 'wchar_t': <pygccxml.declarations.cpptypes.wchar_t object>}

  defines a mapping between fundamental type name and its synonym to the instance of class that describes the type

class array_t(base, size)

  Bases: `pygccxml.declarations.cpptypes.compound_t`

  represents C++ array type

  SIZE_UNKNOWN = -1
  build_decl_string(with_defaults=True)
  property size

    returns array size

class bool_t

  Bases: `pygccxml.declarations.cpptypes.fundamental_t`

  represents bool type

  CPPNAME = 'bool'

class calldef_type_t(return_type=None, arguments_types=None)

  Bases: `object`

  base class for all types that describes “callable” declaration

  property arguments_types

    list of argument `types`

  property has_ellipsis
  property return_type

    reference to `return type`

class char_t

  Bases: `pygccxml.declarations.cpptypes.fundamental_t`

  represents char type

  CPPNAME = 'char'

class complex_double_t

  Bases: `pygccxml.declarations.cpptypes.fundamental_t`

  represents complex double type

  CPPNAME = 'complex double'

class complex_float_t

  Bases: `pygccxml.declarations.cpptypes.fundamental_t`

  represents complex float type

  CPPNAME = 'complex float'

class complex_long_double_t

  Bases: `pygccxml.declarations.cpptypes.fundamental_t`

  represents complex long double type

  CPPNAME = 'complex long double'

class compound_t(base)

  Bases: `pygccxml.declarations.cpptypes.type_t`

  class that allows to represent compound types like const int*

  property base

    reference to internal/base class

  build_decl_string(with_defaults=True)

class const_t(base)

  Bases: `pygccxml.declarations.cpptypes.compound_t`

  represents whatever const type

  build_decl_string(with_defaults=True)

class declarated_t(declaration)

  Bases: `pygccxml.declarations.cpptypes.type_t`, `pygccxml.declarations.byte_info.byte_info`

  class that binds between to hierarchies: `type_t` and `declaration_t`

  build_decl_string(with_defaults=True)
  property declaration

    reference to `declaration_t`

class double_t

  Bases: `pygccxml.declarations.cpptypes.fundamental_t`

  represents double type

  CPPNAME = 'double'

class dummy_type_t(decl_string)

  Bases: `pygccxml.declarations.cpptypes.type_t`

  provides `type_t` interface for a string, that defines C++ type.

  This class could be very useful in the code generator.

  build_decl_string(with_defaults=True)

class elaborated_t(base)

  Bases: `pygccxml.declarations.cpptypes.compound_t`

  represents elaborated type

  build_decl_string(with_defaults=True)

class ellipsis_t

  Bases: `pygccxml.declarations.cpptypes.type_t`

  type, that represents “…” in function definition

  build_decl_string(with_defaults=True)

class float_t

  Bases: `pygccxml.declarations.cpptypes.fundamental_t`

  represents float type

  CPPNAME = 'float'

class free_function_type_t(return_type=None, arguments_types=None)

  Bases: `pygccxml.declarations.cpptypes.type_t`, `pygccxml.declarations.cpptypes.calldef_type_t`

  describes free function type

  NAME_TEMPLATE = '%(return_type)s (*)( %(arguments)s )'
  TYPEDEF_NAME_TEMPLATE = '%(return_type)s ( *%(typedef_name)s )( %(arguments)s )'
  build_decl_string(with_defaults=True)
  static create_decl_string(return_type, arguments_types, with_defaults=True)

    Returns free function type

    Parameters

      - return_type (`type_t`) – function return type

      - arguments_types – list of argument `type`

    Return type

      `free_function_type_t`

  create_typedef(typedef_name, unused=None, with_defaults=True)

    returns string, that contains valid C++ code, that defines typedef to function type

    Parameters

      name – the desired name of typedef

class fundamental_t(name)

  Bases: `pygccxml.declarations.cpptypes.type_t`

  base class for all fundamental, build-in types

  build_decl_string(with_defaults=True)

class int128_t

  Bases: `pygccxml.declarations.cpptypes.fundamental_t`

  represents __int128_t type

  CPPNAME = '__int128_t'

class int_t

  Bases: `pygccxml.declarations.cpptypes.fundamental_t`

  represents int type

  CPPNAME = 'int'

class java_fundamental_t(name)

  Bases: `pygccxml.declarations.cpptypes.fundamental_t`

  base class for all JNI defined fundamental types

class jboolean_t

  Bases: `pygccxml.declarations.cpptypes.java_fundamental_t`

  represents jboolean type

  JNAME = 'jboolean'

class jbyte_t

  Bases: `pygccxml.declarations.cpptypes.java_fundamental_t`

  represents jbyte type

  JNAME = 'jbyte'

class jchar_t

  Bases: `pygccxml.declarations.cpptypes.java_fundamental_t`

  represents jchar type

  JNAME = 'jchar'

class jdouble_t

  Bases: `pygccxml.declarations.cpptypes.java_fundamental_t`

  represents jdouble type

  JNAME = 'jdouble'

class jfloat_t

  Bases: `pygccxml.declarations.cpptypes.java_fundamental_t`

  represents jfloat type

  JNAME = 'jfloat'

class jint_t

  Bases: `pygccxml.declarations.cpptypes.java_fundamental_t`

  represents jint type

  JNAME = 'jint'

class jlong_t

  Bases: `pygccxml.declarations.cpptypes.java_fundamental_t`

  represents jlong type

  JNAME = 'jlong'

class jshort_t

  Bases: `pygccxml.declarations.cpptypes.java_fundamental_t`

  represents jshort type

  JNAME = 'jshort'

class long_double_t

  Bases: `pygccxml.declarations.cpptypes.fundamental_t`

  represents long double type

  CPPNAME = 'long double'

class long_int_t

  Bases: `pygccxml.declarations.cpptypes.fundamental_t`

  represents long int type

  CPPNAME = 'long int'

class long_long_int_t

  Bases: `pygccxml.declarations.cpptypes.fundamental_t`

  represents long long int type

  CPPNAME = 'long long int'

class long_long_unsigned_int_t

  Bases: `pygccxml.declarations.cpptypes.fundamental_t`

  represents long long unsigned int type

  CPPNAME = 'long long unsigned int'

class long_unsigned_int_t

  Bases: `pygccxml.declarations.cpptypes.fundamental_t`

  represents long unsigned int type

  CPPNAME = 'long unsigned int'

class member_function_type_t(class_inst=None, return_type=None, arguments_types=None, has_const=False)

  Bases: `pygccxml.declarations.cpptypes.type_t`, `pygccxml.declarations.cpptypes.calldef_type_t`

  describes member function type

  NAME_TEMPLATE = '%(return_type)s ( %(class)s::* )( %(arguments)s )%(has_const)s'
  TYPEDEF_NAME_TEMPLATE = '%(return_type)s ( %(class)s::*%(typedef_name)s)( %(arguments)s ) %(has_const)s'
  build_decl_string(with_defaults=True)
  property class_inst

    reference to parent `class`

  static create_decl_string(return_type, class_decl_string, arguments_types, has_const, with_defaults=True)
  create_typedef(typedef_name, class_alias=None, with_defaults=True)

    creates typedef to the function type

    Parameters

      typedef_name – desired type name

    Return type

      string

  property has_const

    describes, whether function has const modifier

class member_variable_type_t(class_inst=None, variable_type=None)

  Bases: `pygccxml.declarations.cpptypes.compound_t`

  describes member variable type

  NAME_TEMPLATE = '%(type)s ( %(class)s::* )'
  build_decl_string(with_defaults=True)
  property variable_type

    describes member variable `type`

class pointer_t(base)

  Bases: `pygccxml.declarations.cpptypes.compound_t`

  represents whatever* type

  build_decl_string(with_defaults=True)

class reference_t(base)

  Bases: `pygccxml.declarations.cpptypes.compound_t`

  represents whatever& type

  build_decl_string(with_defaults=True)

class restrict_t(base)

  Bases: `pygccxml.declarations.cpptypes.compound_t`

  represents restrict whatever type

  build_decl_string(with_defaults=True)

class short_int_t

  Bases: `pygccxml.declarations.cpptypes.fundamental_t`

  represents short int type

  CPPNAME = 'short int'

class short_unsigned_int_t

  Bases: `pygccxml.declarations.cpptypes.fundamental_t`

  represents short unsigned int type

  CPPNAME = 'short unsigned int'

class signed_char_t

  Bases: `pygccxml.declarations.cpptypes.fundamental_t`

  represents signed char type

  CPPNAME = 'signed char'

class type_qualifiers_t(has_static=False, has_mutable=False, has_extern=False)

  Bases: `object`

  contains additional information about type: mutable, static, extern

  property has_extern
  property has_mutable
  property has_static

class type_t

  Bases: `pygccxml.declarations.byte_info.byte_info`

  base class for all types

  build_decl_string(with_defaults=True)
  clone()

    returns new instance of the type

  property decl_string
  property partial_decl_string

class uint128_t

  Bases: `pygccxml.declarations.cpptypes.fundamental_t`

  represents __uint128_t type

  CPPNAME = '__uint128_t'

class unknown_t

  Bases: `pygccxml.declarations.cpptypes.type_t`

  type, that represents all C++ types, that could not be parsed by GCC-XML

  build_decl_string(with_defaults=True)

class unsigned_char_t

  Bases: `pygccxml.declarations.cpptypes.fundamental_t`

  represents unsigned char type

  CPPNAME = 'unsigned char'

class unsigned_int_t

  Bases: `pygccxml.declarations.cpptypes.fundamental_t`

  represents unsigned int type

  CPPNAME = 'unsigned int'

class void_t

  Bases: `pygccxml.declarations.cpptypes.fundamental_t`

  represents void type

  CPPNAME = 'void'

class volatile_t(base)

  Bases: `pygccxml.declarations.cpptypes.compound_t`

  represents volatile whatever type

  build_decl_string(with_defaults=True)

class wchar_t

  Bases: `pygccxml.declarations.cpptypes.fundamental_t`

  represents wchar_t type

  CPPNAME = 'wchar_t'