# pygccxml.declarations.class_declaration module

defines classes, that describes C++ classes

This modules contains definition for next C++ declarations:
  - class definition
  - class declaration
  - small helper class for describing C++ class hierarchy

class `ACCESS_TYPES`

  Bases: `object`

  class that defines “access” constants

  `ALL` = ['public', 'private', 'protected']
  `PRIVATE` = 'private'
  `PROTECTED` = 'protected'
  `PUBLIC` = 'public'

class `CLASS_TYPES`

  Bases: `object`

  class that defines “class” type constants

  `ALL` = ['class', 'struct', 'union']
  `CLASS` = 'class'
  `STRUCT` = 'struct'
  `UNION` = 'union'

class `class_declaration_t`(name='')

  Bases: `pygccxml.declarations.declaration.declaration_t`

  describes class declaration

  `aliases`

    List of `aliases` to this instance

  `attributes`

    GCCXML attributes, set using __attribute__((gccxml(“…”)))

    @type: str

  `cache`

    Implementation detail.

    Reference to instance of `algorithms_cache_t` class.

  `create_decl_string`(with_defaults=True)
  `decl_string`

    Declaration full name.

  `decorated_name`

    Unique declaration name extracted from a binary file ( .map, .dll, .so, etc ).

    > @type: str

  `demangled`

    Declaration name, reconstructed from GCCXML generated unique name.

    @type: str

  `get_mangled_name`()
  `i_depend_on_them`(recursive=True)

    Return list of all types and declarations the declaration depends on

  `is_artificial`

    Describes whether declaration is compiler generated or not

    @type: bool

  `location`

    Location of the declaration within source file

    @type: `location_t`

  `mangled`

    Unique declaration name generated by the compiler.

    For GCCXML, you can get the mangled name for all the declarations. When using CastXML, calling mangled is only allowed on functions and variables. For other declarations it will raise an exception.

    Returns: | the mangled name
    Return type: | str

  `name`

    Declaration name @type: str

  `parent`

    Reference to parent declaration.

    @type: declaration_t

  `partial_decl_string`

    Declaration full name.

  `partial_name`

    Declaration name, without template default arguments.

    Right now std containers is the only classes that support this functionality.

  `top_parent`

    Reference to top parent declaration.

    @type: declaration_t

