HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UN_GraphBase< GRAPH_DATA, NODE, WIRE, STICKY_NOTE > Class Template Reference

#include <UN_Graph.h>

Public Types

using TopNodeIterator = typename NODE::ChildNodeIterator
 Iterarates over the top-level nodes of the graph. More...
 
using TopNodeRange = UT_IteratorRange< TopNodeIterator >
 
using AllNodeIterator = typename NODE::DescendantNodeIterator
 
using AllNodeRange = UT_IteratorRange< AllNodeIterator >
 
using TopWireIterator = typename NODE::ChildWireIterator
 An iterator and a range for the top-level wires inside this graph. More...
 
using TopWireRange = UT_IteratorRange< TopWireIterator >
 
using AllWireIterator = typename NODE::DescendantWireIterator
 An iterator and a range for all the connection wires in this graph. More...
 
using AllWireRange = UT_IteratorRange< AllWireIterator >
 

Public Member Functions

NODE rootNode () const
 
bool isValidNodeName (const UT_StringRef &name) const
 
UT_StringHolder findValidUniqueNodeName (const UT_StringRef &name=UT_StringRef()) const
 
UT_Array< UT_StringHoldernodeNames () const
 Returns the names of the graph's top-level nodes. More...
 
NODE findNode (const UT_StringRef &node_path) const
 
STICKY_NOTE findStickyNote (const UT_StringRef &sticky_note_path) const
 
TopNodeRange topNodeRange () const
 Returns a range for iterating over graph's top-level nodes. More...
 
UT_Array< NODE > topNodes () const
 Returns the top level nodes directly inside this graph. More...
 
AllNodeRange allNodeRange () const
 
TopWireRange topWireRange () const
 Returns a range for iterating over graph's top-level connection wires. More...
 
UT_Array< WIRE > topWires () const
 Returns the wires connecting top level nodes directly inside this graph. More...
 
AllWireRange allWireRange () const
 
UN_OptionsPtr asOptions () const
 
GRAPH_DATA * graphData () const
 Returns the owner container of the underlying graph data structures. More...
 
const UN_GraphDataconstGraphData () const
 Returns the owner container of the underlying graph data structures. More...
 
bool isValid () const
 Returns true if this is a valid graph; false otherwise. More...
 
 operator bool () const
 Returns true if this is a valid graph; false otherwise. More...
 

Protected Member Functions

 UN_GraphBase ()=default
 Constructs a handle for an invalid wire. More...
 
 UN_GraphBase (GRAPH_DATA *graph_data)
 Constructs a handle that references the given wire in the given graph. More...
 
bool operator== (const UN_GraphBase &other) const
 Comparison operators. More...
 
bool operator!= (const UN_GraphBase &other) const
 Comparison operators. More...
 

Detailed Description

template<typename GRAPH_DATA, typename NODE, typename WIRE, typename STICKY_NOTE>
class UN_GraphBase< GRAPH_DATA, NODE, WIRE, STICKY_NOTE >

Base class template for the UN graph handle. Its main purpose is to factor common code for const and non-const handles.

Definition at line 30 of file UN_Graph.h.

Member Typedef Documentation

template<typename GRAPH_DATA, typename NODE, typename WIRE, typename STICKY_NOTE>
using UN_GraphBase< GRAPH_DATA, NODE, WIRE, STICKY_NOTE >::AllNodeIterator = typename NODE::DescendantNodeIterator

Iterarates over all the nodes in the graph, both the top-level nodes and their descendants too.

Definition at line 125 of file UN_Graph.h.

template<typename GRAPH_DATA, typename NODE, typename WIRE, typename STICKY_NOTE>
using UN_GraphBase< GRAPH_DATA, NODE, WIRE, STICKY_NOTE >::AllNodeRange = UT_IteratorRange< AllNodeIterator >

Definition at line 126 of file UN_Graph.h.

template<typename GRAPH_DATA, typename NODE, typename WIRE, typename STICKY_NOTE>
using UN_GraphBase< GRAPH_DATA, NODE, WIRE, STICKY_NOTE >::AllWireIterator = typename NODE::DescendantWireIterator

An iterator and a range for all the connection wires in this graph.

Definition at line 155 of file UN_Graph.h.

template<typename GRAPH_DATA, typename NODE, typename WIRE, typename STICKY_NOTE>
using UN_GraphBase< GRAPH_DATA, NODE, WIRE, STICKY_NOTE >::AllWireRange = UT_IteratorRange< AllWireIterator >

Definition at line 156 of file UN_Graph.h.

template<typename GRAPH_DATA, typename NODE, typename WIRE, typename STICKY_NOTE>
using UN_GraphBase< GRAPH_DATA, NODE, WIRE, STICKY_NOTE >::TopNodeIterator = typename NODE::ChildNodeIterator

