maxon::corenodes Namespace Reference

Detailed Description

This namespace contains the API of the nodes framework.

Namespaces

 details
 

Classes

struct  PortInfo
 
class  CoreNodeBaseInterface
 
class  CoreNodeInterface
 
class  MicroNodeGroupInterface
 
class  CoreNodeGroupInterface
 
class  ConversionNode
 
class  ConversionSequence
 
class  ConstructionErrorInterface
 
class  PortTypeConstructionErrorInterface
 
class  RuntimeErrorBaseInterface
 
class  RuntimeErrorInterface
 
class  RuntimeMessageInterface
 
class  CoreNodeErrorHelper
 
class  PortId
 
class  InPortId
 
class  OutPortId
 
class  IdBuilder
 
class  IdOrBuilder
 
struct  OperatorNodeLlvmBase
 
struct  OperatorNodeLlvm
 
class  OperatorNode
 
class  OperatorNode< OP, RESULT(IN...)>
 
class  MicroNode
 
class  CoreNodeInstanceBaseInterface
 
class  MicroNodePtr
 
class  VariadicPort
 
class  MicroNodeInterface
 
class  CoreNodeInstanceInterface
 
struct  OptimizationInfo
 
struct  ShortCircuitRule
 
class  CoreNodesLib
 
class  VirtualInputPort
 
class  VariableMicroNode
 
class  BasicMicroNode
 
class  VariadicBasicMicroNode
 
class  Uninitialized
 
struct  UnannotatedType
 
class  MicroNodeRuntime
 
class  FrameData
 
class  MicroNodeContext
 
class  DirectVarAccess
 
class  VarAccess
 
class  ContainerVarAccess
 
struct  DirectVarAccessMembers
 
struct  DirectVarAccessMembers<-1 >
 

Typedefs

using CoreNodeFactory = Factory< CoreNode(const DataDictionary &)>
 
using Optimizer = Delegate< Result< Opt< OptimizationInfo > >(const CoreNode &node, const Block< const Tuple< TrivialDataPtr, CORENODE_PORT_FLAGS > > &args)>
 
template<typename TO , typename FROM >
using ConversionNodeBase = OperatorNode< ConversionNode< TO, FROM >, TO(FROM)>
 
using PortError = Tuple< PortId, Error >
 
using PortAccessDescriptionCallback = void(*)(PortAccessDescription *)
 
using LlvmGlobalsReceiver = Delegate< Result< void >(const CString &name, const CString &decl, void *address)>
 

Enumerations

enum class  ACCESS_INDEX : Int {
  UNUSED ,
  INDEX_0 ,
  INDEX_1 ,
  INDEX_2 ,
  INDEX_3
}
 
enum class  WIRETYPE : UInt32 {
  NONE ,
  FLOW ,
  DOMAIN ,
  HIERARCHY ,
  VALUE ,
  LCV_WRITE ,
  REDUCTION_READ_WRITE ,
  DOMAIN_FLOW ,
  DOMAIN_FLOW_VALUE ,
  LIFETIME ,
  LAZY ,
  CONSUMABLE_REQUEST ,
  MODE_MASK ,
  CONTROL_BLOCK ,
  VARLINK ,
  BLOCK_NESTING ,
  SUBTRACTIVE_DOMAIN ,
  ELEMENT_DOMAIN ,
  MATCH_DOMAIN ,
  INDUCED_DOMAIN ,
  FIX_DOMAIN ,
  CONDITIONAL_DOMAIN ,
  INTERSECTION_DOMAIN ,
  INITIALIZE_VALUE ,
  VALUE_FLAG_MASK ,
  FLAG_MASK ,
  INDUCED_MASK ,
  WRITE_MASK ,
  DOMAIN_MASK ,
  ALL ,
  DEFAULT
}
 
enum class  PORTACCESS_FLAGS : UInt32 {
  NONE ,
  CONSUMABLE ,
  OFFSET_MASK ,
  FLAG_MASK
}
 
enum class  PORT_MODE : UInt32 {
  NONE ,
  INPUT_PORT_FLAG ,
  INPUT_FLAG ,
  OUTPUT_FLAG ,
  LCV_PREV_FLAG ,
  LCV_NEXT_FLAG ,
  REDUCTION_FLAG ,
  FINAL_FLAG ,
  UNINITIALIZED ,
  LAZY ,
  CONSUMABLE_REQUEST ,
  MODIFIERS ,
  INPUT ,
  OUTPUT ,
  LCV_PREV ,
  LCV_NEXT ,
  REDUCTION ,
  FINAL
}
 
enum class  PORTS_MODE {
  NONE ,
  ITERATION ,
  BATCH ,
  DIRECT ,
  VARIADIC ,
  MODIFIERS
}
 

Functions

 MAXON_INTERNED_ID ("Root", RootNodeId)
 
template<typename N , typename... ARGS>
Result< CoreNode > CreateNode (const Id &nodeId, ARGS &&... args)
 
template<typename N >
Result< CoreNode > CreateNode ()
 
 MAXON_REGISTRY (CoreNodeFactory, CoreNodes, "net.maxon.corenode.registry.corenodes")
 
template<typename CORENODE >
Result< CoreNodeFactoryCreateCoreNodeFactory (DataDictionary &&meta=DataDictionary())
 
template<typename DEST , typename SRC >
MAXON_WARNING_POP CONVERSION_FLAGS GetScalarConversionFlags ()
 
enum maxon::corenodes::ACCESS_INDEX Int MAXON_ENUM_LIST (ACCESS_INDEX)
 
enum maxon::corenodes::WIRETYPE UInt32 MAXON_ENUM_FLAGS (WIRETYPE)
 
enum maxon::corenodes::PORTACCESS_FLAGS UInt32 MAXON_ENUM_FLAGS (PORTACCESS_FLAGS)
 
 MAXON_DATATYPE (PortId, "net.maxon.corenode.datatype.portid")
 
enum maxon::corenodes::PORT_MODE UInt32 MAXON_ENUM_FLAGS (PORT_MODE)
 
enum maxon::corenodes::PORTS_MODE MAXON_ENUM_FLAGS (PORTS_MODE)
 
String ToString (const NodeHandle *h, const FormatStatement *fs, Bool checkDataType=true)
 
 MAXON_DATATYPE (OptimizationInfo, "net.maxon.corenode.datatype.optimizationinfo")
 
UInt32 ToOffset (PORTACCESS_FLAGS offsetAndFlags)
 

Variables

constexpr MAXON_WARNING_PUSH LiteralId CORENODE_CONVERT_BASEID
 
class maxon::corenodes::PortId MAXON_ENUM_FLAGS
 
static constexpr Char g_coreNodeIdSeparator
 
static constexpr Char g_internalPortPrefix
 
static constexpr Char g_variadicPortIdSeparator
 

Typedef Documentation

◆ CoreNodeFactory

using CoreNodeFactory = Factory<CoreNode(const DataDictionary&)>

A CoreNodeFactory creates a CoreNode given a set of arguments in a DataDictionary. The supported arguments are specific for the core node, some common arguments are defined in CoreNodeBaseInterface such as CoreNodeBaseInterface::Type.

◆ Optimizer

A CoreNode may have an optimizer to provide an optimized handling of the core node given a set of values of its input ports which are known at compile-time.

At compile-time the optimizer is called with the node to optimize and the values of all input ports as arguments, where an empty TrivialDataPtr indicates an unknown (dynamic) value. If an optimization is possible the necessary information is returned in an OptimizationInfo.

To set an optimizer for a core node you have to set the CoreNodeInterface::Optimizer attribute either directly on the core node (CoreNodeBaseInterface::SetValue) or as meta data of the CoreNodeFactory. The latter can be done with the help of MAXON_CORENODE_REGISTER_WITH_METADATA. Also if you use one of the MAXON_CORENODE_REGISTER macros and the core node implementation class has a static Optimize function

static Result<Opt<OptimizationInfo>> Optimize(const CoreNode& node, const Block<const Tuple<TrivialDataPtr, CORENODE_PORT_FLAGS>>& args);
PyObject * args
Definition: abstract.h:159
Definition: node.h:10

this will be used automatically as optimizer.

There is the method CoreNodesLib::CreateOptimizer which returns an optimizer given a number of ShortCircuitRules.

◆ ConversionNodeBase

using ConversionNodeBase = OperatorNode<ConversionNode<TO, FROM>, TO(FROM)>

◆ PortError

using PortError = Tuple<PortId, Error>

◆ PortAccessDescriptionCallback

using PortAccessDescriptionCallback = void(*)(PortAccessDescription*)

◆ LlvmGlobalsReceiver

using LlvmGlobalsReceiver = Delegate<Result<void>(const CString& name, const CString& decl, void* address)>

Enumeration Type Documentation

◆ ACCESS_INDEX

enum ACCESS_INDEX : Int
strong

