CoreNodeInstanceBaseInterface Class Reference

#include <corenodes_instances.h>

Inheritance diagram for CoreNodeInstanceBaseInterface:

Detailed Description

This is the base interface of MicroNodeInterface and CoreNodeInstanceInterface. It stands for instances of nodes in a group: Micro nodes are children of a MicroNodeGroupInterface, core node instances represent core nodes which are used as children of a CoreNodeGroupInterface.

Public Member Functions

const MAXON_METHOD IdGetName () const
 
MAXON_METHOD void SetName (const Id &name)
 
const MAXON_METHOD CoreNodeBaseInterfaceGetParentGroup () const
 
MAXON_FUNCTION CoreNodeBaseInterfaceGetParentGroup ()
 
const MAXON_METHOD NodeHandle * GetHandle () const
 
template<typename... INSTANCEPATH>
MAXON_FUNCTION Result< const NodeHandle * > GetHandle (const INSTANCEPATH &... path) const
 
MAXON_FUNCTION String ToString (const FormatStatement *fmt=nullptr) const
 
const MAXON_METHOD DataGetUserData () const
 
MAXON_METHOD void SetUserData (Data &&value)
 

Static Public Member Functions

static MAXON_METHOD Result< BaseArray< const CoreNodeInstanceBaseInterface * > > GetInstancePath (const NodeHandle *handle)
 
static MAXON_METHOD String PrivateNodeHandleToString (const NodeHandle *handle, const FormatStatement *fs)
 

Private Member Functions

 MAXON_INTERFACE_NONVIRTUAL (CoreNodeInstanceBaseInterface, MAXON_REFERENCE_POINTER, "net.maxon.corenode.interface.corenodeinstancebase")
 

Static Private Member Functions

static MAXON_METHOD Result< const NodeHandle * > GetHandleImpl (Result< const NodeHandle * > &&parent, const CoreNodeInstanceBaseInterface *instance)
 
template<typename... INSTANCEPATH>
static Result< const NodeHandle * > GetHandleImpl (Result< const NodeHandle * > &&parent, const CoreNodeInstanceBaseInterface *instance, const INSTANCEPATH &... rest)
 
static MAXON_METHOD Result< const NodeHandle * > GetHandleImpl (Result< const NodeHandle * > &&parent, Int index)
 
template<typename... INSTANCEPATH>
static Result< const NodeHandle * > GetHandleImpl (Result< const NodeHandle * > &&parent, Int index, const INSTANCEPATH &... rest)
 
static MAXON_METHOD Result< const NodeHandle * > GetHandleImpl (Result< const NodeHandle * > &&parent, const Id &name)
 
template<typename... INSTANCEPATH>
static Result< const NodeHandle * > GetHandleImpl (Result< const NodeHandle * > &&parent, const Id &name, const INSTANCEPATH &... rest)
 
static Result< const NodeHandle * > GetHandleImpl (Result< const NodeHandle * > &&parent)
 
template<typename ELEMENT , typename... INSTANCEPATH>
static Result< const NodeHandle * > GetHandleImpl (Result< const NodeHandle * > &&parent, const Block< ELEMENT > &path, const INSTANCEPATH &... rest)
 
static MAXON_METHOD Result< const NodeHandle * > GetHandleImpl (Result< const NodeHandle * > &&parent, const OutPortId &port, MicroNode::TYPE filter=MicroNode::TYPE::VARIABLE_MASK)
 

Member Function Documentation

◆ MAXON_INTERFACE_NONVIRTUAL()

MAXON_INTERFACE_NONVIRTUAL ( CoreNodeInstanceBaseInterface  ,
MAXON_REFERENCE_POINTER  ,
"net.maxon.corenode.interface.corenodeinstancebase"   
)
private

◆ GetName()

const MAXON_METHOD Id& GetName ( ) const

Returns the name of this instance.

Returns
Name of this instance.

◆ SetName()

MAXON_METHOD void SetName ( const Id name)

Sets the name to use for this instance. Names have to be unique within the group to which this instance belongs.

Parameters
[in]nameThe name to use for the node.

◆ GetParentGroup() [1/2]

const MAXON_METHOD CoreNodeBaseInterface* GetParentGroup ( ) const

Returns the group node to which this node instance belongs.

Returns
The parent group of this node instance.

◆ GetParentGroup() [2/2]

Returns the group node to which this node instance belongs.

Returns
The parent group of this node instance.

◆ GetHandle() [1/2]

const MAXON_METHOD NodeHandle* GetHandle ( ) const

Returns the NodeHandle of this node instance. This is the handle which is used to identify this instance within its enclosing group as root. If the enclosing group G is used as an instance in another group H and you want to identify this instance as a (nested) instance of H, you have to use GetHandle(INSTANCEPATH).

Returns
NodeHandle of this instance within its enclosing group.
See also
NodeHandle

