|
MIRA
|
Variable scope of the macro processor. More...
#include <xml/macros/Scope.h>
Public Types | |
| using | Ptr = std::shared_ptr< Scope > |
Public Member Functions | |
| MacroPtr | findOptional (const Identifier &id) const |
| MacroPtr | find (const Identifier &name) const |
| void | define (Identifier id, MacroPtr macro) |
| void | collectGarbage () |
| Remove any definitions that no one else depends on. More... | |
Public Attributes | |
| Scope::Ptr | parent = nullptr |
| std::unordered_map< std::string, Definitions > | namespaces |
Variable scope of the macro processor.
Scopes work similarly to scopes in C++. Each scope may contain a number of definitions. Each scope may have a parent scope from which definitions are inherited.
|
inline |
|
inline |
|
inline |
|
inline |
Remove any definitions that no one else depends on.
This may be required to avoid memory leaks in definitions which themselves hold a shared_ptr to this scope.
| Scope::Ptr parent = nullptr |
| std::unordered_map<std::string, Definitions> namespaces |
1.8.14