#include <nodesystem.h>
This class template contains the functions of Port which shall also be available on Result<Port> (and also for MutablePort).
Public Types | |
template<typename SUPER > | |
using | ResultFunctions = PortFunctions< maxon::nodes::details::GNodeResultBase< SUPER > > |
using | Super = PortFunctionsSuper< BASE > |
Public Member Functions | |
Result< PortListSelector< BASE::MUTABLE > > | GetParent () const |
Result< Bool > | GetConnections (PORT_DIR dir, const ValueReceiver< const ConnectionSelector< BASE::MUTABLE > & > &conns, Wires mask=Wires::All(), NodeSystemInterface::GET_CONNECTIONS_MODE mode=NodeSystemInterface::GET_CONNECTIONS_MODE::CONNECTIONS) const |
Result< Wires > | GetWires (const PortSelector< BASE::MUTABLE > &target) const |
Result< Bool > | GetConnectionValues (const PortSelector< BASE::MUTABLE > &target, const ValueReceiver< CONNECTION_POSITION, InternedId, const ConstDataPtr & > &receiver) const |
Result< ConstDataPtr > | GetConnectionValue (const PortSelector< BASE::MUTABLE > &target, CONNECTION_POSITION position, const InternedId &attr, const DataType &expectedType) const |
template<typename T > | |
Result< Opt< const T & > > | GetConnectionValue (const PortSelector< BASE::MUTABLE > &target, CONNECTION_POSITION position, const InternedId &attr) const |
template<typename ATTR > | |
Result< Opt< const typename ATTR::ValueType & > > | GetConnectionValue (const PortSelector< BASE::MUTABLE > &target, CONNECTION_POSITION position, const ATTR &attr) const |
TimeStamp | GetConnectionStamp (PORT_DIR direction) const |
Bool | IsPortOfRoot () const |
Bool | IsTopLevelPort () const |
Int | GetTopologicalLayer () const |
template<typename PATH > | |
Result< void > | InitFromPath (typename PortFunctionsSuper< BASE >::NodeSystemCtorParam system, PATH &&path, NODE_KIND check=NODE_KIND::PORT_MASK) |
Private Types | |
template<Bool MUT> | |
using | Selector = PortSelector< MUT > |
Static Private Attributes | |
static const NODE_KIND | KIND |
|
private |
using ResultFunctions = PortFunctions <maxon::nodes::details::GNodeResultBase<SUPER> > |
using Super = PortFunctionsSuper<BASE> |
Result<PortListSelector<BASE::MUTABLE> > GetParent | ( | ) | const |
Result<Bool> GetConnections | ( | PORT_DIR | dir, |
const ValueReceiver< const ConnectionSelector< BASE::MUTABLE > & > & | conns, | ||
Wires | mask = Wires::All() , |
||
NodeSystemInterface::GET_CONNECTIONS_MODE | mode = NodeSystemInterface::GET_CONNECTIONS_MODE::CONNECTIONS |
||
) | const |
Yields all connections of this port for the given direction. This includes not only connections which have been added at the level of the node system of this reference, but also inherited connections from base node systems and implicit connections from enclosing ports. It does not include connections which have been marked as removed (see WIRE_MODE::REMOVE).
[in] | dir | Whether to yield incoming or outgoing connections. |
[out] | conns | The receiver for the found connections. |
[in] | mask | Only yield connections whose wires match this mask. |
[in] | mode | Mode for GetConnections. |
Result<Wires> GetWires | ( | const PortSelector< BASE::MUTABLE > & | target | ) | const |
Returns the Wires which are present between this port (source) and target. Like GetConnections this includes connections which are inherited from a base node system and implicit connections from enclosing ports. It does not include connections which have been marked as removed (see WIRE_MODE::REMOVE).
[in] | target | The target port. |
Result<Bool> GetConnectionValues | ( | const PortSelector< BASE::MUTABLE > & | target, |
const ValueReceiver< CONNECTION_POSITION, InternedId, const ConstDataPtr & > & | receiver | ||
) | const |
Gets all attribute values of the connection from this port to target.
[in] | target | The other end of the connection. |
[out] | receiver | All attribute values of the connection will be reported to the receiver. |
Result<ConstDataPtr> GetConnectionValue | ( | const PortSelector< BASE::MUTABLE > & | target, |
CONNECTION_POSITION | position, | ||
const InternedId & | attr, | ||
const DataType & | expectedType | ||
) | const |
Gets the value of the given attribute for the connection from this port to target. If there is no such connection, the connection has no value for the attribute or the value doesn't have the expected type, a null ConstDataPtr is returned.
[in] | target | The other end of the connection. |
[in] | position | The connection position at which the attribute's value shall be obtained. |
[in] | attr | The attribute whose value shall be obtained. |
[in] | expectedType | The expected type of the attribute value, may be nullptr if no check shall be done. |
Result<Opt<const T&> > GetConnectionValue | ( | const PortSelector< BASE::MUTABLE > & | target, |
CONNECTION_POSITION | position, | ||
const InternedId & | attr | ||
) | const |
Gets the value of the given attribute for the connection from this port to target. If there is no such connection, the connection has no value for the attribute or the value doesn't have the expected type, an empty Opt is returned.
[in] | target | The other end of the connection. |
[in] | position | The connection position at which the attribute's value shall be obtained. |
[in] | attr | The attribute whose value shall be obtained. |
Result<Opt<const typename ATTR::ValueType&> > GetConnectionValue | ( | const PortSelector< BASE::MUTABLE > & | target, |
CONNECTION_POSITION | position, | ||
const ATTR & | attr | ||
) | const |
Gets the value of the given attribute attr for the connection from this port to target. If there is no such connection, the connection has no value for the attribute or the value doesn't have the expected type, an empty Opt is returned.
[in] | attr | The attribute whose value shall be obtained. |
[in] | target | The other end of the connection. |
[in] | position | The connection position at which the attribute's value shall be obtained. |
Returns the modification stamp of incoming/outgoing connections for this port. This is the value of the graph's time stamp (see GraphModelInterface::GetModificationStamp) at the time when connections in the given direction have been modified last for this port.
[in] | direction | The connection direction. |
Bool IsPortOfRoot | ( | ) | const |
Checks if this port is a port of the root node of a node system. This includes not only top-level ports, but also nested ports.
Bool IsTopLevelPort | ( | ) | const |
Checks if this port is a top-level port. A top-level port is a port which is not nested within another port, but a direct child of the input or output port list of a node.
Int GetTopologicalLayer | ( | ) | const |
Returns an Int value which corresponds to a topological layer index for this port. The connections within a node system build a directed acyclic graph, and the node system sets up a corresponding topological layering of all ports within MutableRoot::ValidateTopology(). Ports within the same layer aren't reachable from each other. Whenever port x can be reached from port y via a number of connections, the layer of x is greater than the layer of y. However the reverse is not true, so different layer indices don't imply reachability. You can use the fact that two ports are in the same layer for parallelization: In that case computations on these ports are usually independent.
For the topplogical layering only top-level ports are considered, connections between nested ports are treated as if they were between their enclosing top-level ports. Therefore the layer of a nested port is the same as the layer of its enclosing port.
Result<void> InitFromPath | ( | typename PortFunctionsSuper< BASE >::NodeSystemCtorParam | system, |
PATH && | path, | ||
NODE_KIND | check = 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 |