◆ GetHandle() [2/2]

MAXON_FUNCTION Result<const NodeHandle*> GetHandle ( const INSTANCEPATH &...  path) const

Returns the NodeHandle of the nested node instance identified by path. For example consider the case of nested groups H, G, M, N, X (see also NodeHandle):

  • H
    • p: G
      • m: M
        • x: X
      • n: N
    • q: G
      • m: M
        • x: X
      • n: N

To obtain a node handle for the nested node instance p/m/x, we start with p (the node instance within the outmost group H) and have m/x as nested path. So the call {p.GetHandle(m, x)} returns the NodeHandle for the occurrence of m/x within p.

Five types of path elements are supported to identify the instance to use:

  1. You can use a core node instance pointer (CoreNodeInstanceBaseInterface*, CoreNodeInstanceBasePtr and its derived classes).
  2. You can use the index of the instance (an Int).
  3. You can use the name of the instance (an Id).
  4. The last path element can be an output port given by an OutPortId (optionally followed by a MicroNode::TYPE as a filter). Then the return value is the node handle of the micro node which represents the values of the given port. When the optional filter is used, the method only looks for connected micro nodes whose type matches the filter.
  5. Finally you can use a Block of one of the previous four path elements.

GetInstancePath() implements the reverse of this method: For a node handle it returns the path its instances.

Parameters
[in]pathA path of nested node instances, see above for the allowed arguments.
Returns
The NodeHandle for the node instance identified by path.

◆ GetInstancePath()

static MAXON_METHOD Result<BaseArray<const CoreNodeInstanceBaseInterface*> > GetInstancePath ( const NodeHandle *  handle)
static

Returns the path of instances of a NodeHandle. For the following structure of nested groups

  • H
    • p: G
      • m: M
        • x: X
      • n: N
    • q: G
      • m: M
        • x: X
      • n: N

the node handle for x within m within p has the instance path p/m/x. The reverse operation (from an instance path to the node handle) is implemented by GetHandle(INSTANCEPATH).

Parameters
[in]handleA node handle.
Returns
The path of node instances which leads to the instance of the handle.

◆ PrivateNodeHandleToString()

static MAXON_METHOD String PrivateNodeHandleToString ( const NodeHandle *  handle,
const FormatStatement fs 
)
static

◆ ToString()

MAXON_FUNCTION String ToString ( const FormatStatement fmt = nullptr) const

Returns a String representation of this @CLASS.

Parameters
[in]formatStatementNullptr or additional formatting instruction.
Returns
String representation of this @CLASS.

◆ GetUserData()

const MAXON_METHOD Data& GetUserData ( ) const

◆ SetUserData()

MAXON_METHOD void SetUserData ( Data &&  value)

◆ GetHandleImpl() [1/9]

static MAXON_METHOD Result<const NodeHandle*> GetHandleImpl ( Result< const NodeHandle * > &&  parent,
const CoreNodeInstanceBaseInterface instance 
)
staticprivate

◆ GetHandleImpl() [2/9]

static Result<const NodeHandle*> GetHandleImpl ( Result< const NodeHandle * > &&  parent,
const CoreNodeInstanceBaseInterface instance,
const INSTANCEPATH &...  rest 
)
staticprivate

◆ GetHandleImpl() [3/9]

static MAXON_METHOD Result<const NodeHandle*> GetHandleImpl ( Result< const NodeHandle * > &&  parent,
Int  index 
)
staticprivate

◆ GetHandleImpl() [4/9]

static Result<const NodeHandle*> GetHandleImpl ( Result< const NodeHandle * > &&  parent,
Int  index,
const INSTANCEPATH &...  rest 
)
staticprivate

◆ GetHandleImpl() [5/9]

static MAXON_METHOD Result<const NodeHandle*> GetHandleImpl ( Result< const NodeHandle * > &&  parent,
const Id name 
)
staticprivate

◆ GetHandleImpl() [6/9]

static Result<const NodeHandle*> GetHandleImpl ( Result< const NodeHandle * > &&  parent,
const Id name,
const INSTANCEPATH &...  rest 
)
staticprivate

◆ GetHandleImpl() [7/9]

static Result<const NodeHandle*> GetHandleImpl ( Result< const NodeHandle * > &&  parent)
staticprivate

◆ GetHandleImpl() [8/9]

static Result<const NodeHandle*> GetHandleImpl ( Result< const NodeHandle * > &&  parent,
const Block< ELEMENT > &  path,
const INSTANCEPATH &...  rest 
)
staticprivate

◆ GetHandleImpl() [9/9]

static MAXON_METHOD Result<const NodeHandle*> GetHandleImpl ( Result< const NodeHandle * > &&  parent,
const OutPortId port,
MicroNode::TYPE  filter = MicroNode::TYPE::VARIABLE_MASK 
)
staticprivate