# Port Class Reference

Related Scripting Object: Port

A port is an input or output connection to another object. More...

`#include <xsi_port.h>`

Inheritance diagram for Port:

List of all members.

## Public Member Functions
| Port ()
| ~Port ()
| Port (const CRef &in_ref)
| Port (const Port &in_obj)
bool | IsA (siClassID in_ClassID) const
siClassID | GetClassID () const
Port & | operator= (const Port &in_obj)
Port & | operator= (const CRef &in_ref)
bool | IsConnected () const
LONG | GetIndex () const
siPortType | GetPortType () const
CRef | GetTarget (void) const
LONG | GetGroupIndex (void) const
CString | GetGroupName (void) const
LONG | GetGroupInstance (void) const
siPortFlags | GetFlags (void) const
bool | GetBranchGroup () const
CString | GetTargetPath () const

## Detailed Description

A port is an input or output connection to another object.

Actually, a port is more like a connection point on an operator, which may or may not be actually connected to something (some operator ports are optional).

Use SIObject::GetName to get the name of this port.

See also:
  Operator, OperatorContext, UpdateContext, SIObject, InputPort, OutputPort

## Constructor & Destructor Documentation

Port | ( |  | ) |

Default constructor.

~Port | ( |  | ) |

Default destructor.

Port | ( | const CRef & | in_ref | ) |

Constructor.

Parameters:

  | in_ref | constant reference object.

Port | ( | const Port & | in_obj | ) |

Copy constructor.

Parameters:

  | in_obj | constant class object.

## Member Function Documentation

bool IsA | ( | siClassID | in_ClassID | ) | const`[virtual]`

Returns true if a given class type is compatible with this API class.

Parameters:

  | in_ClassID | class type.

Returns:
  true if the class is compatible, false otherwise.

Reimplemented from SIObject.

Reimplemented in InputPort, and OutputPort.

siClassID GetClassID | ( |  | ) | const`[virtual]`

Returns the type of the API class.

Returns:
  The class type.

Reimplemented from SIObject.

Reimplemented in InputPort, and OutputPort.

Port& operator= | ( | const Port & | in_obj | ) |

Creates an object from another object. The newly created object is set to empty if the input object is not compatible.

Parameters:

  | in_obj | constant class object.

Returns:
  The new Port object.

Port& operator= | ( | const CRef & | in_ref | ) |

Creates an object from a reference object. The newly created object is set to empty if the input reference object is not compatible.

Parameters:

  | in_ref | constant class object.

Returns:
  The new Port object.

Reimplemented from SIObject.

Reimplemented in InputPort, and OutputPort.

bool IsConnected | ( |  | ) | const

Returns true if the port is connected, false otherwise

Returns:
  true if connected; false otherwise.

LONG GetIndex | ( |  | ) | const

Returns the port index of this port as a `LONG` within its port group or -1 if there is a failure.

Note:
  This index refers to the index of the port within the port group and is different from the index used to access the CRefArrays of InputPort or OutputPort references (available through Operator::GetInputPorts and Operator::GetOutputPorts).

Note:
  This index is rarely a concern when implementing Self-Installed Custom Operators, because OperatorContext::GetInputValue is based on the CRefArray index for the InputPort and normally there is only a single output port (see OperatorContext::GetOutputPort).

Note:
  When the Port is an output port, returned from a call to CustomProperty::AddOutputPort, this index may change if any input ports are added afterwards.

Returns:
  LONG > 0 success

  -1 failure

siPortType GetPortType | ( |  | ) | const

Returns the type of the port, input or output.

Returns:
  The Port type.

CRef GetTarget | ( | void |  | ) | const

Returns a reference object for the object connected to the port. If this function is called from the Update() context of a custom operator it will return an empty CRef.

Return values:

  | out_pTarget | the object to which the port is connected.

Returns:
  A reference to the object connected to the port.

See also:
  Port_Target2

LONG GetGroupIndex | ( | void |  | ) | const

Returns the index of the port group to which the port belongs.

Returns:
  LONG > 0 success

  -1 means failure

CString GetGroupName | ( | void |  | ) | const

Returns the name of the port group to which the port belongs.

Returns:
  The name of the port group (empty string means failure)

LONG GetGroupInstance | ( | void |  | ) | const

Returns the port group instance index for the port. There may be many objects of the same type connected to the same port group. Each object is connected to a port group instance, and within the port group instance there may be many ports.

Returns:
  LONG > 0 success

  -1 means failure

siPortFlags GetFlags | ( | void |  | ) | const

Returns the mask of port flags described in siPortFlags.

Returns:
  The mask containing port flags

Since:
  4.0

bool GetBranchGroup | ( |  | ) | const

Returns true if the port supports branch and group connections.

Returns:
  true if the port supports branch and group connections.

Since:
  4.0

CString GetTargetPath | ( |  | ) | const

Returns a string containing the path to the target object.

Returns:
  The path to the target object.

Since:
  4.0

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

- xsi_port.h