CoreNodeInterface Class Reference

#include <corenodes.h>

Inheritance diagram for CoreNodeInterface:

Detailed Description

CoreNodeInterface represents a micro node group or core node group in a finalized state. You have to set those groups into finalized state by calling MicroNodeGroupRef::Finalize() or CoreNodeGroupRef::Finalize() after you have finished the setup of those groups. These methods return the group as a CoreNode. A CoreNode can't be modified, therefore it uses a const reference class.

Public Types

enum class  GML_OPTIONS {
  NONE ,
  DEEP ,
  PORTS ,
  NANO_EMBEDDED ,
  NANO ,
  BLOCK ,
  HIDDEN_PORTS ,
  VERBOSE
}
 
- Public Types inherited from CoreNodeBaseInterface
using ErrorList = Array< Tuple< PortId, Error > >
 

Public Member Functions

MAXON_METHOD Bool IsInvocable () const
 
MAXON_METHOD Result< void > Invoke (const Block< const Tuple< TrivialDataPtr, CORENODE_PORT_FLAGS >> &args) const
 
MAXON_METHOD Result< void > ConvertAndInvoke (const Block< const Tuple< TrivialDataPtr, CORENODE_PORT_FLAGS >> &args) const
 
enum maxon::corenodes::CoreNodeInterface::GML_OPTIONS MAXON_ENUM_FLAGS_CLASS (GML_OPTIONS)
 
MAXON_METHOD Result< void > WriteGml (UrlOrOutputStream &&output, GML_OPTIONS options) const
 
- Public Member Functions inherited from CoreNodeBaseInterface
MAXON_METHOD const IdGetId () const
 
MAXON_METHOD void SetId (const Id &name)
 
MAXON_METHOD CoreNodeFactory GetFactory () const
 
MAXON_METHOD const DataDictionary & GetArguments () const
 
MAXON_METHOD void InitFactory (const CoreNodeFactory &factory, const DataDictionary &args)
 
MAXON_METHOD Bool IsCoreNodeGroup () const
 
MAXON_METHOD Int GetChildCount () const
 
MAXON_METHOD const Interface::Instance * GetChild (Int index) const
 
MAXON_FUNCTION Interface::Instance * GetChild (Int index)
 
MAXON_METHOD const Interface::Instance * FindChild (const Id &name) const
 
MAXON_METHOD Int GetPortCount (PORT_DIR direction) const
 
MAXON_METHOD Int FindPortIndex (const PortId &port) const
 
MAXON_METHOD Result< IntFindValidPortIndex (const PortId &port) const
 
MAXON_METHOD const PortInfoGetPortInfo (const PortId &port) const
 
MAXON_METHOD Result< const PortInfo & > GetValidPortInfo (const PortId &port) const
 
MAXON_METHOD Result< IntAddPort (PORT_DIR direction, const Id &name, const DataType &type)
 
MAXON_METHOD Result< void > AddPassThrough (const InPortId &input, const OutPortId &output, WIRETYPE wires)
 
MAXON_METHOD Result< DataGetValue (const InternedId &attr) const
 
template<typename ATTR >
MAXON_FUNCTION Result< Opt< typename ATTR::ValueType > > GetValue (const ATTR &attr) const
 
MAXON_METHOD Result< void > SetValue (const InternedId &attr, ForwardingDataPtr &&value)
 
template<typename ATTR >
MAXON_FUNCTION Result< void > SetValue (const ATTR &attr, const typename ATTR::ValueType &value)
 
template<typename ATTR >
MAXON_FUNCTION Result< void > SetValue (const ATTR &attr, typename ATTR::ValueType &&value)
 
