HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UN_PortBase< BASE_CLASS, GRAPH_DATA, PORT, WIRE > Class Template Reference

#include <UN_Port.h>

+ Inheritance diagram for UN_PortBase< BASE_CLASS, GRAPH_DATA, PORT, WIRE >:

Public Types

using SrcWireIterator = UN_HandleIterator< WIRE, GRAPH_DATA, UN_PortUtils::WireIterator >
 
using SrcWireRange = UT_IteratorRange< SrcWireIterator >
 
using DstWireIterator = UN_HandleIterator< WIRE, GRAPH_DATA, UN_PortUtils::WireIterator >
 
using DstWireRange = UT_IteratorRange< DstWireIterator >
 
using SrcPortIterator = UN_HandleIterator< PORT, GRAPH_DATA, UN_PortUtils::PortIterator< true >>
 And iterator and a range for iterating over connected source ports. More...
 
using SrcPortRange = UT_IteratorRange< SrcPortIterator >
 
using DstPortIterator = UN_HandleIterator< PORT, GRAPH_DATA, UN_PortUtils::PortIterator< false >>
 And iterator and a range for iterating over connected destination ports. More...
 
using DstPortRange = UT_IteratorRange< DstPortIterator >
 

Public Member Functions

UN_PortID portID () const
 Returns the unique ID of the port this handle refers to. More...
 
UN_PortKind kind () const
 Returns the kind of a port. Ie, an input or an output. More...
 
bool isInput () const
 
bool isOutput () const
 
const UT_StringHoldername () const
 Returns the port name that identifies it on the node. More...
 
const UT_StringHoldertypeName () const
 Returns the port's type that determines the connection compatibility. More...
 
const UT_StringHolderlabel () const
 Returns the port's label. More...
 
const UT_StringArraytags () const
 Returns the port's tags. More...
 
UN_DataSize srcWireCount () const
 Returns the number of source ports connected to the given port. More...
 
UN_DataSize dstWireCount () const
 Returns the number of destination ports connected to the given port. More...
 
UN_DataSize wireCount () const
 
bool isConnectedToSrc () const
 Returns true if this port is connected to any source port. More...
 
bool isConnectedToSrc (const UN_ConstPort &src_port) const
 Returns true if this port is connected to the given source port. More...
 
bool isConnectedToDst () const
 Returns true if this port is connected to any destination port. More...
 
bool isConnectedToDst (const UN_ConstPort &dst_port) const
 Returns true if this port is connected to the given destination port. More...
 
bool isConnected () const
 Returns true if this port is connected to any other port. More...
 
bool isConnected (const UN_ConstPort &port) const
 
SrcWireRange srcWireRange () const
 
DstWireRange dstWireRange () const
 
UT_Array< WIRE > srcWires () const
 
UT_Array< WIRE > dstWires () const
 
SrcPortRange srcPortRange () const
 
DstPortRange dstPortRange () const
 
PORT srcPort () const
 
PORT dstPort () const
 
UT_Array< PORT > srcPorts () const
 
UT_Array< PORT > dstPorts () const
 
GRAPH_DATA * graphData () const
 Returns the owner of the underlying graph data structures. More...
 
const UN_GraphDataconstGraphData () const
 Returns the owner of the underlying graph data structures. More...
 
bool isValid () const
 Returns true if this port is valid within the graph; false otherwise. More...
 
 operator bool () const
 Returns true if this port is valid within the graph; false otherwise. More...
 

Protected Member Functions

 UN_PortBase ()=default
 Constructs a handle for an invalid port. More...
 
 UN_PortBase (GRAPH_DATA *graph_data, UN_PortID port_id)
 Constructs a handle that references the given port in the given graph. More...
 

Detailed Description

template<typename BASE_CLASS, typename GRAPH_DATA, typename PORT, typename WIRE>
class UN_PortBase< BASE_CLASS, GRAPH_DATA, PORT, WIRE >

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

Definition at line 61 of file UN_Port.h.

Member Typedef Documentation

template<typename BASE_CLASS, typename GRAPH_DATA, typename PORT, typename WIRE>
using UN_PortBase< BASE_CLASS, GRAPH_DATA, PORT, WIRE >::DstPortIterator = UN_HandleIterator< PORT, GRAPH_DATA, UN_PortUtils::PortIterator< false>>

And iterator and a range for iterating over connected destination ports.

Definition at line 270 of file UN_Port.h.

template<typename BASE_CLASS, typename GRAPH_DATA, typename PORT, typename WIRE>
using UN_PortBase< BASE_CLASS, GRAPH_DATA, PORT, WIRE >::DstPortRange = UT_IteratorRange< DstPortIterator >

Definition at line 271 of file UN_Port.h.

