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 SourcePortIterator = UN_WireArrayPortIterator< true >
 And iterator and a range for iterating over connected source ports. More...
 
using SourcePortRange = UT_IteratorRange< SourcePortIterator >
 
using DestinationPortIterator = UN_WireArrayPortIterator< false >
 And iterator and a range for iterating over connected destination ports. More...
 
using DestinationPortRange = UT_IteratorRange< DestinationPortIterator >
 

Public Member Functions

 UN_Port (UN_GraphData *graph_data, UN_PortIndex port_index, 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 connectSource (const UN_Port &src_port) const
 
void disconnectSource (const UN_Port &src_port) const
 Disconnects this port from the given source. More...
 
void disconnectSources () const
 Disconnect this port from all its connected sources. More...
 
void disconnectDestinations () const
 
UT_Array< UN_WiresourceWires () const
 
UT_Array< UN_WiredestinationWires () const
 
UN_Port sourcePort () const
 
SourcePortRange sourcePortRange () const
 Returns a range for iterating over this port's source ports. More...
 
DestinationPortRange destinationPortRange () const
 Returns a range for iterating over this port's destination ports. More...
 
void destroy () const
 Deletes this port. More...
 
UN_PortIndex portIndex () const
 Returns the port data index this handle refers to. 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_DataIndex data_index, UN_DataID data_id)
 Convenience constructor. More...
 
 UN_Handle ()
 Default constructor. More...
 
UN_DataIndex dataIndex () const
 
UN_DataID dataID () const
 The unique ID of a data object during the lifespan of the owner graph. More...
 
 ~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...
 

Additional Inherited Members

- 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_PortData) 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 30 of file UN_Port.h.

Member Typedef Documentation

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

Definition at line 118 of file UN_Port.h.

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

Definition at line 110 of file UN_Port.h.

Constructor & Destructor Documentation

UN_Port::UN_Port ( UN_GraphData *  graph_data,
UN_PortIndex  port_index,
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::connectSource ( 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).

DestinationPortRange UN_Port::destinationPortRange ( ) const

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

UT_Array<UN_Wire> UN_Port::destinationWires ( ) const

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

void UN_Port::destroy ( ) const

Deletes this port.

void UN_Port::disconnectDestinations ( ) const

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

void UN_Port::disconnectSource ( const UN_Port src_port) const

Disconnects this port from the given source.

void UN_Port::disconnectSources ( ) const

Disconnect this port from all its connected sources.

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 50 of file UN_Port.h.

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

Comparison operators.

Definition at line 57 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 55 of file UN_Port.h.

UN_PortID UN_Port::portID ( ) const
inline

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

Definition at line 133 of file UN_Port.h.

UN_PortIndex UN_Port::portIndex ( ) const
inline

Returns the port data index this handle refers to.

Definition at line 129 of file UN_Port.h.

UN_Port UN_Port::sourcePort ( ) 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.

SourcePortRange UN_Port::sourcePortRange ( ) const

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

UT_Array<UN_Wire> UN_Port::sourceWires ( ) 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: