#include <nodesystem.h>
A NodeSystem owns and manages a complete hierarchy of nodes and ports. NodeSystem is a copy-on-write reference, therefore each non-const method may create a copy of the original node system at first. However the copy is done by sharing the internal data, so it is a lightweight operation.
Traversal of a node system starts with GetRoot().
NodeSystem is a copy-on-write reference class, but you can't call non-const methods or MakeWritable directly. Instead, for modifications, you have to call BeginModification() to obtain write access to the hierarchy through a MutableRoot. As long as you make modifications, you have to ensure that no other thread uses the reference to the node system, or synchronize the threads in an appropriate way. As last step of a sequence of modifications you have to call MutableRoot::EndModification().
The implementation class of this interface is a final class, so you can't override it. However some behavior is delegated to NodeSystemClass and NodeSystemDerivationHandler to allow for customization of certain aspects.
Public Types | |
enum class | GML_OPTIONS { NONE , DIRECT_ATTRIBUTES , BASE_ATTRIBUTES , DERIVED_ATTRIBUTES , BASES , ALL_BASES , NO_CONNECTIONS , INDUCED_CONNECTIONS , ATTRIBUTES } |
enum class | FINALIZE_FLAGS { NONE , CLEANUP , FOR_GROUP } |
using | GET_CONNECTIONS_MODE = GraphModelInterface::GET_CONNECTIONS_MODE |
Static Public Attributes | |
static constexpr WIRE_MODE | VALUE_CHAIN |
static constexpr WIRE_MODE | VALUE_SECONDARY |
static constexpr WIRE_MODE | VALUE_DEFAULT |
static constexpr WIRE_MODE | VALUE_COUNTERCHAIN |
static constexpr WIRE_MODE | DEPENDENCY_TYPE |
static constexpr WIRE_MODE | DEPENDENCY_COMPONENT |
Private Attributes | |
MAXON_INTERFACE_SINGLE_IMPLEMENTATION | |
Friends | |
class | GNodeIteratorBase |
template<typename NODE > | |
class | GNodeIterator |
template<typename BASE > | |
class | GNodeFunctions |
template<typename BASE > | |
class | MutableGNodeFunctions |
template<typename BASE > | |
class | NodeFunctions |
template<typename BASE > | |
class | PortListFunctions |
template<typename BASE > | |
class | MutablePortListFunctions |
template<typename BASE > | |
class | PortFunctions |
template<typename BASE > | |
class | MutablePortFunctions |
class | GNode |
class | GNodeBase |
class | MutableGNode |
class | MutableNode |
class | MutableRoot |
class | MutablePortList |
class | Port |
class | MutablePort |
class | NodeSystemImpl |
class | NodesLibImpl |
class | CompiledNodeImpl |
class | NodesGraphModelImpl |
class | NodeSystemManagerImpl |
class | NodeSystemBasedTemplateImpl |
class | CoreNodeWrapperImpl |
|
strong |
This enum contains options for the GML output written by WriteGml.
|
strong |
MutableRoot::EndModification() passes FINALIZE_FLAGS to NodeSystemClassInterface::FinalizeModification, this is used to control which finalizations shall be done during MutableRoot::EndModification().
Enumerator | |
---|---|
NONE | Don't do any finalizations at all. |
CLEANUP | Run clean-up finalizations. |
FOR_GROUP | Deprecated. |
|
private |
MAXON_METHOD const NodeSystemClass& GetNodeSystemClass | ( | ) | const |
Returns the node system class which created this node system. Only node systems of the same node system class can be used together.
MAXON_METHOD const NodeSystemDerivationHandler& GetDerivationHandler | ( | ) | const |
Returns the derivation handler of this node system. Node templates can override the default derivation handler when they instantiate a node system using MutableRoot::SetDerivarionHandler().
MAXON_METHOD const NodeSystem& GetBase | ( | ) | const |
Returns the base node system of which this node system is an instance. If this node system is not an instance of a base, the method returns a null reference.
MAXON_METHOD const Block<const NodeSystem>& GetBases | ( | ) | const |
Returns the base node systems of which this node system is an instance. The entry at index 0 refers to the node system of which this node system has been created as instance by CreateInstance(), this will be a null reference if the node systems hasn't been created this way. It's the same as the node system returned by GetBase(). The remaining entries list the bases which have been added by AddBase().
MAXON_METHOD Bool HasBase | ( | const IdAndVersion & | baseId | ) | const |
Checks if this node system has the node template asset given by baseId as a base. This is the case if
[in] | baseId | The asset identifier of a node template. |
MAXON_METHOD Result<Array<IdAndVersion> > GetAllBaseAssets | ( | ) | const |
MAXON_METHOD Result<Bool> GetAllBases | ( | const ValueReceiver< const NodeSystem & > & | receiver | ) | const |
Recursively finds all the bases of the node system starting from the content of GetBases.
[in] | receiver | ValueReceiver or Array that will receive all the base NodeSystem found. |
MAXON_METHOD const NodeTemplate& GetTemplate | ( | ) | const |
Returns the node template which instantiated this node system. If this node system is no instantiation of a node template, the method returns a null reference.
MAXON_METHOD const TemplateArguments& GetArguments | ( | ) | const |
Returns the template arguments which have been used for this instantiation of a node template (if this node system is an instantiation of a node template at all).
MAXON_METHOD const AssetRepositoryRef& GetTemplateLookupRepository | ( | ) |
Returns the asset repository which is used for asset lookup during the current modification. After MutableRoot::EndModification has been called, this will be a null reference.
Node GetRoot | ( | ) | const |
Returns the root node of this node system as an immutable Node. You can traverse the node system starting at the root, but you can't get write access to the node system via Node. For write-access use the function BeginModification() instead.
MAXON_ADD_TO_COPY_ON_WRITE_REFERENCE_CLASS | ( | Result< MutableRoot > BeginModification(const AssetRepositoryRef &repo, Bool keepCurrent=false);Result< MutableRoot > BeginInstantiationModification(const AssetRepositoryRef &repo, const NodeTemplate &templ);Result< MutableRoot > BeginSubstitutionModification(const AssetRepositoryRef &repo, const NodeTemplate &original, const TemplateArguments &args);Result< MutableRoot > BeginSubstitutionModification(const AssetRepositoryRef &repo, const NodeSystem &original); | ) |
MAXON_METHOD Bool IsFinalized | ( | ) | const |
Checks if this node system is in finalized state. A node system is in finalized state after MutableRoot::EndModification() has been called as long as no further modification is being made.
MAXON_METHOD Result<MutableRoot> CreateInstance | ( | const AssetRepositoryRef & | repo | ) | const |
Creates an instance of this node system. Initially the returned instance will behave exactly like this node system, but you can apply changes to the instance. No data needs to be copied to the instance, so creating an instance is a lightweight process.
Whenever the node system needs to do an asset lookup during the following modifications, the given repository is used.
[in] | repo | The repository to use for asset lookup during the following modifications. |
MAXON_METHOD Result<NodeSystem> CreateCopyOfSelection | ( | const AssetRepositoryRef & | repo, |
const NodePath & | basePath, | ||
const Block< const InternedId > & | selection | ||
) | const |
Returns a new node system which is a copy of the subgraph induced by all nodes given by basePath and selection. All nodes with a node path consisting of the basePath plus one of the identifiers of selection are copied, including their attributes and connections. Connections which don't end in one of the selected nodes are ignored.
[in] | repo | The repository to use for asset lookup during the copy operation. |
[in] | basePath | The base path, this has to point to a true node. selection selects direct children of the node given by basePath. |
[in] | selection | A selection of nodes, namely children of the node given by basePath. Identifiers for which no child exists are ignored. |
MAXON_METHOD TimeStamp GetModificationStamp | ( | ) | const |
Returns the time stamp of this node system, it can be used to test for modifications. Each call to BeginModification() increments the stamp. The time stamp is also needed for GetModificationsSince and GNodeFunctions::GetAttributeModificationsSince to get all modifications which have happened since then.
MAXON_METHOD Result<Bool> GetModificationsSince | ( | TimeStamp | stamp, |
const ValueReceiver< const GNode &, GraphModelRef::MODIFIED > & | receiver | ||
) | const |
Reports all modifications which have been made since the given stamp to the receiver. A typical usage is
The node system on which GetModificationStamp() is called needn't be the same as the one on which GetModificationsSince() is called, it suffices that the latter has been created by a number of CopyFrom operations from the first (which includes the implicit copy operation due to copy-on-write).
[in] | stamp | A reference time stamp. Only modifications newer than this stamp are reported. |
[in] | receiver | Modifications are reported to this receiver. |
MAXON_METHOD GraphModelRef::MODIFIED GetModificationsSince | ( | TimeStamp | stamp | ) | const |
Returns flags which tell which kinds of changes have happened since the given time stamp. From the returned value you can't tell exactly which nodes or ports are affected, but you can tell for example if only attributes have changed or also the structure.
[in] | stamp | A reference time stamp. Only modifications newer than this stamp are reported. |
MAXON_METHOD Int GetTopologicalLayer | ( | const NodePath & | port | ) | const |
Returns an Int value which corresponds to a topological layer index for the given port. The connections within a node system build a directed acyclic graph, and the node system sets up a corresponding topological layering of all ports within MutableRoot::ValidateTopology(). Ports within the same layer aren't reachable from each other. Whenever port x can be reached from port y via a number of connections, the layer of x is greater than the layer of y. However the reverse is not true, so different layer indices don't imply reachability. You can use the fact that two ports are in the same layer for parallelization: In that case computations on these ports are usually independent.
For the topological layering only top-level ports are considered, connections of nested ports are treated as if they were at their enclosing top-level ports. Therefore the layer of a nested port is the same as the layer of its enclosing port.
[in] | port | A path to a port of this node system. This may be a port of the root node, but also of any other arbitrarily nested node. |
MAXON_METHOD Int GetTopologicalLayer | ( | const PathBlock & | port | ) | const |
Returns an Int value which corresponds to a topological layer index for the given port. The connections within a node system build a directed acyclic graph, and the node system sets up a corresponding topological layering of all ports within MutableRoot::ValidateTopology(). Ports within the same layer aren't reachable from each other. Whenever port x can be reached from port y via a number of connections, the layer of x is greater than the layer of y. However the reverse is not true, so different layer indices don't imply reachability. You can use the fact that two ports are in the same layer for parallelization: In that case computations on these ports are usually independent.
For the topological layering only top-level ports are considered, connections of nested ports are treated as if they were at their enclosing top-level ports. Therefore the layer of a nested port is the same as the layer of its enclosing port.
[in] | port | A path to a port of this node system. This may be a port of the root node, but also of any other arbitrarily nested node. |
MAXON_METHOD Result<Bool> GetTopLevelPorts | ( | Bool | reverseOrder, |
const ValueReceiver< const Port & > & | receiver | ||
) | const |
Yields all top-level ports of this node system to receiver in topological order. This comprises really all top-level ports, so not only ports of the root node, but also of its children and any other arbitrarily nested node.
[in] | reverseOrder | True if the ports shall be reported in reverse topological order, false otherwise. |
[in] | receiver | A callback which receives the top-level ports. |
MAXON_METHOD Result<Bool> SetValue | ( | const GNodeHandle & | node, |
const InternedId & | attr, | ||
ForwardingDataPtr && | value, | ||
ChangeList * | list, | ||
Bool | checkAndInvalidate = true |
||
) |
Sets the value of #attr to value for node. This will override any value which would otherwise be inherited for the attribute from a base.
[in] | node | The handle for the g-node. |
[in] | attr | The attribute whose value shall be set. |
[in] | value | The new value for the attribute. |
[in] | list | An optional ChangeList to track the changes. |
[in] | checkAndInvalidate | True by default. Use false to suppress check, invalidation and update of time stamp. False may only be used for attributes which aren't needed during validation. |
MAXON_METHOD Result<NodeSystemData> GetNodeSystemData | ( | ) | const |
Extracts the NodeSystemData for serialization. A NodeSystem itself can't be serialized.
enum maxon::nodes::NodeSystemInterface::GML_OPTIONS MAXON_ENUM_FLAGS_CLASS | ( | GML_OPTIONS | ) |
MAXON_METHOD Result<void> WriteGml | ( | UrlOrOutputStream && | output, |
GML_OPTIONS | opts | ||
) | const |
Writes this node system to a GML file (Graph Modeling Language).
[in] | output | The output stream to write to. |
[in] | opts | Options for the output. |
MAXON_METHOD Int PrivateGetChildEntryCount | ( | const GNodeHandle & | node | ) | const |
@MAXON_ANNOTATION{refclass=false}
MAXON_METHOD GNodeHandle PrivateGetRoot | ( | ) | const |
enum maxon::nodes::NodeSystemInterface::FINALIZE_FLAGS MAXON_ENUM_FLAGS_CLASS | ( | FINALIZE_FLAGS | ) |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
private |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |