# pygccxml.declarations.calldef module

defines classes, that describes “callable” declarations

This modules contains definition for next C++ declarations:
  - operator
      - member
      - free
  - function
      - member
      - free
  - constructor
  - destructor

class `argument_t`(name='', decl_type=None, default_value=None, attributes=None)

  Bases: `object`

  class, that describes argument of “callable” declaration

  `attributes`

    GCCXML attributes, set using __attribute__((gccxml(“…”))) @type: str

  `clone`(**keywd)

    constructs new argument_t instance

    return argument_t(
      name=keywd.get(‘name’, self.name), decl_type=keywd.get(‘decl_type’, self.decl_type), default_value=keywd.get(‘default_value’, self.default_value), attributes=keywd.get(‘attributes’, self.attributes ))
  `decl_type`
  `default_value`

    Argument’s default value or None. @type: str

  `ellipsis`

    bool, if True argument represents ellipsis ( “…” ) in function definition

  `name`

    Argument name. @type: str

class `calldef_t`(name='', arguments=None, exceptions=None, return_type=None, has_extern=False, does_throw=True, mangled=None)

  Bases: `pygccxml.declarations.declaration.declaration_t`

  base class for all “callable” declarations

  `argument_types`

    list of all argument types

  `arguments`

    The argument list. @type: list of `argument_t`

  `attributes`

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

    @type: str

  `cache`

    Implementation detail.

    Reference to instance of `algorithms_cache_t` class.

  `calling_convention`

    function calling convention. See :class:CALLING_CONVENTION_TYPES class for possible values

  `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

  `demangled_name`

    returns function demangled name. It can help you to deal with function template instantiations

  `does_throw`

    If False, than function does not throw any exception. In this case, function was declared with empty throw statement.

  `exceptions`

    The list of exceptions. @type: list of `declaration_t`

  `get_mangled_name`()
  `guess_calling_convention`()

    This function should be overriden in the derived classes and return more-or-less successfull guess about calling convention

  `has_ellipsis`
  `has_extern`

    Was this callable declared as “extern”? @type: bool

  `has_inline`

    Was this callable declared with “inline” specifier @type: bool

  `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.

    Returns: | the mangled name
    Return type: | str

  `name`

    Declaration name @type: str

  `optional_args`

    list of all optional arguments, the arguments that have default value

  `overloads`

    A list of overloaded “callables” (i.e. other callables with the same name within the same scope.

    @type: list of `calldef_t`

  `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.

  `required_args`

    list of all required arguments

  `return_type`

    The type of the return value of the “callable” or None (constructors). @type: `type_t`

  `top_parent`

    Reference to top parent declaration.

    @type: declaration_t