#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(). 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 | GML_OPTIONS { NONE, DIRECT_ATTRIBUTES, BASE_ATTRIBUTES, DERIVED_ATTRIBUTES, BASES, ALL_BASES, NO_CONNECTIONS, INDUCED_CONNECTIONS, ATTRIBUTES } |
enum | 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_SYNTHESIZE_VALUE |
static constexpr WIRE_MODE | DEPENDENCY_COMPONENT |
Private Member Functions | |
MAXON_INTERFACE (NodeSystemInterface, MAXON_REFERENCE_COPY_ON_WRITE, "net.maxon.node.interface.nodesystem") | |
MAXON_METHOD Result< void > | SetDerivationHandler (const NodeSystemDerivationHandler &handler) |
MAXON_METHOD Result< void > | SetTemplate (const AssetRepositoryRef &lookup, const NodeTemplate &templ, const TemplateArguments &args, Bool setValues) |
MAXON_METHOD Result< Bool > | GetInnerNodes (const GNodeHandle &node, NODE_KIND mask, Bool includeNode, const ValueReceiver< const MutableGNode & > &receiver) |
MAXON_METHOD Result< GNodeHandle > | GetParent (const GNodeHandle &node) const |
MAXON_METHOD Result< GNodeHandle > | GetAncestor (const GNodeHandle &node, NODE_KIND kind) const |
MAXON_METHOD Result< GNodeHandle > | GetPortList (const GNodeHandle &node, PORT_DIR dir) const |
MAXON_METHOD Result< GNodeHandle > | FindChild (const GNodeHandle &node, const InternedId &name, NODE_KIND kind) const |
MAXON_METHOD Result< GNodeHandle > | FindInnerNode (const GNodeHandle &node, const PathBlock &innerPath) const |
const MAXON_METHOD NodeSystem & | GetBase (const GNodeHandle &node) const |
const MAXON_METHOD Block< const NodeSystem > & | GetBases (const GNodeHandle &node) const |
MAXON_METHOD Result< Bool > | GetAllBases (const GNodeHandle &node, const ValueReceiver< const NodeSystem & > &receiver) const |
MAXON_METHOD Result< void > | AddBase (const NodeSystem &other) |
const MAXON_METHOD NodeTemplate & | GetTemplate (const GNodeHandle &node) const |
MAXON_METHOD Result< Bool > | GetAllTemplates (const GNodeHandle &node, const ValueReceiver< const NodeTemplate & > &receiver) const |
const MAXON_METHOD NodeSystemDerivationHandler & | GetDerivationHandler (const GNodeHandle &node) const |
MAXON_METHOD Result< GNodeHandle > | FindHandle (const PathBlock &path) const |
MAXON_METHOD GNodeHandle | FindHandle (const NodePath &path) const |
MAXON_METHOD Bool | PrivateValidate (const GNodeHandle &handle) const |
MAXON_METHOD GNODE_FLAGS | GetFlags (const GNodeHandle &port) const |
MAXON_METHOD Result< void > | InitIterator (const GNodeHandle &node, GNodeIteratorBase &iterator) const |
MAXON_METHOD Result< void > | MoveToNext (GNodeIteratorBase &iterator) const |
MAXON_METHOD Result< void > | Validate (ChangeList *change) |
MAXON_METHOD Result< void > | ValidateTopology () |
MAXON_METHOD Result< void > | ValidatePorts (ChangeList *change) |
MAXON_METHOD Result< void > | BeginModificationImpl () |
MAXON_METHOD Result< void > | EndModificationImpl (ChangeList *change, FINALIZE_FLAGS finalize) |
MAXON_METHOD Result< void > | Compact () |
MAXON_METHOD Result< ChangeList > | Apply (const ChangeList &toApply, Bool inverse, ChangeList *list) |
MAXON_METHOD Result< void > | Update (const Block< const Tuple< AssetReference, AssetBase >> &updates, const AssetRepositoryRef &lookup, ChangeList *list) |
MAXON_METHOD Result< GNodeHandle > | AddChild (const Id &child, const NodeSystem &base, ChangeList *list) |
MAXON_METHOD Result< ChangeList > | ReplaceBase (const NodeSystem &base, ChangeList *list) |
MAXON_METHOD Result< ChangeList > | ReplaceChildren (const Block< const Tuple< InternedId, NodeSystem >> &newChildren, ChangeList *list) |
MAXON_METHOD Result< GNodeHandle > | MoveToGroup (MutableRoot &groupRoot, const Id &groupId, const Block< const InternedId > &selection, ChangeList *list) |
MAXON_METHOD Result< NodeSystem > | MoveToNodeSystem (const GNodeHandle &node, ChangeList *list) |
MAXON_METHOD Result< HashMap< InternedId, InternedId > > | Ungroup (const GNodeHandle &node, ChangeList *list) |
MAXON_METHOD Result< HomogenousTupleType< 3, HashMap< InternedId, InternedId > > > | Merge (const NodeSystem &other, ChangeList *list) |
MAXON_METHOD Result< GNodeHandle > | AddChild (const GNodeHandle &node, const Id &port, GNODE_FLAGS flags, ChangeList *list) |
MAXON_METHOD Result< void > | InheritChild (const GNodeHandle &parent, const InternedId &childId, ChangeList *list) |
MAXON_METHOD Result< void > | Remove (const GNodeHandle &child, ChangeList *list) |
MAXON_METHOD Result< void > | Connect (const GNodeHandle &source, const GNodeHandle &target, Wires modes, ChangeList *list) |
MAXON_METHOD Result< Bool > | GetConnections (const GNodeHandle &source, PORT_DIR dir, const ValueReceiver< const MutableConnection & > &conns, Wires mask, GET_CONNECTIONS_MODE mode) |
MAXON_METHOD Result< Wires > | GetWires (const GNodeHandle &source, const GNodeHandle &target) const |
MAXON_METHOD Result< Bool > | GetConnectionValues (const GNodeHandle &source, const GNodeHandle &target, const ValueReceiver< CONNECTION_POSITION, InternedId, const ConstDataPtr & > &receiver) const |
MAXON_METHOD Result< ConstDataPtr > | GetConnectionValue (const GNodeHandle &source, const GNodeHandle &target, CONNECTION_POSITION position, const InternedId &attr, const DataType &expectedType) const |
MAXON_METHOD Result< Bool > | SetConnectionValue (const GNodeHandle &source, const GNodeHandle &target, CONNECTION_POSITION position, const InternedId &attr, ForwardingDataPtr &&value, ChangeList *list) |
MAXON_METHOD Result< void > | GetValues (const GNodeHandle &port, GraphAttribute::FLAGS mask, GraphAttributeMap &attribs, Bool includeInherited, Bool includeRemoved) const |
MAXON_METHOD Result< ConstDataPtr > | GetValue (const GNodeHandle &port, const InternedId &attr, const DataType &expectedType) const |
MAXON_METHOD Result< ConstDataPtr > | GetValue (const GNodeHandle &port, const InternedId &attr, const DataType &expectedType, Int *nesting, Bool negativeRootNesting) const |
MAXON_METHOD Result< Bool > | GetBaseValues (const GNodeHandle &port, const InternedId &attr, const DataType &expectedType, const ValueReceiver< const ConstDataPtr &, Int > &values) const |
MAXON_METHOD Result< void > | TouchValue (const GNodeHandle &port, const InternedId &attr, ChangeList *list) |
MAXON_METHOD Result< void > | ChangeValue (const GNodeHandle &port, const InternedId &attr, const SubDataOperation &op, const SubDataPathBlock &path, ForwardingDataPtr &&subvalue, ChangeList *change) |
MAXON_METHOD Result< Bool > | InheritValue (const GNodeHandle &port, const InternedId &attr, ChangeList *list) |
MAXON_METHOD Result< Bool > | RemoveValue (const GNodeHandle &port, const InternedId &attr, ChangeList *list) |
MAXON_METHOD Result< Bool > | GetAttributeModificationsSince (const GNodeHandle &node, TimeStamp stamp, const ValueReceiver< InternedId, ConstDataPtr > &receiver) const |
MAXON_METHOD TimeStamp | GetAttributeStamp (const GNodeHandle &node, const InternedId &attr) const |
MAXON_METHOD TimeStamp | GetConnectionStamp (const GNodeHandle &node, PORT_DIR direction) const |
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 |
const MAXON_METHOD 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.
const MAXON_METHOD 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().
const MAXON_METHOD 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.
const MAXON_METHOD 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 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. |
const MAXON_METHOD 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.
const MAXON_METHOD 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 AssetRepositoryRef GetTemplateLookupRepository | ( | ) | const |
Returns the asset repository which was used when this node system was instantiated from its template. If this node system is no instantiation of a node template, the method returns 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(Bool keepCurrent);Result< MutableRoot > BeginInstantiationModification(const NodeTemplate &templ);Result< MutableRoot > BeginSubstitutionModification(const AssetRepositoryRef &lookup, const NodeTemplate &original, const TemplateArguments &args);Result< MutableRoot > BeginSubstitutionModification(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 |
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.
MAXON_METHOD Result<NodeSystem> CreateCopyOfSelection | ( | 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] | 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 GetTopologicalOrder | ( | const NodePath & | port | ) | const |
Returns an Int value which corresponds to the index of the given port in the topological ordering of the node system. The connections within a node system build a directed acyclic graph, and the node system sets up a corresponding topological ordering of all ports within MutableRoot::ValidateTopology(). For this step only top-level ports are considered, connections between nested ports are treated as if they were between their enclosing top-level ports. Therefore the index of a nested port is the same as the index 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 | Usually true. Use false if no check, invalidation and update of time stamp shall be done, this may only be used for attributes which aren't needed during validation. @MAXON_ANNOTATION{refclass=false} |
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 |
MAXON_METHOD Bool HasBase | ( | const IdAndVersion & | baseId | ) | const |
MAXON_METHOD Int GetTopologicalOrder | ( | const PathBlock & | port | ) | const |
|
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 |
|
staticconstexpr |