![]() |
Spicy
|
#include <node.h>
Public Member Functions | |
NodeBase (Meta meta) | |
NodeBase (std::vector< Node > childs, Meta meta) | |
template<typename T > | |
const T & | child (int i) const |
template<typename T > | |
void | assertChildIsA (int i) |
template<typename T > | |
std::vector< T > | childs (int begin, int end) const |
template<typename T > | |
std::vector< T > | childsOfType () const |
template<typename T > | |
auto | nodesOfType () const |
template<typename T > | |
auto | nodesOfType () |
void | addChild (Node n) |
auto & | childs () const |
auto & | childs () |
auto & | meta () const |
void | setMeta (Meta m) |
const NodeRef & | originalNode () const |
void | setOriginalNode (const NodeRef &n) |
void | clearCache () |
Common base class for classes implementing the Node
interface. The base implements a number of the interface methods with standard versions shared across all nodes.
|
inline |
Constructor.
meta | meta information to associate with the node |
Constructor registering child nodes.
childs | children of this node |
meta | meta information to associate with the node |
|
inline |
Adds a child node. It will be appended to the end of the current list node of children.
|
inline |
Aborts execution if a given child is not an expected type T
.
T | type that the child node is assumed to have |
i | index of the child, in the order they were passed into the constructor and/or added |
|
inline |
Returns a child.
T | type that the child nodes are assumed to (and must) have |
i | index of the child, in the order they were passed into the constructor and/or added |
T
|
inline |
Returns a subrange of children. The indices correspond to the order children were passed into the constructor and/or added.
T | type that the child nodes are assumed to (and must) have |
begin | index of first child to include; a negative index counts Python-style from end of list |
end | index of one beyond last child to include; a negative index counts Python-style from end of list |
start
to end
|
inline |
Implements the Node
interface.
|
inline |
Implements the Node
interface.
|
inline |
Returns a subset of children by type.
T | type of children to return |
T
|
inline |
Implements the Node
interface.
|
inline |
Implements the Node
interface.
|
inline |
Returns a subset of children Node
references, selected by type.
T | type of children to return |
T