class `class_t`(name='', class_type='class', is_abstract=False)

  Bases: `pygccxml.declarations.scopedef.scopedef_t`, `pygccxml.declarations.byte_info.byte_info`, `pygccxml.declarations.elaborated_info.elaborated_info`

  describes class definition

  `ALLOW_EMPTY_MDECL_WRAPPER` = False
  `RECURSIVE_DEFAULT` = True
  `USE_DEMANGLED_AS_NAME` = True
  `adopt_declaration`(decl, access)

    adds new declaration to the class

    Parameters:

    - decl – reference to a `declaration_t`
    - access (:class:ACCESS_TYPES) – member access type

  `aliases`

    List of `aliases` to this instance

  `attributes`

    GCCXML attributes, set using __attribute__((gccxml(“…”)))

    @type: str

  `bases`

    list of `base classes`

  `byte_align`

    Alignment of this declaration/type in bytes

    Returns: | Alignment of this declaration/type in bytes
    Return type: | int

  `byte_size`

    Size of this declaration/type in bytes

    Returns: | Size of this declaration/type in bytes
    Return type: | int

  `cache`

    Implementation detail.

    Reference to instance of `algorithms_cache_t` class.

  `calldef`(name=None, function=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None)

    returns reference to “calldef” declaration, that is matched defined criteria

  `calldefs`(name=None, function=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None, allow_empty=None)

    returns a set of `calldef_t` declarations, that are matched defined criteria

  `casting_operator`(name=None, function=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None)

    returns reference to casting operator declaration, that is matched defined criteria

  `casting_operators`(name=None, function=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None, allow_empty=None)

    returns a set of casting operator declarations, that are matched defined criteria

  `class_`(name=None, function=None, header_dir=None, header_file=None, recursive=None)

    returns reference to class declaration, that is matched defined criteria

  `class_type`

    describes class `type`

  `classes`(name=None, function=None, header_dir=None, header_file=None, recursive=None, allow_empty=None)

    returns a set of class declarations, that are matched defined criteria

  `clear_optimizer`()

    Cleans query optimizer state

  `constructor`(name=None, function=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None)

    returns reference to constructor declaration, that is matched defined criteria

  `constructors`(name=None, function=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None, allow_empty=None)

    returns a set of constructor declarations, that are matched defined criteria

  `create_decl_string`(with_defaults=True)
  `decl`(name=None, function=None, decl_type=None, header_dir=None, header_file=None, recursive=None)

    returns reference to declaration, that is matched defined criteria

  `decl_string`

    Declaration full name.

  `declaration_not_found_t`
  `declarations`

    List of children declarations.

    Returns: | List[declarations.declaration_t]

  `decls`(name=None, function=None, decl_type=None, header_dir=None, header_file=None, recursive=None, allow_empty=None)

    returns a set of declarations, that are matched defined criteria

  `decorated_name`

    Unique declaration name extracted from a binary file ( .map, .dll, .so, etc ).

    > @type: str

  `demangled`

    Declaration name, reconstructed from GCCXML generated unique name.

    @type: str

  `derived`

    list of `derived classes`

  `elaborated_type_specifier`

    struct, union, class or enum).

    Returns: | elaborated specifier
    Return type: | str
    Type: | Elaborated specifier (can be

  `enum`(name=None, function=None, header_dir=None, header_file=None, recursive=None)

    Deprecated method. Use the enumeration() method instead.

    Deprecated since v1.9.0. Will be removed in v2.0.0

  `enumeration`(name=None, function=None, header_dir=None, header_file=None, recursive=None)

    returns reference to enumeration declaration, that is matched defined criteria

  `enumerations`(name=None, function=None, header_dir=None, header_file=None, recursive=None, allow_empty=None)

    returns a set of enumeration declarations, that are matched defined criteria

  `enums`(name=None, function=None, header_dir=None, header_file=None, recursive=None, allow_empty=None)

    Deprecated method. Use the enumerations() method instead.

    Deprecated since v1.9.0. Will be removed in v2.0.0

  `find_out_member_access_type`(member)

    returns member access type

    Parameters: | member (`declaration_t`) – member of the class
    Return type: | :class:ACCESS_TYPES

  `get_mangled_name`()
  `get_members`(access=None)

    returns list of members according to access type

    If access equals to None, then returned list will contain all members. You should not modify the list content, otherwise different optimization data will stop work and may to give you wrong results.

    Parameters: | access (:class:ACCESS_TYPES) – describes desired members
    Return type: | [ members ]

  `i_depend_on_them`(recursive=True)

    Return list of all types and declarations the declaration depends on

  `init_optimizer`()

    Initializes query optimizer state.

    There are 4 internals hash tables:
      1. from type to declarations
      2. from type to declarations for non-recursive queries
      3. from type to name to declarations
      4. from type to name to declarations for non-recursive queries

    Almost every query includes declaration type information. Also very common query is to search some declaration(s) by name or full name. Those hash tables allows to search declaration very quick.

  `is_abstract`

    describes whether class abstract or not

  `is_artificial`

    Describes whether declaration is compiler generated or not

    @type: bool

  `location`

    Location of the declaration within source file

    @type: `location_t`

  `mangled`

    Unique declaration name generated by the compiler.

    For GCCXML, you can get the mangled name for all the declarations. When using CastXML, calling mangled is only allowed on functions and variables. For other declarations it will raise an exception.

    Returns: | the mangled name
    Return type: | str

  `mem_fun`(name=None, function=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None)

    Deprecated method. Use the member_function() method instead.

    Deprecated since v1.9.0. Will be removed in v2.0.0

  `mem_funs`(name=None, function=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None, allow_empty=None)

    Deprecated method. Use the member_functions() method instead.

    Deprecated since v1.9.0. Will be removed in v2.0.0

  `mem_oper`(name=None, function=None, symbol=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None)

    Deprecated method. Use the member_operator() method instead.

    Deprecated since v1.9.0. Will be removed in v2.0.0

  `mem_opers`(name=None, function=None, symbol=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None, allow_empty=None)

    Deprecated method. Use the member_operators() method instead.

    Deprecated since v1.9.0. Will be removed in v2.0.0

  `member_function`(name=None, function=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None)

    returns reference to member declaration, that is matched defined criteria

  `member_functions`(name=None, function=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None, allow_empty=None)

    returns a set of member function declarations, that are matched defined criteria

  `member_operator`(name=None, function=None, symbol=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None)

    returns reference to member operator declaration, that is matched defined criteria

  `member_operators`(name=None, function=None, symbol=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None, allow_empty=None)

    returns a set of member operator declarations, that are matched defined criteria

  `multiple_declarations_found_t`
  `name`

    Declaration name @type: str

  `operator`(name=None, function=None, symbol=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None)

    returns reference to operator declaration, that is matched defined criteria

  `operators`(name=None, function=None, symbol=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None, allow_empty=None)

    returns a set of operator declarations, that are matched defined criteria

  `parent`

    Reference to parent declaration.

    @type: declaration_t

  `partial_decl_string`

    Declaration full name.

  `partial_name`

    Declaration name, without template default arguments.

    Right now std containers is the only classes that support this functionality.

  `private_members`

    list of all private `members`

  `protected_members`

    list of all protected `members`

  `public_members`

    list of all public `members`

  `recursive_bases`

    list of all `base classes`

  `recursive_derived`

    list of all `derive classes`

  `remove_declaration`(decl)

    removes decl from members list

    Parameters: | decl (`declaration_t`) – declaration to be removed

  `top_class`

    reference to a parent class, which contains this class and defined within a namespace

    if this class is defined under a namespace, self will be returned

  `top_parent`

    Reference to top parent declaration.

    @type: declaration_t

  `typedef`(name=None, function=None, header_dir=None, header_file=None, recursive=None)

    returns reference to typedef declaration, that is matched defined criteria

  `typedefs`(name=None, function=None, header_dir=None, header_file=None, recursive=None, allow_empty=None)

    returns a set of typedef declarations, that are matched defined criteria

  `use_demangled_as_name`
  `variable`(name=None, function=None, decl_type=None, header_dir=None, header_file=None, recursive=None)

    returns reference to variable declaration, that is matched defined criteria

  `variables`(name=None, function=None, decl_type=None, header_dir=None, header_file=None, recursive=None, allow_empty=None)

    returns a set of variable declarations, that are matched defined criteria

class `dependency_info_t`(decl, depend_on_it, access_type=None, hint=None)

  Bases: `object`

  `access_type`
  `decl`

    Deprecated since 1.9.0. Will be removed in 2.0.0.

  `declaration`
  `depend_on_it`
  `find_out_depend_on_it_declarations`()

    If declaration depends on other declaration and not on some type this function will return reference to it. Otherwise None will be returned

  `hint`

    The declaration, that report dependency can put some additional inforamtion about dependency. It can be used later

  static `i_depend_on_them`(decl)

    Returns set of declarations. every item in the returned set, depends on a declaration from the input

  static `we_depend_on_them`(decls)

    Returns set of declarations. every item in the returned set, depends on a declaration from the input

`get_partial_name`(name)

class `hierarchy_info_t`(related_class=None, access=None, is_virtual=False)

  Bases: `object`

  describes class relationship

  `access`
  `access_type`

    describes `hierarchy type`

  `declaration_path`
  `declaration_path_hash`
  `is_virtual`

    indicates whether the inheritance is virtual or not

  `related_class`

    reference to base or derived `class`

class `impl_details`

  Bases: `object`

  static `dig_declarations`(depend_on_it)