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.

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

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

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_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
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

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.

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