# 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

  property aliases

    List of `aliases` to this instance

  i_depend_on_them(recursive=True)

    Return list of all types and declarations the declaration depends on

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

  adopt_declaration(decl, access)

    adds new declaration to the class

    Parameters

      - decl – reference to a `declaration_t`

      - access (:class:ACCESS_TYPES) – member access type

  property aliases

    List of `aliases` to this instance

  property bases

    list of `base classes`

  property class_type

    describes class `type`

  property derived

    list of `derived classes`

  find_out_member_access_type(member)

    returns member access type

    Parameters

      member (`declaration_t`) – member of the class

    Return type

      :class:ACCESS_TYPES

  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

  property is_abstract

    describes whether class abstract or not

  property private_members

    list of all private `members`

  property protected_members

    list of all protected `members`

  property public_members

    list of all public `members`

  property recursive_bases

    list of all `base classes`

  property recursive_derived

    list of all `derive classes`

  remove_declaration(decl)

    removes decl from members list

    Parameters

      decl (`declaration_t`) – declaration to be removed

  property 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

get_partial_name(name)

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

  Bases: `object`

  describes class relationship

  property access
  property access_type

    describes `hierarchy type`

  property declaration_path
  property declaration_path_hash
  property is_virtual

    indicates whether the inheritance is virtual or not

  property related_class

    reference to base or derived `class`