MutableGNode Class Reference

#include <nodesystem.h>

Inheritance diagram for MutableGNode:

Detailed Description

MutableGNode is the base class of mutable node references. The class hierarchy is

See also usernodes_nodes for a class diagram and more details. The function NodeSystem::BeginModification() returns a reference to the root node of a node system with write access, from this all other nodes and ports can be found and modified.

Public Member Functions

void Reset ()
 
MutableGNodeoperator= (std::nullptr_t)
 
 MutableGNode ()=default
 
Result< void > InitFromPath (NodeSystemInterface *system, const NodePath &path, NODE_KIND check=NODE_KIND::ALL_MASK)
 
Result< void > InitFromPath (NodeSystemInterface *system, const PathBlock &path, NODE_KIND check=NODE_KIND::ALL_MASK)
 
- Public Member Functions inherited from MutableGNodeFunctions< MutableGNodeBase >
Result< void > Remove (Opt< ChangeList & > list={}) const
 
Result< void > InheritChild (const InternedId &childId, Opt< ChangeList & > list={}) const
 
Result< BoolInheritValue (const InternedId &attr, Opt< ChangeList & > list={}) const
 
Result< BoolRemoveValue (const InternedId &attr, Opt< ChangeList & > list={}) const
 
Result< BoolSetValue (const InternedId &attr, ForwardingDataPtr &&value, Opt< ChangeList & > list={}) const
 
Result< BoolSetValue (const ATTR &attr, const typename ATTR::ValueType &value, Opt< ChangeList & > list={}) const
 
Result< BoolSetValue (const ATTR &attr, typename ATTR::ValueType &&value, Opt< ChangeList & > list={}) const
 
Result< BoolSetValue (const typename ATTR::ValueType &value, Opt< ChangeList & > list={}) const
 
Result< BoolSetValue (typename ATTR::ValueType &&value, Opt< ChangeList & > list={}) const
 
Result< void > ChangeValue (const InternedId &attr, const SubDataOperation &op, const SubDataPathBlock &path, ForwardingDataPtr &&value, Opt< ChangeList & > list={}) const
 
- Public Member Functions inherited from GNodeFunctions< BASE >
Bool IsPort () const
 
const PortSelector< BASE::MUTABLE > & ToPort () const
 
Result< void > GetValues (GraphAttribute::FLAGS mask, GraphAttributeMap &attribs, Bool includeInherited=true, Bool includeRemoved=false) const
 
Result< ConstDataPtrGetValue (const InternedId &attr, const DataType &expectedType) const
 
Result< ConstDataPtrGetValue (const InternedId &attr, const DataType &expectedType, Int &nesting, Bool negativeRootNesting=false) const
 
template<typename T >
Result< Opt< const T & > > GetValue (const InternedId &attr) const
 
template<typename ATTR >
Result< Opt< const typename ATTR::ValueType & > > GetValue (const ATTR &attr) const
 
template<typename ATTR >
Result< Opt< const typename ATTR::ValueType & > > GetValue () const
 
template<typename ATTR >
Result< Opt< const typename ATTR::ValueType & > > GetValue (const ATTR &attr, Int &nesting) const
 
Result< BoolGetBaseValues (const InternedId &attr, const DataType &expectedType, const ValueReceiver< const ConstDataPtr &, Int > &receiver) const
 
template<typename T >
Result< const T & > GetDefaultValue (const T &def=maxon::NullValue< const T & >()) const
 
template<typename T >
Result< const T & > GetConstantValue (const T &def=maxon::NullValue< const T & >()) const
 
Result< BoolGetAttributeModificationsSince (TimeStamp stamp, const ValueReceiver< InternedId, ConstDataPtr > &receiver) const
 
TimeStamp GetAttributeStamp (const InternedId &attr) const
 
Result< NodeSelector< BASE::MUTABLE > > GetNode () const
 
Result< GNodeSelector< BASE::MUTABLE > > GetParent () const
 
Result< GNodeSelector< BASE::MUTABLE > > FindChild (const InternedId &name, NODE_KIND mask) const
 
template<typename NODE >
Result< typename NODE::template Selector< BASE::MUTABLE > > FindInnerNode (const PathBlock &relativePath) const
 
Result< BoolGetInnerNodes (NODE_KIND mask, Bool includeThis, const ValueReceiver< const GNodeSelector< BASE::MUTABLE > & > &receiver) const
 
const NodeSystemGetBase () const
 
const Block< const NodeSystem > & GetBases () const
 
Result< BoolGetAllBases (const ValueReceiver< const NodeSystem & > &receiver) const
 
const NodeTemplate & GetTemplate () const
 
Result< BoolGetAllTemplates (const ValueReceiver< const NodeTemplate & > &receiver) const
 
const NodeSystemDerivationHandler & GetDerivationHandler () const
 

Private Member Functions

 MutableGNode (NodeSystemInterface *system, const GNodeHandle &node)
 
 MutableGNode (NodeSystemInterface *system, GNodeHandle &&node)
 

Additional Inherited Members

- Protected Types inherited from MutableGNodeFunctions< MutableGNodeBase >
using Super = GNodeFunctions< MutableGNodeBase >
 
- Protected Types inherited from GNodeFunctions< BASE >
using Super = BASE
 

Constructor & Destructor Documentation

◆ MutableGNode() [1/3]

MutableGNode ( )
default

Constructs a null node reference.

◆ MutableGNode() [2/3]

MutableGNode ( NodeSystemInterface system,
const GNodeHandle node 
)
private

◆ MutableGNode() [3/3]

MutableGNode ( NodeSystemInterface system,
GNodeHandle &&  node 
)
private

Member Function Documentation

◆ Reset()

void Reset ( void  )

Resets this @CLASS to the state it has right after default construction. This includes freeing all resources held by this @CLASS.

◆ operator=()

MutableGNode& operator= ( std::nullptr_t  )

Resets this reference to a null reference.

◆ InitFromPath() [1/2]

Result<void> InitFromPath ( NodeSystemInterface system,
const NodePath &  path,
NODE_KIND  check = NODE_KIND::ALL_MASK 
)

Initializes a g-node reference from a node system and a path. If there's no node in the node system for the given path, this reference is set to a null reference. If a node exists but its kind doesn't match the check mask, an IllegalArgumentError is returned.

Parameters
[in]systemThe node system to use.
[in]pathA path which points to a g-node in the given node system.
[in]checkA mask of the expected node kind(s).
Returns
Usually OK (even when path doesn't exist), but an IllegalArgumentError if path exists but doesn't match check.

◆ InitFromPath() [2/2]

Result<void> InitFromPath ( NodeSystemInterface system,
const PathBlock path,
NODE_KIND  check = NODE_KIND::ALL_MASK 
)

Initializes a g-node reference from a node system and a path. If there's no node in the node system for the given path, this reference is set to a null reference. If a node exists but its kind doesn't match the check mask, an IllegalArgumentError is returned.

Parameters
[in]systemThe node system to use.
[in]pathA path which points to a g-node in the given node system.
[in]checkA mask of the expected node kind(s).
Returns
Usually OK (even when path doesn't exist), but an IllegalArgumentError if path exists but doesn't match check.