Iterarates over the top-level nodes of the graph.

Definition at line 107 of file UN_Graph.h.

template<typename GRAPH_DATA, typename NODE, typename WIRE, typename STICKY_NOTE>
using UN_GraphBase< GRAPH_DATA, NODE, WIRE, STICKY_NOTE >::TopNodeRange = UT_IteratorRange< TopNodeIterator >

Definition at line 108 of file UN_Graph.h.

template<typename GRAPH_DATA, typename NODE, typename WIRE, typename STICKY_NOTE>
using UN_GraphBase< GRAPH_DATA, NODE, WIRE, STICKY_NOTE >::TopWireIterator = typename NODE::ChildWireIterator

An iterator and a range for the top-level wires inside this graph.

Definition at line 137 of file UN_Graph.h.

template<typename GRAPH_DATA, typename NODE, typename WIRE, typename STICKY_NOTE>
using UN_GraphBase< GRAPH_DATA, NODE, WIRE, STICKY_NOTE >::TopWireRange = UT_IteratorRange< TopWireIterator >

Definition at line 138 of file UN_Graph.h.

Constructor & Destructor Documentation

template<typename GRAPH_DATA, typename NODE, typename WIRE, typename STICKY_NOTE>
UN_GraphBase< GRAPH_DATA, NODE, WIRE, STICKY_NOTE >::UN_GraphBase ( )
protecteddefault

Constructs a handle for an invalid wire.

template<typename GRAPH_DATA, typename NODE, typename WIRE, typename STICKY_NOTE>
UN_GraphBase< GRAPH_DATA, NODE, WIRE, STICKY_NOTE >::UN_GraphBase ( GRAPH_DATA *  graph_data)
inlineprotected

Constructs a handle that references the given wire in the given graph.

Definition at line 37 of file UN_Graph.h.

Member Function Documentation

template<typename GRAPH_DATA, typename NODE, typename WIRE, typename STICKY_NOTE>
AllNodeRange UN_GraphBase< GRAPH_DATA, NODE, WIRE, STICKY_NOTE >::allNodeRange ( ) const
inline

Returns a range for iterating over all of the graph's nodes, both top-level as well as deeply nested ones.

Definition at line 130 of file UN_Graph.h.

template<typename GRAPH_DATA, typename NODE, typename WIRE, typename STICKY_NOTE>
AllWireRange UN_GraphBase< GRAPH_DATA, NODE, WIRE, STICKY_NOTE >::allWireRange ( ) const
inline

Returns a range for iterating over all the graph's connection wires, both top-level as well as deeply nested ones.

Definition at line 160 of file UN_Graph.h.

template<typename GRAPH_DATA, typename NODE, typename WIRE, typename STICKY_NOTE>
UN_OptionsPtr UN_GraphBase< GRAPH_DATA, NODE, WIRE, STICKY_NOTE >::asOptions ( ) const
inline

Returns the options object representing this graph. This can be then used for serialization to JSON, etc.

Definition at line 168 of file UN_Graph.h.

template<typename GRAPH_DATA, typename NODE, typename WIRE, typename STICKY_NOTE>
const UN_GraphData* UN_GraphBase< GRAPH_DATA, NODE, WIRE, STICKY_NOTE >::constGraphData ( ) const
inline

Returns the owner container of the underlying graph data structures.

Definition at line 45 of file UN_Graph.h.

template<typename GRAPH_DATA, typename NODE, typename WIRE, typename STICKY_NOTE>
NODE UN_GraphBase< GRAPH_DATA, NODE, WIRE, STICKY_NOTE >::findNode ( const UT_StringRef node_path) const
inline

Returns a node at the given path, or an invalid handle if not found. If the path is just a name, it looks for the top-level node, otherwise if the path contains slashes '/', it looks for nested nodes inside subnets.

Definition at line 89 of file UN_Graph.h.

template<typename GRAPH_DATA, typename NODE, typename WIRE, typename STICKY_NOTE>
STICKY_NOTE UN_GraphBase< GRAPH_DATA, NODE, WIRE, STICKY_NOTE >::findStickyNote ( const UT_StringRef sticky_note_path) const
inline

Returns a sticky note at the given path, or an invalid handle if not found. If the path is just a name, it looks for the top-level sticky note, otherwise if the path contains slashes '/', it looks for sticky notes nested inside subnets.

Definition at line 100 of file UN_Graph.h.

template<typename GRAPH_DATA, typename NODE, typename WIRE, typename STICKY_NOTE>
UT_StringHolder UN_GraphBase< GRAPH_DATA, NODE, WIRE, STICKY_NOTE >::findValidUniqueNodeName ( const UT_StringRef name = UT_StringRef()) const
inline