MAXON_METHOD UniqueHash GetUniqueHashCode () const
 
 MAXON_ATTRIBUTE_CLASS (Bool, Pure, "net.maxon.corenode.pure")
 
 MAXON_ATTRIBUTE_CLASS (maxon::corenodes::Optimizer, Optimizer, "net.maxon.corenode.optimizer")
 
 MAXON_ATTRIBUTE_CLASS (Id, NodeId, "net.maxon.corenode.nodeid")
 
 MAXON_ATTRIBUTE_CLASS (Data, Value, "net.maxon.corenode.value")
 
 MAXON_ATTRIBUTE_CLASS (DataType, Type, "net.maxon.corenode.type")
 
 MAXON_ATTRIBUTE_CLASS (Id, TypeId, "datatype")
 
 MAXON_ATTRIBUTE_CLASS (DataType, InType, "in")
 
 MAXON_ATTRIBUTE_CLASS (DataType, OutType, "out")
 
 MAXON_ATTRIBUTE_CLASS (DataType, SourceType, "net.maxon.corenode.sourcetype")
 
 MAXON_ATTRIBUTE_CLASS (BaseArray< Member >, Members, "net.maxon.corenode.members")
 
 MAXON_ATTRIBUTE_CLASS (Int, Count, "net.maxon.corenode.count")
 
 MAXON_ATTRIBUTE_CLASS (CONVERSION_FLAGS, ConversionFlags, "net.maxon.corenode.conversionflags")
 
 MAXON_ATTRIBUTE_CLASS (String, Message, "net.maxon.corenode.message")
 
 MAXON_ATTRIBUTE_CLASS (ErrorList, Errors, "net.maxon.corenode.errors")
 
 MAXON_ATTRIBUTE_CLASS (Id, VariableId, "net.maxon.corenode.variableid")
 
 MAXON_ATTRIBUTE_CLASS (Array< Id >, Filters, "net.maxon.corenode.filters")
 
MAXON_FUNCTION String ToString (const FormatStatement *fmt=nullptr) const
 

Private Member Functions

 MAXON_INTERFACE_NONVIRTUAL_DERIVED (CoreNodeInterface, MAXON_REFERENCE_CONST, "net.maxon.corenode.interface.corenode")
 

Member Enumeration Documentation

◆ GML_OPTIONS

enum GML_OPTIONS
strong

This enum contains options for the GML output written by WriteGml.

Enumerator
NONE 

No flags.

DEEP 

Write groups deeply, so the complete graph is written up to the micro node level.

PORTS 

Include ports.

NANO_EMBEDDED 

Write nano nodes embedded in their micro nodes.

NANO 

Write the nano graph instead of the core node graph.

BLOCK 

Write the compiled block graph instead of the core node graph.

HIDDEN_PORTS 

Include hidden ports.

VERBOSE 

Verbose output with a lot of information.

Member Function Documentation

◆ MAXON_INTERFACE_NONVIRTUAL_DERIVED()

MAXON_INTERFACE_NONVIRTUAL_DERIVED ( CoreNodeInterface  ,
MAXON_REFERENCE_CONST  ,
"net.maxon.corenode.interface.corenode"   
)
private

◆ IsInvocable()

MAXON_METHOD Bool IsInvocable ( ) const

Checks if this core node supports the Invoke() method. The method is only supported for a limited set of core nodes.

Returns
True if Invoke() is supported, false otherwise.

◆ Invoke()

MAXON_METHOD Result<void> Invoke ( const Block< const Tuple< TrivialDataPtr, CORENODE_PORT_FLAGS >> &  args) const

Invokes the core node directly (as opposed to the invocation from within a compiled core node graph). This is only supported for a limited set of core nodes, see IsInvocable(). The main purpose is to assist the nodes compiler in constant propagation at compile-time.

Parameters
[in]argsThe arguments: At first the values for input ports, afterwards storage locations where output ports write their results.

◆ ConvertAndInvoke()

MAXON_METHOD Result<void> ConvertAndInvoke ( const Block< const Tuple< TrivialDataPtr, CORENODE_PORT_FLAGS >> &  args) const

Invokes the core node directly (see Invoke). Prior to invoke all args elements which to not exactly match the expected DataType will be converted. Use Invoke to use the given args as is. This is only supported for a limited set of core nodes, see IsInvocable(). The main purpose is to assist the nodes compiler in constant propagation at compile-time.

Parameters
[in,out]argsThe arguments: At first the values for input ports, afterwards storage locations where output ports write their results. Any input conversion result will be overwritten in args.

◆ MAXON_ENUM_FLAGS_CLASS()

◆ WriteGml()

MAXON_METHOD Result<void> WriteGml ( UrlOrOutputStream &&  output,
GML_OPTIONS  options 
) const

Writes this core node to a GML file (graph modeling language). This can be used to visualize the core node with a graph viewer application such as yEd.

Parameters
[in]outputThe location to write to.
[in]optionsOptions for the GML output.