HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UN_Port Class Reference

#include <UN_Port.h>

+ Inheritance diagram for UN_Port:

Public Types

using SrcPortIterator = UN_WireArrayPortIterator< true >
 And iterator and a range for iterating over connected source ports. More...
 
using SrcPortRange = UT_IteratorRange< SrcPortIterator >
 
using DstPortIterator = UN_WireArrayPortIterator< false >
 And iterator and a range for iterating over connected destination ports. More...
 
using DstPortRange = UT_IteratorRange< DstPortIterator >
 

Public Member Functions

 UN_Port (UN_GraphData *graph_data, UN_PortID port_id)
 Convenience constructor for the port handle. More...
 
UN_Node node () const
 Returns the parent of this node. More...
 
UN_PortKind kind () const
 Returns the kind of a port. Ie, if a port is an input or an output. More...
 
UT_StringHolder name () const
 Returns the name of the port. More...
 
UT_StringHolder typeName () const
 Returns name of the type of the port. More...
 
UN_Wire connectSrcPort (const UN_Port &src_port) const
 
void disconnectSrcPort (const UN_Port &src_port) const
 Disconnects this port from the given source. More...
 
void disconnectAllSrcPorts () const
 Disconnect this port from all its connected sources. More...
 
void disconnectAllDstPorts () const
 
UT_Array< UN_WiresrcWires () const
 
UT_Array< UN_WiredstWires () const
 
UN_Port srcPort () const
 
SrcPortRange srcPortRange () const
 Returns a range for iterating over this port's source ports. More...
 
DstPortRange dstPortRange () const
 Returns a range for iterating over this port's destination ports. More...
 
void destroy () const
 Deletes this port. More...
 
UN_PortID portID () const
 Returns the unique ID of the port data this handle refers to. More...
 
 UN_Port ()
 Default destructor, constructors and assignment operators. More...
 
 ~UN_Port ()
 Default destructor, constructors and assignment operators. More...
 
 UN_Port (const UN_Port &)
 Default destructor, constructors and assignment operators. More...
 
 UN_Port (UN_Port &&)
 Default destructor, constructors and assignment operators. More...
 
UN_Portoperator= (const UN_Port &)
 Default destructor, constructors and assignment operators. More...
 
UN_Portoperator= (UN_Port &&)
 Default destructor, constructors and assignment operators. More...
 
bool isValid () const
 Returns true if the parameter exists; false otherwise. More...
 
 operator bool () const
 Returns true if the parameter exists; false otherwise. More...
 
bool operator== (const UN_Port &other) const
 Comparison operators. More...
 
bool operator!= (const UN_Port &other) const
 Comparison operators. More...
 
- Public Member Functions inherited from UN_Handle
 UN_Handle (UN_GraphData *graph_data, UN_DataID data_id)
 Convenience constructor. More...
 
 UN_Handle ()
 Default constructor. More...
 
UN_DataID dataID () const
 
 ~UN_Handle ()=default
 Default destructor, constructors and assignment operators. More...
 
 UN_Handle (const UN_Handle &)=default
 Default destructor, constructors and assignment operators. More...
 
 UN_Handle (UN_Handle &&)=default
 Default destructor, constructors and assignment operators. More...
 
UN_Handleoperator= (const UN_Handle &)=default
 Default destructor, constructors and assignment operators. More...
 
UN_Handleoperator= (UN_Handle &&)=default
 Default destructor, constructors and assignment operators. More...
 
bool operator== (const UN_Handle &other) const
 Comparison operators. More...
 
bool operator!= (const UN_Handle &other) const
 Comparison operators. More...
 

Protected Member Functions

UN_PortData * portData () const
 The port data container for all the ports in the graph. More...
 
- Protected Member Functions inherited from UN_Handle
UN_GraphData * graphData () const
 

Detailed Description

A light-weight handle for a port data object.

The actual port data (UN_PortDataStruct) is owned and managed by UN_GraphData, and UN_Port serves as a handle for clients to refer to that port data.

Definition at line 31 of file UN_Port.h.

Member Typedef Documentation

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

Definition at line 117 of file UN_Port.h.

Definition at line 118 of file UN_Port.h.

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

Definition at line 109 of file UN_Port.h.

Definition at line 110 of file UN_Port.h.

Constructor & Destructor Documentation

UN_Port::UN_Port ( UN_GraphData *  graph_data,
UN_PortID  port_id 
)

Convenience constructor for the port handle.

UN_Port::UN_Port ( )

Default destructor, constructors and assignment operators.

UN_Port::~UN_Port ( )

Default destructor, constructors and assignment operators.

UN_Port::UN_Port ( const UN_Port )

Default destructor, constructors and assignment operators.

UN_Port::UN_Port ( UN_Port &&  )

Default destructor, constructors and assignment operators.

Member Function Documentation

UN_Wire UN_Port::connectSrcPort ( const UN_Port src_port) const

Connects this port to a source from which to obtain data or a value. Returns the newly created connection wire (may be invalid, if error).

void UN_Port::destroy ( ) const

Deletes this port.

void UN_Port::disconnectAllDstPorts ( ) const

Disconnect this port from all its connected destinations, to which this port provides data.

void UN_Port::disconnectAllSrcPorts ( ) const

Disconnect this port from all its connected sources.

void UN_Port::disconnectSrcPort ( const UN_Port src_port) const

Disconnects this port from the given source.

DstPortRange UN_Port::dstPortRange ( ) const

Returns a range for iterating over this port's destination ports.

UT_Array<UN_Wire> UN_Port::dstWires ( ) const

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

bool UN_Port::isValid ( ) const

Returns true if the parameter exists; false otherwise.

UN_PortKind UN_Port::kind ( ) const

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

UT_StringHolder UN_Port::name ( ) const

Returns the name of the port.

UN_Node UN_Port::node ( ) const

Returns the parent of this node.

UN_Port::operator bool ( ) const
inlineexplicit

Returns true if the parameter exists; false otherwise.

Definition at line 49 of file UN_Port.h.

bool UN_Port::operator!= ( const UN_Port other) const
inline

Comparison operators.

Definition at line 56 of file UN_Port.h.

UN_Port& UN_Port::operator= ( const UN_Port )

Default destructor, constructors and assignment operators.

UN_Port& UN_Port::operator= ( UN_Port &&  )

Default destructor, constructors and assignment operators.

bool UN_Port::operator== ( const UN_Port other) const
inline

Comparison operators.

Definition at line 54 of file UN_Port.h.

UN_PortData* UN_Port::portData ( ) const
protected

The port data container for all the ports in the graph.

UN_PortID UN_Port::portID ( ) const
inline

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

Definition at line 128 of file UN_Port.h.

UN_Port UN_Port::srcPort ( ) const

Returns the first source port connected to this port. May return an invalid port if no source port is connected. This is a convenience method for very common graphs, where ports can have at most one source.

SrcPortRange UN_Port::srcPortRange ( ) const

Returns a range for iterating over this port's source ports.

UT_Array<UN_Wire> UN_Port::srcWires ( ) const

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

UT_StringHolder UN_Port::typeName ( ) const

Returns name of the type of the port.


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