# pygccxml.declarations.namespace module

Describe a C++ namespace declaration.

`get_global_namespace`(decls)

  Get the global namespace (::) from a declaration tree.

  Parameters: | decls (list[declaration_t]) – a list of declarations
  Returns: | the global namespace_t object (::)
  Return type: | namespace_t

class `namespace_t`(name='', declarations=None)

  Bases: `pygccxml.declarations.scopedef.scopedef_t`

  Describes C++ namespace.

  `ALLOW_EMPTY_MDECL_WRAPPER` = False
  `RECURSIVE_DEFAULT` = True
  `adopt_declaration`(decl)
  `attributes`

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

    @type: str

  `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

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

  `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

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

    Deprecated method. Use the free_function() method instead.

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

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

    Returns reference to free function declaration that matches a defined criteria.

  `free_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 free function declarations that match a defined criteria.

  `free_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 free_functions() method instead.

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

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

    Returns reference to free operator declaration that matches a defined criteria.

  `free_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 free operator declarations that match a defined criteria.

  `get_mangled_name`()
  `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_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

  `namespace`(name=None, function=None, recursive=None)

    Returns reference to namespace declaration that matches a defined criteria.

  `namespaces`(name=None, function=None, recursive=None, allow_empty=None)

    Returns a set of namespace declarations that match a defined criteria.

  `nss`(name=None, function=None, recursive=None, allow_empty=None)

    Deprecated method. Use the namespaces() method instead.

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

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

  `remove_declaration`(decl)

    Removes declaration from members list.

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

  `take_parenting`(inst)

    Takes parenting from inst and transfers it to self.

    Parameters: | inst (namespace_t) – a namespace declaration

  `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

  `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