# 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

  property 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 ))

  property decl_type
  property default_value

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

  property ellipsis

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

  property 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

  property argument_types

    list of all argument types

  property arguments

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

  property calling_convention

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

  property does_throw

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

  property exceptions

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

  guess_calling_convention()

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

  property has_ellipsis
  property has_extern

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

  property 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

  property mangled

    Unique declaration name generated by the compiler.

    Returns

      the mangled name

    Return type

      str

  property optional_args

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

  property overloads

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

    @type: list of `calldef_t`

  property overrides

    If a function is marked as an overrides, contains the declaration which this function overrides.

  property required_args

    list of all required arguments

  property return_type

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