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  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  VariableBase
 
class  VirtualInputPort
 
class  VariableMicroNode
 
class  BasicMicroNode
 
class  BatchMicroNode
 
struct  UnannotatedType
 
class  MicroNodeRuntime
 
class  RuntimeErrorInterface
 
class  FrameData
 
class  VarAccess
 
class  ContainerVarAccess
 
class  BatchVarAccess
 

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 PortsDescriptionCallback = void(*)(PortsDescription *)
 
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 {
  NONE ,
  FLOW ,
  DOMAIN ,
  HIERARCHY ,
  PURE_VALUE ,
  STATE_VALUE ,
  VALUE ,
  DOMAIN_FLOW ,
  DOMAIN_FLOW_VALUE ,
  DOMAIN_FLOW_PURE_VALUE ,
  LIFETIME ,
  DEEPLY_SEQUENCED ,
  SEQUENCED ,
  DOMAIN_FLOW_SEQUENCED ,
  DOMAIN_FLOW_VALUE_SEQUENCED ,
  DOMAIN_FLOW_PURE_VALUE_SEQUENCED ,
  DOMAIN_FLOW_SEQUENCED_LIFETIME ,
  DOMAIN_FLOW_VALUE_SEQUENCED_LIFETIME ,
  DOMAIN_FLOW_PURE_VALUE_SEQUENCED_LIFETIME ,
  INDUCED_SEQUENCED ,
  CONTROL_BLOCK ,
  STATE ,
  ALIAS ,
  MARK ,
  RECURSION ,
  MEMBER_ALIAS ,
  LAZY ,
  TRG_MARK ,
  BLOCK_NESTING ,
  SUBTRACTIVE_DOMAIN ,
  ELEMENT_DOMAIN ,
  MATCH_DOMAIN ,
  INDUCED_DOMAIN ,
  FIX_DOMAIN ,
  CONDITIONAL_DOMAIN ,
  INTERSECTION_DOMAIN ,
  FLAG_MASK ,
  INDUCED_MASK ,
  DOMAIN_MASK ,
  PORT ,
  ACCESS_TEST ,
  DEPENDENCY_TEST ,
  ALL ,
  DEFAULT_INPUT ,
  DEFAULT_OUTPUT
}
 

Functions

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 MAXON_ENUM_FLAGS (WIRETYPE)
 
 MAXON_DATATYPE (PortId, "net.maxon.corenode.datatype.portid")
 
template<typename T >
const DataTypeGetPortType ()
 
String ToString (const NodeHandle *h, const FormatStatement *fs, Bool checkDataType=true)
 
 MAXON_DATATYPE (OptimizationInfo, "net.maxon.corenode.datatype.optimizationinfo")
 
template<typename PORTIDTYPE >
constexpr UInt GetPortHashCodeHelper (PORTIDTYPE const &inId)
 
constexpr UInt GetPortHashCodeHelper (LiteralId const &inId)
 
template<Int LENGTH>
constexpr UInt GetPortHashCodeHelper (const char(&inId)[LENGTH])
 

Variables

constexpr MAXON_WARNING_PUSH LiteralId CORENODE_CONVERT_BASEID
 
class maxon::corenodes::PortId MAXON_ENUM_FLAGS
 

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>

◆ PortsDescriptionCallback

using PortsDescriptionCallback = void(*)(PortsDescription*)

◆ 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
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 
DOMAIN 
HIERARCHY 
PURE_VALUE 
STATE_VALUE 
VALUE 
DOMAIN_FLOW 
DOMAIN_FLOW_VALUE 
DOMAIN_FLOW_PURE_VALUE 
LIFETIME 
DEEPLY_SEQUENCED 
SEQUENCED 
DOMAIN_FLOW_SEQUENCED 
DOMAIN_FLOW_VALUE_SEQUENCED 
DOMAIN_FLOW_PURE_VALUE_SEQUENCED 
DOMAIN_FLOW_SEQUENCED_LIFETIME 
DOMAIN_FLOW_VALUE_SEQUENCED_LIFETIME 
DOMAIN_FLOW_PURE_VALUE_SEQUENCED_LIFETIME 
INDUCED_SEQUENCED 
CONTROL_BLOCK 
STATE 
ALIAS 
MARK 
RECURSION 
MEMBER_ALIAS 
LAZY 
TRG_MARK 
BLOCK_NESTING 
SUBTRACTIVE_DOMAIN 
ELEMENT_DOMAIN 
MATCH_DOMAIN 
INDUCED_DOMAIN 
FIX_DOMAIN 
CONDITIONAL_DOMAIN 
INTERSECTION_DOMAIN 
FLAG_MASK 
INDUCED_MASK 
DOMAIN_MASK 
PORT 
ACCESS_TEST 
DEPENDENCY_TEST 
ALL 
DEFAULT_INPUT 
DEFAULT_OUTPUT 

Function Documentation

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

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

◆ MAXON_DATATYPE() [1/2]

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

◆ GetPortType()

const DataType& maxon::corenodes::GetPortType ( )

◆ 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"   
)

◆ GetPortHashCodeHelper() [1/3]

constexpr UInt maxon::corenodes::GetPortHashCodeHelper ( PORTIDTYPE const &  inId)
constexpr

Helper to extract a constexpr hash value from a variety of port name types.

Parameters
[in]inIdMAXON_ATTRIBUTE id.
Returns
The resulting hash code.

◆ GetPortHashCodeHelper() [2/3]

constexpr UInt maxon::corenodes::GetPortHashCodeHelper ( LiteralId const &  inId)
constexpr

Helper to extract a constexpr hash value from a variety of port name types.

Parameters
[in]inIdLiteral id string (usually constexpr).
Returns
The resulting hash code.

◆ GetPortHashCodeHelper() [3/3]

constexpr UInt maxon::corenodes::GetPortHashCodeHelper ( const char(&)  inId[LENGTH])
constexpr

Helper to extract a constexpr hash value from a variety of port name types.

Template Parameters
LENGTHString length (deduced).
Parameters
[in]inIdHardcoded id string.
Returns
The resulting hash code.

Variable Documentation

◆ CORENODE_CONVERT_BASEID

constexpr MAXON_WARNING_PUSH LiteralId CORENODE_CONVERT_BASEID
constexpr

◆ MAXON_ENUM_FLAGS

class maxon::corenodes::PortId MAXON_ENUM_FLAGS