template<typename BASE_CLASS, typename GRAPH_DATA, typename PORT, typename WIRE>
using UN_PortBase< BASE_CLASS, GRAPH_DATA, PORT, WIRE >::DstWireIterator = UN_HandleIterator< WIRE, GRAPH_DATA, UN_PortUtils::WireIterator >

An iterator and a range for iterating over the port's connected destination wires.

Definition at line 216 of file UN_Port.h.

template<typename BASE_CLASS, typename GRAPH_DATA, typename PORT, typename WIRE>
using UN_PortBase< BASE_CLASS, GRAPH_DATA, PORT, WIRE >::DstWireRange = UT_IteratorRange< DstWireIterator >

Definition at line 217 of file UN_Port.h.

template<typename BASE_CLASS, typename GRAPH_DATA, typename PORT, typename WIRE>
using UN_PortBase< BASE_CLASS, GRAPH_DATA, PORT, WIRE >::SrcPortIterator = UN_HandleIterator< PORT, GRAPH_DATA, UN_PortUtils::PortIterator< true>>

And iterator and a range for iterating over connected source ports.

Definition at line 251 of file UN_Port.h.

template<typename BASE_CLASS, typename GRAPH_DATA, typename PORT, typename WIRE>
using UN_PortBase< BASE_CLASS, GRAPH_DATA, PORT, WIRE >::SrcPortRange = UT_IteratorRange< SrcPortIterator >

Definition at line 252 of file UN_Port.h.

template<typename BASE_CLASS, typename GRAPH_DATA, typename PORT, typename WIRE>
using UN_PortBase< BASE_CLASS, GRAPH_DATA, PORT, WIRE >::SrcWireIterator = UN_HandleIterator< WIRE, GRAPH_DATA, UN_PortUtils::WireIterator >

An iterator and a range for iterating over port's connected source wires.

Definition at line 197 of file UN_Port.h.

template<typename BASE_CLASS, typename GRAPH_DATA, typename PORT, typename WIRE>
using UN_PortBase< BASE_CLASS, GRAPH_DATA, PORT, WIRE >::SrcWireRange = UT_IteratorRange< SrcWireIterator >

Definition at line 198 of file UN_Port.h.

Constructor & Destructor Documentation

template<typename BASE_CLASS, typename GRAPH_DATA, typename PORT, typename WIRE>
UN_PortBase< BASE_CLASS, GRAPH_DATA, PORT, WIRE >::UN_PortBase ( )
protecteddefault

Constructs a handle for an invalid port.

template<typename BASE_CLASS, typename GRAPH_DATA, typename PORT, typename WIRE>
UN_PortBase< BASE_CLASS, GRAPH_DATA, PORT, WIRE >::UN_PortBase ( GRAPH_DATA *  graph_data,
UN_PortID  port_id 
)
inlineprotected

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

Definition at line 68 of file UN_Port.h.

Member Function Documentation

template<typename BASE_CLASS, typename GRAPH_DATA, typename PORT, typename WIRE>
const UN_GraphData* UN_PortBase< BASE_CLASS, GRAPH_DATA, PORT, WIRE >::constGraphData ( ) const
inline

Returns the owner of the underlying graph data structures.

Definition at line 76 of file UN_Port.h.

template<typename BASE_CLASS, typename GRAPH_DATA, typename PORT, typename WIRE>
PORT UN_PortBase< BASE_CLASS, GRAPH_DATA, PORT, WIRE >::dstPort ( ) const
inline

Returns the first destination port connected to this port, or an invalid port, if no destination port is connected.

Definition at line 297 of file UN_Port.h.

template<typename BASE_CLASS, typename GRAPH_DATA, typename PORT, typename WIRE>
DstPortRange UN_PortBase< BASE_CLASS, GRAPH_DATA, PORT, WIRE >::dstPortRange ( ) const
inline

Returns a range for iterating over this port's destination ports. NOTE, the iterators hold a reference to the underlying wire array, and therefore ports can't be added/removed during the iteration. For adding/removing ports, use dstPorts() function.

Definition at line 277 of file UN_Port.h.

template<typename BASE_CLASS, typename GRAPH_DATA, typename PORT, typename WIRE>
UT_Array<PORT> UN_PortBase< BASE_CLASS, GRAPH_DATA, PORT, WIRE >::dstPorts ( ) const
inline

Returns the destination ports of this port. Ie, ports to which this port provides (sends) data.

Definition at line 314 of file UN_Port.h.

template<typename BASE_CLASS, typename GRAPH_DATA, typename PORT, typename WIRE>
UN_DataSize UN_PortBase< BASE_CLASS, GRAPH_DATA, PORT, WIRE >::dstWireCount ( ) const
inline

Returns the number of destination ports connected to the given port.

Definition at line 145 of file UN_Port.h.

template<typename BASE_CLASS, typename GRAPH_DATA, typename PORT, typename WIRE>
DstWireRange UN_PortBase< BASE_CLASS, GRAPH_DATA, PORT, WIRE >::dstWireRange ( ) const
inline

Returns a range for iterating over this port's destination wires. NOTE, the iterators hold a reference to the underlying wire array, and therefore wires can't be added/removed during the iteration. For adding/removing wires, use dstWires() function.

Definition at line 223 of file UN_Port.h.

template<typename BASE_CLASS, typename GRAPH_DATA, typename PORT, typename WIRE>
UT_Array<WIRE> UN_PortBase< BASE_CLASS, GRAPH_DATA, PORT, WIRE >::dstWires ( ) const
inline

Returns the wires connecting this port to its destinations. Ie, connection wires to which this port provides (sends) data.

Definition at line 242 of file UN_Port.h.

template<typename BASE_CLASS, typename GRAPH_DATA, typename PORT, typename WIRE>
GRAPH_DATA* UN_PortBase< BASE_CLASS, GRAPH_DATA, PORT, WIRE >::graphData ( ) const
inline

Returns the owner of the underlying graph data structures.

Definition at line 74 of file UN_Port.h.

template<typename BASE_CLASS, typename GRAPH_DATA, typename PORT, typename WIRE>
bool UN_PortBase< BASE_CLASS, GRAPH_DATA, PORT, WIRE >::isConnected ( ) const
inline

Returns true if this port is connected to any other port.

Definition at line 182 of file UN_Port.h.

template<typename BASE_CLASS, typename GRAPH_DATA, typename PORT, typename WIRE>
bool UN_PortBase< BASE_CLASS, GRAPH_DATA, PORT, WIRE >::isConnected ( const UN_ConstPort port) const
inline

Returns true if this port is connected to the given port either as a source or a destination.

Definition at line 189 of file UN_Port.h.

template<typename BASE_CLASS, typename GRAPH_DATA, typename PORT, typename WIRE>
bool UN_PortBase< BASE_CLASS, GRAPH_DATA, PORT, WIRE >::isConnectedToDst ( ) const
inline

Returns true if this port is connected to any destination port.

Definition at line 170 of file UN_Port.h.

template<typename BASE_CLASS, typename GRAPH_DATA, typename PORT, typename WIRE>
bool UN_PortBase< BASE_CLASS, GRAPH_DATA, PORT, WIRE >::isConnectedToDst ( const UN_ConstPort dst_port) const
inline

Returns true if this port is connected to the given destination port.

Definition at line 176 of file UN_Port.h.

template<typename BASE_CLASS, typename GRAPH_DATA, typename PORT, typename WIRE>
bool UN_PortBase< BASE_CLASS, GRAPH_DATA, PORT, WIRE >::isConnectedToSrc ( ) const
inline

Returns true if this port is connected to any source port.

Definition at line 158 of file UN_Port.h.

template<typename BASE_CLASS, typename GRAPH_DATA, typename PORT, typename WIRE>
bool UN_PortBase< BASE_CLASS, GRAPH_DATA, PORT, WIRE >::isConnectedToSrc ( const UN_ConstPort src_port) const
inline

Returns true if this port is connected to the given source port.

Definition at line 164 of file UN_Port.h.

template<typename BASE_CLASS, typename GRAPH_DATA, typename PORT, typename WIRE>
bool UN_PortBase< BASE_CLASS, GRAPH_DATA, PORT, WIRE >::isInput ( ) const
inline

Definition at line 102 of file UN_Port.h.

template<typename BASE_CLASS, typename GRAPH_DATA, typename PORT, typename WIRE>
bool UN_PortBase< BASE_CLASS, GRAPH_DATA, PORT, WIRE >::isOutput ( ) const
inline

Definition at line 108 of file UN_Port.h.

template<typename BASE_CLASS, typename GRAPH_DATA, typename PORT, typename WIRE>
bool UN_PortBase< BASE_CLASS, GRAPH_DATA, PORT, WIRE >::isValid ( ) const
inline

Returns true if this port is valid within the graph; false otherwise.

Definition at line 85 of file UN_Port.h.

template<typename BASE_CLASS, typename GRAPH_DATA, typename PORT, typename WIRE>
UN_PortKind UN_PortBase< BASE_CLASS, GRAPH_DATA, PORT, WIRE >::kind ( ) const
inline

Returns the kind of a port. Ie, an input or an output.

Definition at line 96 of file UN_Port.h.