When a port or micro node is connected to a micro node, the access index tells at which index the MicroNode receives the connection's transported value within the Ports/Batch parameter of the Process method. For indices exceeding INDEX_3 just cast from Int to ACCESS_INDEX. There are also some built-in micro nodes with several parameter connections, they use the access index to identify which connection controls which parameter. Each access index (other than UNUSED) may be used by at most one connection of a micro node.

Enumerator
UNUSED 

The value isn't part of the Ports/Batch parameter of the Process method.

INDEX_0 

The value is accessed at index 0.

INDEX_1 

The value is accessed at index 1.

INDEX_2 

The value is accessed at index 2.

INDEX_3 

The value is accessed at index 3.

◆ WIRETYPE

enum WIRETYPE : UInt32
strong

Core nodes and micro nodes instances and their ports can be connected by wires. The wires are given as a set of WIRETYPE flags.

Enumerator
NONE 
FLOW 

A FLOW wire represents dependencies in a core node graph. Often there is a parallel DOMAIN wire and a parallel VALUE wire.

DOMAIN 

A DOMAIN wire adds the domain of the source to the domain of the target.

HIERARCHY 

A HIERARCHY wire can be set in parallel to FLOW or DOMAIN, this enforces a strict nesting in the execution tree.

VALUE 

A VALUE wire transports the value of its source to its target. This is always in parallel to a FLOW wire. Usually there's a parallel DOMAIN wire, but for reductions and LCVs there are exceptions because they transport a value from within a domain to the outside of that domain.

LCV_WRITE 

Set in parallel to VALUE when there's write access to an LCV variable.

REDUCTION_READ_WRITE 

Set in parallel to VALUE when there's read-write access to a reduction variable.

DOMAIN_FLOW 
DOMAIN_FLOW_VALUE 
LIFETIME 
LAZY 
CONSUMABLE_REQUEST 
MODE_MASK 
CONTROL_BLOCK 
VARLINK 
BLOCK_NESTING 
SUBTRACTIVE_DOMAIN 
ELEMENT_DOMAIN 
MATCH_DOMAIN 
INDUCED_DOMAIN 
FIX_DOMAIN 
CONDITIONAL_DOMAIN 
INTERSECTION_DOMAIN 
INITIALIZE_VALUE 
VALUE_FLAG_MASK 
FLAG_MASK 
INDUCED_MASK 
WRITE_MASK 
DOMAIN_MASK 
ALL 
DEFAULT 

◆ PORTACCESS_FLAGS

enum PORTACCESS_FLAGS : UInt32
strong

These flags describe specifics for the access of a micronode to a port. They can be queried for a port within the Process function of a micronode.

Enumerator
NONE 
CONSUMABLE 

The micronode may consume the port's value because no-one else will read it afterwards. In such a case the micronode can safely modify the value, for example by a std::move to re-use the value for something else.

OFFSET_MASK 

The lower bits of this enum are used internally to encode the offset of the port's data within the current frame.

FLAG_MASK 

Mask for all flags in this enum.

◆ PORT_MODE

enum PORT_MODE : UInt32
strong
Enumerator
NONE 
INPUT_PORT_FLAG 
INPUT_FLAG 
OUTPUT_FLAG 
LCV_PREV_FLAG 
LCV_NEXT_FLAG 
REDUCTION_FLAG 
FINAL_FLAG 
UNINITIALIZED 
LAZY 
CONSUMABLE_REQUEST 
MODIFIERS 
INPUT 
OUTPUT 
LCV_PREV 
LCV_NEXT 
REDUCTION 
FINAL 

◆ PORTS_MODE

enum PORTS_MODE
strong
Enumerator
NONE 
ITERATION 
BATCH 
DIRECT 
VARIADIC 
MODIFIERS 

Function Documentation

◆ MAXON_INTERNED_ID()

maxon::corenodes::MAXON_INTERNED_ID ( "Root"  ,
RootNodeId   
)

Identifier of a graph's root group. Not to confuse with scene root node identifier.

◆ CreateNode() [1/2]

Result<CoreNode> maxon::corenodes::CreateNode ( const Id nodeId,
ARGS &&...  args 
)

Creates a core node from class N. The class N has to contain an Init function where the first parameter is either a MicroNodeGroupRef or a CoreNodeGroupRef and the remaining parameters (if any) have to match the given args. For an example of such a class have a look at MicroNodeGroupInterface.

Template Parameters
NThe class which implements the node. It has to contain an Init function with either a MicroNodeGroupRef or a CoreNodeGroupRef as first parameter.
Parameters
[in]nodeIdThe identifier to use for the node. This may be left empty.
[in]argsOptional arguments for the Init function.
Returns
The created, finalized node.

◆ CreateNode() [2/2]

Result<CoreNode> maxon::corenodes::CreateNode ( )

Creates a core node from class N. The class N has to contain an Init function which takes a single parameter of type MicroNodeGroupRef or CoreNodeGroupRef. For an example of such a class have a look at MicroNodeGroupInterface. To create a node with additional arguments see the other CreateNode function.

Template Parameters
NThe class which implements the node. It has to contain an Init function with either a MicroNodeGroupRef or a CoreNodeGroupRef as parameter.
Returns
The created, finalized node.

◆ MAXON_REGISTRY()

maxon::corenodes::MAXON_REGISTRY ( CoreNodeFactory  ,
CoreNodes  ,
"net.maxon.corenode.registry.corenodes"   
)

The registry for core node factories. You can use one of the MAXON_CORENODE_REGISTER macros to register a core node factory.

◆ CreateCoreNodeFactory()

Result<CoreNodeFactory> maxon::corenodes::CreateCoreNodeFactory ( DataDictionary &&  meta = DataDictionary())

◆ GetScalarConversionFlags()

MAXON_WARNING_POP CONVERSION_FLAGS maxon::corenodes::GetScalarConversionFlags ( )

Call to read the conversion flags that are appropriate for converting a scalar type into another.

See also
MAXON_CORENODE_REGISTER_CONVERSION.
Template Parameters
DESTDestination scalar type.
SRCSource scalar type.
Returns
The chosen conversion flags.

◆ MAXON_ENUM_LIST()

enum maxon::corenodes::ACCESS_INDEX Int maxon::corenodes::MAXON_ENUM_LIST ( ACCESS_INDEX  )

◆ MAXON_ENUM_FLAGS() [1/4]

enum maxon::corenodes::WIRETYPE UInt32 maxon::corenodes::MAXON_ENUM_FLAGS ( WIRETYPE  )

◆ MAXON_ENUM_FLAGS() [2/4]

enum maxon::corenodes::PORTACCESS_FLAGS UInt32 maxon::corenodes::MAXON_ENUM_FLAGS ( PORTACCESS_FLAGS  )

◆ MAXON_DATATYPE() [1/2]

maxon::corenodes::MAXON_DATATYPE ( PortId  ,
"net.maxon.corenode.datatype.portid"   
)

◆ MAXON_ENUM_FLAGS() [3/4]

enum maxon::corenodes::PORT_MODE UInt32 maxon::corenodes::MAXON_ENUM_FLAGS ( PORT_MODE  )

◆ MAXON_ENUM_FLAGS() [4/4]

enum maxon::corenodes::PORTS_MODE maxon::corenodes::MAXON_ENUM_FLAGS ( PORTS_MODE  )

◆ ToString()

String maxon::corenodes::ToString ( const NodeHandle *  h,
const FormatStatement fs,
Bool  checkDataType = true 
)

◆ MAXON_DATATYPE() [2/2]

maxon::corenodes::MAXON_DATATYPE ( OptimizationInfo  ,
"net.maxon.corenode.datatype.optimizationinfo"   
)

◆ ToOffset()

UInt32 maxon::corenodes::ToOffset ( PORTACCESS_FLAGS  offsetAndFlags)

Variable Documentation

◆ CORENODE_CONVERT_BASEID

constexpr MAXON_WARNING_PUSH LiteralId CORENODE_CONVERT_BASEID
constexpr

◆ MAXON_ENUM_FLAGS

class maxon::corenodes::MicroNode MAXON_ENUM_FLAGS

◆ g_coreNodeIdSeparator

constexpr Char g_coreNodeIdSeparator
staticconstexpr

Separator character used to delimit the CoreNode instance identifier from the instruction identifier suffix. For instance in an instruction identifier like "cube@RjgMOC8QOpTpIJWyTRxK5m/primitive/generategeometry#!BASIC_1@60", the CoreNode instance identifier is "cube@RjgMOC8QOpTpIJWyTRxK5m/primitive/generategeometry#".

◆ g_internalPortPrefix

constexpr Char g_internalPortPrefix
staticconstexpr

Id prefix for internal ports which shall not be visible. Private.

◆ g_variadicPortIdSeparator

constexpr Char g_variadicPortIdSeparator
staticconstexpr

Separator for identifiers of variadic port instances, separates between port id and instance id. Private.