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

MAXON_METHOD const IdGetName () const
 
MAXON_METHOD void SetName (const Id &name)
 
MAXON_METHOD const CoreNodeBaseInterfaceGetParentGroup () const
 
MAXON_FUNCTION CoreNodeBaseInterfaceGetParentGroup ()
 
MAXON_METHOD const 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
 
MAXON_METHOD const DataGetUserData () const
 
MAXON_METHOD void SetUserData (Data &&value)
 
MAXON_METHOD const DataDictionary & GetCompilationData () const
 
MAXON_METHOD void SetCompilationData (DataDictionary &&data)
 

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()

MAXON_METHOD const 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]

MAXON_METHOD const 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]

MAXON_METHOD const 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()

MAXON_METHOD const Data& GetUserData ( ) const

Deprecated. Use GetCompilationData.

◆ SetUserData()

MAXON_METHOD void SetUserData ( Data &&  value)

Deprecated. Use SetCompilationData.

◆ 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

◆ GetCompilationData()

MAXON_METHOD const DataDictionary& GetCompilationData ( ) const

Reads the compiled node's additional attributes. Those attributes are the result of graph compilation. Use instead of GetUserData.

Returns
The additional attribute dictionary. Can be empty.

◆ SetCompilationData()

MAXON_METHOD void SetCompilationData ( DataDictionary &&  data)

Sets the compiler additional attributes. Usually set by CompilerInterface::Compile.

Parameters
[in]dataThe compiler additional attributes for this node.