Based on the given name, returns a valid name that is not used by any of the top level nodes.

Definition at line 72 of file UN_Graph.h.

template<typename GRAPH_DATA, typename NODE, typename WIRE, typename STICKY_NOTE>
GRAPH_DATA* UN_GraphBase< GRAPH_DATA, NODE, WIRE, STICKY_NOTE >::graphData ( ) const
inline

Returns the owner container of the underlying graph data structures.

Definition at line 43 of file UN_Graph.h.

template<typename GRAPH_DATA, typename NODE, typename WIRE, typename STICKY_NOTE>
bool UN_GraphBase< GRAPH_DATA, NODE, WIRE, STICKY_NOTE >::isValid ( ) const
inline

Returns true if this is a valid graph; false otherwise.

Definition at line 50 of file UN_Graph.h.

template<typename GRAPH_DATA, typename NODE, typename WIRE, typename STICKY_NOTE>
bool UN_GraphBase< GRAPH_DATA, NODE, WIRE, STICKY_NOTE >::isValidNodeName ( const UT_StringRef name) const
inline

Returns true if the graph accepts the given name as a legal node name. Note, even though the name is legal, it still may not be unique.

Definition at line 65 of file UN_Graph.h.

template<typename GRAPH_DATA, typename NODE, typename WIRE, typename STICKY_NOTE>
UT_Array<UT_StringHolder> UN_GraphBase< GRAPH_DATA, NODE, WIRE, STICKY_NOTE >::nodeNames ( ) const
inline

Returns the names of the graph's top-level nodes.

Definition at line 79 of file UN_Graph.h.

template<typename GRAPH_DATA, typename NODE, typename WIRE, typename STICKY_NOTE>
UN_GraphBase< GRAPH_DATA, NODE, WIRE, STICKY_NOTE >::operator bool ( ) const
inlineexplicit

Returns true if this is a valid graph; false otherwise.

Definition at line 52 of file UN_Graph.h.

template<typename GRAPH_DATA, typename NODE, typename WIRE, typename STICKY_NOTE>
bool UN_GraphBase< GRAPH_DATA, NODE, WIRE, STICKY_NOTE >::operator!= ( const UN_GraphBase< GRAPH_DATA, NODE, WIRE, STICKY_NOTE > &  other) const
inlineprotected

Comparison operators.

Definition at line 177 of file UN_Graph.h.

template<typename GRAPH_DATA, typename NODE, typename WIRE, typename STICKY_NOTE>
bool UN_GraphBase< GRAPH_DATA, NODE, WIRE, STICKY_NOTE >::operator== ( const UN_GraphBase< GRAPH_DATA, NODE, WIRE, STICKY_NOTE > &  other) const
inlineprotected

Comparison operators.

Definition at line 175 of file UN_Graph.h.

template<typename GRAPH_DATA, typename NODE, typename WIRE, typename STICKY_NOTE>
NODE UN_GraphBase< GRAPH_DATA, NODE, WIRE, STICKY_NOTE >::rootNode ( ) const
inline

Returns the root node of the graph's node parental hierarchy. The root is a special node that is a parent to graph's top-level nodes.

Definition at line 58 of file UN_Graph.h.

template<typename GRAPH_DATA, typename NODE, typename WIRE, typename STICKY_NOTE>
TopNodeRange UN_GraphBase< GRAPH_DATA, NODE, WIRE, STICKY_NOTE >::topNodeRange ( ) const
inline

Returns a range for iterating over graph's top-level nodes.

Definition at line 111 of file UN_Graph.h.

template<typename GRAPH_DATA, typename NODE, typename WIRE, typename STICKY_NOTE>
UT_Array<NODE> UN_GraphBase< GRAPH_DATA, NODE, WIRE, STICKY_NOTE >::topNodes ( ) const
inline

Returns the top level nodes directly inside this graph.

Definition at line 117 of file UN_Graph.h.

template<typename GRAPH_DATA, typename NODE, typename WIRE, typename STICKY_NOTE>
TopWireRange UN_GraphBase< GRAPH_DATA, NODE, WIRE, STICKY_NOTE >::topWireRange ( ) const
inline

Returns a range for iterating over graph's top-level connection wires.

Definition at line 141 of file UN_Graph.h.

template<typename GRAPH_DATA, typename NODE, typename WIRE, typename STICKY_NOTE>
UT_Array<WIRE> UN_GraphBase< GRAPH_DATA, NODE, WIRE, STICKY_NOTE >::topWires ( ) const
inline

Returns the wires connecting top level nodes directly inside this graph.

Definition at line 147 of file UN_Graph.h.


The documentation for this class was generated from the following file: