#include <nodesystem.h>
This class template contains the functions of Node which shall also be available on Result<Node> (and likewise for MutableNode).
Public Types | |
using | Iterator = GNodeIterator< NodeSelector< BASE::MUTABLE > > |
template<typename SUPER > | |
using | ResultFunctions = NodeFunctions< maxon::nodes::details::GNodeResultBase< SUPER > > |
using | Super = maxon::nodes::details::NodeFunctionsSuper< BASE > |
Public Member Functions | |
Result< NodeSelector< BASE::MUTABLE > > | GetParent () const |
Result< NodeSelector< BASE::MUTABLE > > | FindChild (const InternedId &name) const |
Result< NodeSelector< BASE::MUTABLE > > | FindChild (const Id &name) const |
template<typename NODE > | |
Result< typename NODE::template Selector< BASE::MUTABLE > > | FindInnerNode (const NODE &baseInner) const |
Result< PortListSelector< BASE::MUTABLE > > | GetPortList (PORT_DIR dir) const |
Result< PortListSelector< BASE::MUTABLE > > | GetInputs () const |
Result< PortListSelector< BASE::MUTABLE > > | GetOutputs () const |
Result< Iterator > | GetChildren () const |
template<typename PATH > | |
Result< void > | InitFromPath (typename maxon::nodes::details::NodeFunctionsSuper< BASE >::NodeSystemCtorParam system, PATH &&path) |
Private Types | |
template<Bool MUT> | |
using | Selector = NodeSelector< MUT > |
Static Private Attributes | |
static const NODE_KIND | KIND_MASK |
using Iterator = GNodeIterator<NodeSelector<BASE::MUTABLE> > |
A GNodeIterator iterates over all children of a g-node. It is returned by NodeFunctions::GetChildren and PortListFunctions::GetPorts. Because both creation and iterator advance can return errors, the iteration doesn't provide the node of the current iteration directly, but wrapped in a Result. Therefore you have to write the loop as follows:
NODE | The node class over which the iterator loops (e.g. Node or MutablePort). |
|
private |
using ResultFunctions = NodeFunctions <maxon::nodes::details::GNodeResultBase<SUPER> > |
using Super = maxon::nodes::details::NodeFunctionsSuper<BASE> |
Result<NodeSelector<BASE::MUTABLE> > GetParent | ( | ) | const |
Returns the parent node of this node. If this node is null or a root node, a null reference is returned.
Result<NodeSelector<BASE::MUTABLE> > FindChild | ( | const InternedId & | name | ) | const |
Finds the direct child node with the given identifier. If this node is null or if there is not exactly one such child, a null reference. This function only searches for true nodes, but not for port lists.
[in] | name | Identifier of the child node to find. |
Result<NodeSelector<BASE::MUTABLE> > FindChild | ( | const Id & | name | ) | const |
Finds the direct child node with the given identifier. If this node is null or if there is not exactly one such child, a null reference. This function only searches for true nodes, but not for port lists.
[in] | name | Identifier of the child node to find. |
Result<typename NODE::template Selector<BASE::MUTABLE> > FindInnerNode | ( | const NODE & | baseInner | ) | const |
Returns a reference to the nested g-node which corresponds to the given nested g-node of a base of this node. #baseInner has to refer to a node which is nested within a base of this node. For example consider the following graph: @graph +-C-------------—+ +-B---------—+ | +-m---------—+ | +-A-----—+ | +-n-----—+ | | | +-n-----—+ | | o port | | o port | | | | o port | | | | |<- - - -| | |<- - - -| | | | | +-------—+ | +-------—+ | | | +-------—+ | | +-----------—+ | +-----------—+ | +---------------—+ @endgraph The nested node m/n
of node system C
has the root node of node system A
as its base (via the intermediate base n
of B
). The root node of A
has port
as a nested g-node, and the corresponding nested g-node of m/n
is the port
nested within m/n
:
[in] | baseInner | Inner node of the base of this node. |
Result<PortListSelector<BASE::MUTABLE> > GetPortList | ( | PORT_DIR | dir | ) | const |
Returns the input or output port list of this node, depending on dir.
[in] | dir | PORT_DIR::INPUT to return the input port list, PORT_DIR::OUTPUT to return the output port list. |
Result<PortListSelector<BASE::MUTABLE> > GetInputs | ( | ) | const |
Returns the input port list of this node. All top-level input ports of a node can be found as children of its input port list.
Result<PortListSelector<BASE::MUTABLE> > GetOutputs | ( | ) | const |
Returns the output port list of this node. All top-level output ports of a node can be found as children of its output port list.
Returns an iterator over the child nodes of this node. This does only include true nodes, but not the input/output port lists.
Result<void> InitFromPath | ( | typename maxon::nodes::details::NodeFunctionsSuper< BASE >::NodeSystemCtorParam | system, |
PATH && | path | ||
) |
Initializes a node reference from a node system and a path. If there's no node in the node system for the given path, this reference is set to a null reference.
[in] | system | The node system to use. |
[in] | path | A path which points to a node in the given node system. |
|
staticprivate |