#include <nodesystem.h>
This class template contains the functions of PortList which shall also be available on Result<PortList> (and likewise for MutablePortList).
Public Types | |
using | Iterator = GNodeIterator< PortSelector< BASE::MUTABLE > > |
template<typename SUPER > | |
using | ResultFunctions = PortListFunctions< maxon::nodes::details::GNodeResultBase< SUPER > > |
using | Super = maxon::nodes::details::NodeFunctionsSuper< BASE > |
Public Member Functions | |
PORT_DIR | GetPortDirection () const |
Result< NodeSelector< BASE::MUTABLE > > | GetNode () const |
Result< Iterator > | GetPorts () const |
Result< PortSelector< BASE::MUTABLE > > | GetSinglePort () const |
Result< PortSelector< BASE::MUTABLE > > | FindPort (const InternedId &port) const |
Result< PortSelector< BASE::MUTABLE > > | FindPort (const Id &port) const |
template<typename PATH > | |
Result< void > | InitFromPath (typename maxon::nodes::details::NodeFunctionsSuper< BASE >::NodeSystemCtorParam system, PATH &&path, NODE_KIND check=NODE_KIND::PORTLIST_MASK|NODE_KIND::PORT_MASK) |
Private Types | |
template<Bool MUT> | |
using | Selector = PortListSelector< MUT > |
Static Private Attributes | |
static const NODE_KIND | KIND_MASK |
using Iterator = GNodeIterator<PortSelector<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 = PortListFunctions <maxon::nodes::details::GNodeResultBase<SUPER> > |
using Super = maxon::nodes::details::NodeFunctionsSuper<BASE> |
PORT_DIR GetPortDirection | ( | ) | const |
Returns the direction of this port or port list (either PORT_DIR::INPUT or PORT_DIR::OUTPUT).
Result<NodeSelector<BASE::MUTABLE> > GetNode | ( | ) | const |
Returns the enclosing (true) node to which this port list or port belongs.
Returns an iterator over the ports of this port list. This does only include direct children, but not nested ports.
Result<PortSelector<BASE::MUTABLE> > GetSinglePort | ( | ) | const |
Returns the single port of this port list. If this port list does not have exactly one port, an error is returned.
Result<PortSelector<BASE::MUTABLE> > FindPort | ( | const InternedId & | port | ) | const |
Finds the port with the given identifier. Returns a null reference if no such port exists.
[in] | port | The identifier to search for. |
Result<PortSelector<BASE::MUTABLE> > FindPort | ( | const Id & | port | ) | const |
Finds the port with the given identifier. Returns a null reference if no such port exists.
[in] | port | The identifier to search for. |
Result<void> InitFromPath | ( | typename maxon::nodes::details::NodeFunctionsSuper< BASE >::NodeSystemCtorParam | system, |
PATH && | path, | ||
NODE_KIND | check = NODE_KIND::PORTLIST_MASK | NODE_KIND::PORT_MASK |
||
) |
Initializes a g-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. If a node exists but its kind doesn't match the check mask, an IllegalArgumentError is returned.
[in] | system | The node system to use. |
[in] | path | A path which points to a g-node in the given node system. |
[in] | check | A mask of the expected node kind(s). |
|
staticprivate |