#include <corenodes_instances.h>
A MicroNodeInterface instance wraps a MicroNode so that it can be part of a micro node group.
MicroNodeInterface instances aren't created directly, instead you create them by one of the MicroNodeGroupRef::Add functions which get a MicroNode as parameter and impliclity create the required MicroNodeInterface wrapper. For example in the following code
the call to Add adds an instance of the BasicMicroNode implementation class Impl to #group and returns a pointer to the MicroNodeInterface instance which wraps the Impl object.
MicroNodeInterface instances are always owned by the enclosing micro node group, therefore there is no reference class.
Private Member Functions | |
MAXON_INTERFACE_NONVIRTUAL_DERIVED (MicroNodeInterface, MAXON_REFERENCE_POINTER, "net.maxon.corenode.interface.micronode") | |
MAXON_GENERIC ((std::is_base_of) typename MN=MicroNode) | |
MAXON_METHOD Result< Int > | ExportImpl (const PortId &parentPort, WIRETYPE wires, ACCESS_INDEX index, const DataType &type, MicroNode::FLAGS flags) |
template<typename MN > | |
ResultOk< void > | operator() () |
template<typename MN , typename T , typename = typename std::enable_if<MN::template AllowsChild<T>::value && T::template AllowsParent<MN>::value>::type> | |
Result< void > | AddChild (MicroNodePtr< T > mn, WIRETYPE wt=WIRETYPE::DOMAIN_FLOW|WIRETYPE::HIERARCHY) |
Additional Inherited Members | |
Static Public Member Functions inherited from CoreNodeInstanceBaseInterface | |
static MAXON_METHOD Result< BaseArray< const CoreNodeInstanceBaseInterface * > > | GetInstancePath (const NodeHandle *handle) |
static MAXON_METHOD String | PrivateNodeHandleToString (const NodeHandle *handle, const FormatStatement *fs) |
|
private |
|
private |
The type of the micro node implementation class of this micro node.
MAXON_FUNCTION const MicroNodeGroupInterface* GetParentGroup | ( | ) | const |
Returns the micro node group to which this micro node belongs.
MAXON_FUNCTION MicroNodeGroupInterface* GetParentGroup | ( | ) |
Returns the micro node group to which this micro node belongs.
MAXON_METHOD MicroNode::TYPE GetType | ( | ) | const |
Returns the type of this micro node. This is the type of the MicroNode implementation wrapped by this node.
MAXON_METHOD const MN& GetImplementation | ( | ) | const |
Returns the MicroNode implementation which is wrapped by this MicroNodeInterface instance.
MicroNode& GetImplementation | ( | ) |
Returns the MicroNode implementation which is wrapped by this MicroNodeInterface instance.
MAXON_METHOD void AddFlags | ( | MicroNode::FLAGS | flags | ) |
Adds additional flags to the micro node.
[in] | flags | The flags to add. Only modifier flags (MicroNode::FLAGS::MODIFIERS) can be added. |
MAXON_METHOD Result<void> SetDataType | ( | const DataType & | type | ) |
Sets the data type of this micro node. This is only supported for a subset of micro nodes.
[in] | type | The data type of this micro node. |
MAXON_FUNCTION Result<BaseArray<typename VARIADIC_ACCESS::VPort::PortId> > AddVariadicPort | ( | VARIADIC_ACCESS MN::* | acc, |
const CString & | prefix, | ||
const Data & | arg, | ||
WIRETYPE | wires = VARIADIC_ACCESS::VPort::DEFAULT_WIRE , |
||
const DataType & | type = GetZeroRef<DataType>() , |
||
MicroNode::FLAGS | flags = MicroNode::FLAGS::NONE |
||
) |
Adds a variadic port to this micro node. The number and names of the variadic port instances are determined from arg:
The typical use looks as follows:
[in] | acc | Pointer-to-member for a member of the micro node implementation MN of type VariadicPort<const T>::Access. This member can be used in the micro node implementation to loop over the port instances. |
[in] | prefix | A name prefix. |
[in] | arg | This controls the number and names of the port instances, see above. |
[in] | wires | The wires to use for the connection to the port instances. |
[in] | type | The type to use for the variadic ports. By default this is the type of #acc. |
[in] | flags | Additional flags for the created ports. |
MAXON_FUNCTION Result<BaseArray<typename VARIADIC_ACCESS::VPort::PortId> > AddVariadicPort | ( | VARIADIC_ACCESS MN::* | acc, |
const CString & | prefix, | ||
Int | count, | ||
Int | base = 0 , |
||
WIRETYPE | wires = VARIADIC_ACCESS::VPort::DEFAULT_WIRE , |
||
MicroNode::FLAGS | flags = MicroNode::FLAGS::NONE |
||
) |
Adds a variadic port to this micro node. See the other AddVariadicPort function for a description. This functions differs from the other one in how the variadic ports are given: count is the number of variadic ports, and the names are given by the prefix, then a # and finally an index which starts with base. If base is negative, count has to be 1, then the name of the single port is just the prefix plus #.
[in] | acc | Pointer-to-member for a member of the micro node implementation MN of type VariadicPort<const T>::Access. This member can be used in the micro node implementation to loop over the port instances. |
[in] | prefix | A name prefix. |
[in] | count | The number of port instances to create. |
[in] | base | The base to use for name counting. |
[in] | wires | The wire types to use for the connection to the port instances. |
[in] | flags | Additional flags for the created ports. |
MAXON_FUNCTION Result<BaseArray<typename VARIADIC_ACCESS::VPort::PortId> > AddVariadicPort | ( | VARIADIC_ACCESS MN::* | acc, |
const Block< const Member > & | members, | ||
WIRETYPE | wires = VARIADIC_ACCESS::VPort::DEFAULT_WIRE , |
||
MicroNode::FLAGS | flags = MicroNode::FLAGS::NONE |
||
) |
MAXON_METHOD Result<void> Connect | ( | ACCESS_INDEX | thisIndex, |
MicroNodeInterface * | target, | ||
ACCESS_INDEX | targetIndex, | ||
WIRETYPE | wires | ||
) |
Adds a connection from this micro node to the target micro node. thisIndex and targetIndex control at which index the Process methods of #this and target produce/receive the value transported by the connection.
To connect a micro node with a port of its enclosing group, use Export().
[in] | thisIndex | The index of the parameter of this micro node which shall be transported along the connection. Use ACCESS_INDEX::UNUSED when this is not needed. |
[in] | target | Another micro node. |
[in] | targetIndex | The index of the parameter of the target micro node which shall receive the transported value of the connection. Use ACCESS_INDEX::UNUSED when this is not needed. |
[in] | wires | The wires to use for the connection. Already existing wires aren't changed. Wires which aren't supported by both ends are ignored. |
MAXON_FUNCTION Result<void> Connect | ( | MicroNodeInterface * | target, |
WIRETYPE | wires | ||
) |
Adds a connection from this micro node to the target micro node. If it is necessary to specify at least one ACCESS_INDEX for the connection, use the other Connect() method.
To connect a micro node with a port of its enclosing group, use Export().
[in] | target | Another micro node. |
[in] | wires | The wires to use for the connection. Already existing wires aren't changed. Wires which aren't supported by both ends are ignored. |
MAXON_FUNCTION Result<InPortId> Export | ( | const InPortId & | parentPort, |
WIRETYPE | wires, | ||
ACCESS_INDEX | index, | ||
const DataType & | type = DataType::NullValue() , |
||
MicroNode::FLAGS | flags = MicroNode::FLAGS::NONE |
||
) |
Exports an input parameter of this micro node to a port of the enclosing group. This is only needed for built-in micro nodes, custom micro nodes automatically export their ports according to the parameters of the Process method.
If parentPort is given by a name for which there is no port yet, a corresponding port is created at the enclosing group. If parentPort is empty or has an empty name, the name of this micro node is used instead of parentPort.
[in] | parentPort | A port of the enclosing group. |
[in] | wires | The wires to use for the export connection. Already existing wires aren't changed. Wires which aren't supported by this micro node are ignored. |
[in] | index | The index of the input parameter of this micro node which shall be exported. Use ACCESS_INDEX::UNUSED (the default) when this is not needed. |
[in] | type | An optional type for the exported port. This is combined with the current type of the exported port, which may result in an error if the types can't be combined. |
[in] | flags | Optional flags for the input port. |
MAXON_FUNCTION Result<InPortId> Export | ( | const InPortId & | parentPort, |
WIRETYPE | wires = WIRETYPE::DEFAULT_INPUT , |
||
MicroNode::FLAGS | flags = MicroNode::FLAGS::NONE |
||
) |
Exports an input parameter of this micro node to a port of the enclosing group. This is only needed for built-in micro nodes, custom micro nodes automatically export their ports according to the parameters of the Process method.
If parentPort is given by a name for which there is no port yet, a corresponding port is created at the enclosing group. If parentPort is empty or has an empty name, the name of this micro node is used instead of parentPort.
[in] | parentPort | A port of the enclosing group. |
[in] | wires | The wires to use for the export connection. Already existing wires aren't changed. Wires which aren't supported by this micro node are ignored. |
[in] | flags | Optional flags for the input port. |
MAXON_FUNCTION Result<OutPortId> Export | ( | const OutPortId & | parentPort, |
WIRETYPE | wires, | ||
ACCESS_INDEX | index, | ||
const DataType & | type = DataType::NullValue() , |
||
MicroNode::FLAGS | flags = MicroNode::FLAGS::NONE |
||
) |
Exports an output parameter of this micro node to a port of the enclosing group. This is only needed for built-in micro nodes, custom micro nodes automatically export their ports according to the parameters of the Process method.
If parentPort is given by a name for which there is no port yet, a corresponding port is created at the enclosing group. If parentPort is empty or has an empty name, the name of this micro node is used instead of parentPort.
[in] | parentPort | A port of the enclosing group. |
[in] | wires | The wires to use for the export connection. Already existing wires aren't changed. Wires which aren't supported by this micro node are ignored. |
[in] | index | The index of the output parameter of this micro node which shall be exported. Use ACCESS_INDEX::UNUSED (the default) when this is not needed. |
[in] | type | An optional type for the exported port. This is combined with the current type of the exported port, which may result in an error if the types can't be combined. |
[in] | flags | Optional flags for the input port. |
MAXON_FUNCTION Result<OutPortId> Export | ( | const OutPortId & | parentPort, |
WIRETYPE | wires = WIRETYPE::DEFAULT_OUTPUT , |
||
MicroNode::FLAGS | flags = MicroNode::FLAGS::NONE |
||
) |
Exports an output parameter of this micro node to a port of the enclosing group. This is only needed for built-in micro nodes, custom micro nodes automatically export their ports according to the parameters of the Process method.
If parentPort is given by a name for which there is no port yet, a corresponding port is created at the enclosing group. If parentPort is empty or has an empty name, the name of this micro node is used instead of parentPort.
[in] | parentPort | A port of the enclosing group. |
[in] | wires | The wires to use for the export connection. Already existing wires aren't changed. Wires which aren't supported by this micro node are ignored. |
[in] | flags | Optional flags for the input port. |
MAXON_FUNCTION Result<typename PORT::PortIdType> Export | ( | const PORT & | parentPort, |
WIRETYPE | wires = PORT::PortIdType::DEFAULT_WIRE , |
||
ACCESS_INDEX | index = ACCESS_INDEX::UNUSED , |
||
MicroNode::FLAGS | flags = MicroNode::FLAGS::NONE |
||
) |
Exports a parameter of this micro node to a port of the enclosing group. This is only needed for built-in micro nodes, custom micro nodes automatically export their ports according to the parameters of the Process method.
This function can be used instead of the other Export functions when a port from a MAXON_PORT macro shall be used as argument instead of an index or name. The name of the port, followed by a pair of parentheses, has to be used as argument for parentPort:
For indexed ports you have to specify the indices within the parentheses, MicroNodeGroupInterface::GetPort.
[in] | parentPort | One of the ports declared by a MAXON_PORT macro within the enclosing group. A parentheses pair, possibly including indices, is needed after the name, see example. |
[in] | wires | The wires to use for the export connection. Already existing wires aren't changed. Wires which aren't supported by this micro node are ignored. |
[in] | index | The index of the parameter of this micro node which shall be exported. Use ACCESS_INDEX::UNUSED (the default) when this is not needed. |
[in] | flags | Optional flags for the input port. |
MAXON_FUNCTION Result<void> operator() | ( | Result< A > && | arg, |
ARGS &&... | args | ||
) |
@MAXON_ANNOTATION{returnsThis}
MAXON_FUNCTION Result<void> operator() | ( | A && | arg, |
ARGS &&... | args | ||
) |
@MAXON_ANNOTATION{returnsThis}
|
private |
|
private |
|
private |