#include <module.h>
◆ module()
| module::module |
( |
const std::string & | name | ) |
|
|
inline |
◆ add_class()
◆ add_function()
| void module::add_function |
( |
const function & | func | ) |
|
|
inline |
◆ add_overload()
| void module::add_overload |
( |
const nlohmann::json & | ast | ) |
|
|
inline |
◆ add_source()
| void module::add_source |
( |
std::string | json_path | ) |
|
|
inline |
Record a JSON AST this module's contents come from.
The file is parsed on first access, not here: a run imports a handful of the modules the parser emits, and parsing the rest cost ~0.15s of every Python run.
Invariant, load-bearing for the lazy split: parsing a source may only add functions, classes and overloads. It must never add a source or a submodule, because module_manager::find_module walks submodules_ WITHOUT hydrating, so a dotted lookup traverses unhydrated nodes. Following Import nodes here would make every dotted lookup silently miss.
◆ add_submodule()
| void module::add_submodule |
( |
const std::shared_ptr< module > | mod | ) |
|
|
inline |
◆ classes()
◆ functions()
◆ get_class()
Retrieve a class definition by name.
- Parameters
-
| class_name | The name of the class to find |
- Returns
- The class definition, or empty class_definition if not found @complexity O(1) average case via hash lookup
◆ get_function()
| function module::get_function |
( |
const std::string & | func_name | ) |
const |
|
inline |
Retrieve a function definition by name.
- Parameters
-
| func_name | The name of the function to find |
- Returns
- The function definition, or empty function if not found @complexity O(1) average case via hash lookup
◆ hydrated()
| bool module::hydrated |
( |
| ) |
const |
|
inline |
◆ mark_hydrated()
| void module::mark_hydrated |
( |
| ) |
|
|
inline |
◆ name()
| const std::string & module::name |
( |
| ) |
const |
|
inline |
◆ overloads()
◆ readable()
| bool module::readable |
( |
| ) |
const |
|
inline |
False once hydration has run and every source failed to parse.
◆ set_mentions_dunder_all()
| void module::set_mentions_dunder_all |
( |
| ) |
|
|
inline |
◆ set_readable()
| void module::set_readable |
( |
bool | yes | ) |
|
|
inline |
◆ sources()
| const std::vector< std::string > & module::sources |
( |
| ) |
const |
|
inline |
◆ star_import_binds()
| bool module::star_import_binds |
( |
const std::string & | name | ) |
const |
|
inline |
Whether from <this module> import * binds name: a public name, and no mention of __all__, which could narrow what the import binds.
◆ submodules()
The documentation for this class was generated from the following file: