Open Search
    GNode Class Reference

    #include <nodesystem.h>

    Inheritance diagram for GNode:

    Detailed Description

    GNode is the base class of immutable node references. The class hierarchy is

    See also usernodes_nodes for a class diagram and more details. The method NodeSystem::GetRoot() returns a reference to the root node of a node system, from this all other nodes and ports can be found. However it is not possible to get mutable node references starting with an immutable reference, for mutable references see MutableRoot.

    Public Member Functions

    void Reset ()
     
    GNodeoperator= (std::nullptr_t)
     
    const NodeSystemGetNodeSystem () const
     
     GNode ()=default
     
     ~GNode ()
     
     GNode (const GNode &other)
     
     MAXON_OPERATOR_COPY_ASSIGNMENT (GNode)
     
     GNode (GNode &&other)
     
     MAXON_OPERATOR_MOVE_ASSIGNMENT (GNode)
     
    Result< void > InitFromPath (const NodeSystem &system, const NodePath &path, NODE_KIND check=NODE_KIND::ALL_MASK)
     
    Result< void > InitFromPath (const NodeSystem &system, const PathBlock &path, NODE_KIND check=NODE_KIND::ALL_MASK)
     
    - Public Member Functions inherited from GNodeFunctions< GNodeBase >
    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
     
    Result< Opt< const T & > > GetValue (const InternedId &attr) const
     
    Result< Opt< const typename ATTR::ValueType & > > GetValue (const ATTR &attr) const
     
    Result< Opt< const typename ATTR::ValueType & > > GetValue () const
     
    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
     
    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
     
    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
     
    - Public Member Functions inherited from GNodeBase
     operator Bool () const
     
    Bool IsEmpty () const
     
    Bool IsPopulated () const
     
    Bool IsValid () const
     
    const NodeSystemInterface::ConstPtr & GetNodeSystem () const
     
    const NodePath & GetPath () const
     
     operator const NodePath & () const
     
    const InternedIdGetId () const
     
    NODE_KIND GetKind () const
     
    GNODE_FLAGS GetFlags () const
     
    Bool operator== (const GNodeBase &other) const
     
    Bool operator!= (const GNodeBase &other) const
     
    HashInt GetHashCode () const
     
    UniqueHash GetUniqueHashCode () const
     
    String ToString (const FormatStatement *fs=nullptr) const
     

    Protected Member Functions

    void SetNodeSystem (const NodeSystem &sys)
     
    - Protected Member Functions inherited from GNodeBase
     GNodeBase ()=default
     
     GNodeBase (NodeSystemInterface *system, const GNodeHandle &node)
     
     GNodeBase (NodeSystemInterface *system, GNodeHandle &&node)
     
    void SetNodeSystem (NodeSystemInterface *sys)
     

    Private Types

    using NodeSystemCtorParam = const NodeSystem &
     

    Private Member Functions

     GNode (const NodeSystem &system, const GNodeHandle &handle)
     
     GNode (const NodeSystem &system, GNodeHandle &&handle)
     

    Friends

    class NodesLibImpl
     
    class GNodeBase
     
    class NodeSystemManagerImpl
     

    Additional Inherited Members

    - Protected Types inherited from GNodeFunctions< GNodeBase >
    using Super = GNodeBase
     
    - Static Protected Member Functions inherited from GNodeBase
    template<typename GNODE , typename PATH >
    static Result< void > PrivateInitFromPath (GNODE &node, typename GNODE::NodeSystemCtorParam system, PATH &&path, NODE_KIND check)
     
    - Protected Attributes inherited from GNodeBase
    NodeSystemInterface_system
     
    GNodeHandle _node
     

    Member Typedef Documentation

    ◆ NodeSystemCtorParam

    using NodeSystemCtorParam = const NodeSystem&
    private

    Constructor & Destructor Documentation

    ◆ GNode() [1/5]

    GNode ( )
    default

    Constructs a null node reference.

    ◆ GNode() [2/5]

    GNode ( const NodeSystem system,
    const GNodeHandle handle 
    )
    private

    Constructs a g-node reference from a node system and a node handle.

    Parameters
    [in]systemThe node system to use.
    [in]handleA handle for a node within the given node system.

    ◆ GNode() [3/5]

    GNode ( const NodeSystem system,
    GNodeHandle &&  handle 
    )
    private

    Constructs a g-node reference from a node system and a node handle.

    Parameters
    [in]systemThe node system to use.
    [in]handleA handle for a node within the given node system.

    ◆ ~GNode()

    ~GNode ( )

    ◆ GNode() [4/5]

    GNode ( const GNode other)

    ◆ GNode() [5/5]

    GNode ( GNode &&  other)

    Member Function Documentation

    ◆ Reset()

    void Reset ( )

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

    ◆ operator=()

    GNode& operator= ( std::nullptr_t  )

    Resets this reference to a null reference.

    ◆ GetNodeSystem()

    const NodeSystem& GetNodeSystem ( ) const

    Returns the node system of this node reference. For a null node a null reference is returned.

    Returns
    The node system of this g-node, or a null reference.

    ◆ MAXON_OPERATOR_COPY_ASSIGNMENT()

    MAXON_OPERATOR_COPY_ASSIGNMENT ( GNode  )

    ◆ MAXON_OPERATOR_MOVE_ASSIGNMENT()

    MAXON_OPERATOR_MOVE_ASSIGNMENT ( GNode  )

    ◆ InitFromPath() [1/2]

    Result<void> InitFromPath ( const NodeSystem 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 ( const NodeSystem 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.

    ◆ SetNodeSystem()

    void SetNodeSystem ( const NodeSystem sys)
    protected

    Friends And Related Function Documentation

    ◆ NodesLibImpl

    friend class NodesLibImpl
    friend

    ◆ GNodeBase

    friend class GNodeBase
    friend

    ◆ NodeSystemManagerImpl

    friend class NodeSystemManagerImpl
    friend