template<typename BASE_CLASS, typename GRAPH_DATA, typename PORT, typename WIRE>
const UT_StringHolder& UN_PortBase< BASE_CLASS, GRAPH_DATA, PORT, WIRE >::label ( ) const
inline

Returns the port's label.

Definition at line 126 of file UN_Port.h.

template<typename BASE_CLASS, typename GRAPH_DATA, typename PORT, typename WIRE>
const UT_StringHolder& UN_PortBase< BASE_CLASS, GRAPH_DATA, PORT, WIRE >::name ( void  ) const
inline

Returns the port name that identifies it on the node.

Definition at line 114 of file UN_Port.h.

template<typename BASE_CLASS, typename GRAPH_DATA, typename PORT, typename WIRE>
UN_PortBase< BASE_CLASS, GRAPH_DATA, PORT, WIRE >::operator bool ( ) const
inlineexplicit

Returns true if this port is valid within the graph; false otherwise.

Definition at line 91 of file UN_Port.h.

template<typename BASE_CLASS, typename GRAPH_DATA, typename PORT, typename WIRE>
UN_PortID UN_PortBase< BASE_CLASS, GRAPH_DATA, PORT, WIRE >::portID ( ) const
inline

Returns the unique ID of the port this handle refers to.

Definition at line 81 of file UN_Port.h.

template<typename BASE_CLASS, typename GRAPH_DATA, typename PORT, typename WIRE>
PORT UN_PortBase< BASE_CLASS, GRAPH_DATA, PORT, WIRE >::srcPort ( ) const
inline

Returns the first source port connected to this port, or an invalid port, if no source port is connected.

Definition at line 289 of file UN_Port.h.

template<typename BASE_CLASS, typename GRAPH_DATA, typename PORT, typename WIRE>
SrcPortRange UN_PortBase< BASE_CLASS, GRAPH_DATA, PORT, WIRE >::srcPortRange ( ) const
inline

Returns a range for iterating over this port's source ports. NOTE, the iterators hold a reference to the underlying wire array, and therefore ports can't be added/removed during the iteration. For adding/removing ports, use srcPorts() function.

Definition at line 258 of file UN_Port.h.

template<typename BASE_CLASS, typename GRAPH_DATA, typename PORT, typename WIRE>
UT_Array<PORT> UN_PortBase< BASE_CLASS, GRAPH_DATA, PORT, WIRE >::srcPorts ( ) const
inline

Returns the source ports of this port. Ie, ports from which this port takes (receives) data.

Definition at line 306 of file UN_Port.h.

template<typename BASE_CLASS, typename GRAPH_DATA, typename PORT, typename WIRE>
UN_DataSize UN_PortBase< BASE_CLASS, GRAPH_DATA, PORT, WIRE >::srcWireCount ( ) const
inline

Returns the number of source ports connected to the given port.

Definition at line 139 of file UN_Port.h.

template<typename BASE_CLASS, typename GRAPH_DATA, typename PORT, typename WIRE>
SrcWireRange UN_PortBase< BASE_CLASS, GRAPH_DATA, PORT, WIRE >::srcWireRange ( ) const
inline

Returns a range for iterating over this port's source wires. NOTE, the iterators hold a reference to the underlying wire array, and therefore wires can't be added/removed during the iteration. For adding/removing wires, use srcWires() function.

Definition at line 204 of file UN_Port.h.

template<typename BASE_CLASS, typename GRAPH_DATA, typename PORT, typename WIRE>
UT_Array<WIRE> UN_PortBase< BASE_CLASS, GRAPH_DATA, PORT, WIRE >::srcWires ( ) const
inline

Returns the wires connecting this port to its sources. Ie, connection wires from which this port takes (receives) data.

Definition at line 234 of file UN_Port.h.

template<typename BASE_CLASS, typename GRAPH_DATA, typename PORT, typename WIRE>
const UT_StringArray& UN_PortBase< BASE_CLASS, GRAPH_DATA, PORT, WIRE >::tags ( ) const
inline

Returns the port's tags.

Definition at line 132 of file UN_Port.h.

template<typename BASE_CLASS, typename GRAPH_DATA, typename PORT, typename WIRE>
const UT_StringHolder& UN_PortBase< BASE_CLASS, GRAPH_DATA, PORT, WIRE >::typeName ( ) const
inline

Returns the port's type that determines the connection compatibility.

Definition at line 120 of file UN_Port.h.

template<typename BASE_CLASS, typename GRAPH_DATA, typename PORT, typename WIRE>
UN_DataSize UN_PortBase< BASE_CLASS, GRAPH_DATA, PORT, WIRE >::wireCount ( ) const
inline

Returns the number of ports connected to the given port, either as a source or a destination port.

Definition at line 152 of file UN_Port.h.


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