> This page is for version 4.3.
> For other versions, use one of these documentation indexes:
> - 4.6 (Latest) (default): https://docs.nvidia.com/holoscan/sdk-user-guide/4-6-latest/llms.txt
> - ltsb-2.0: https://docs.nvidia.com/holoscan/sdk-user-guide/ltsb-2-0/llms.txt
> - 4.5: https://docs.nvidia.com/holoscan/sdk-user-guide/4-5/llms.txt
> - 4.4: https://docs.nvidia.com/holoscan/sdk-user-guide/4-4/llms.txt
> - 4.3: https://docs.nvidia.com/holoscan/sdk-user-guide/4-3/llms.txt
> - Archives: https://docs.nvidia.com/holoscan/sdk-user-guide/archives/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/holoscan/sdk-user-guide/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/holoscan/sdk-user-guide/_mcp/server.

# holoscan::InterfacePort

> Interface port that maps external subgraph port name to internal operator port(s).

Interface port that maps external subgraph port name to internal operator port(s).

For most ports, there is a single mapping. However, input interface ports can have multiple mappings, allowing a single external interface port to broadcast to multiple internal operators.

```cpp showLineNumbers={false}
#include <holoscan/subgraph.hpp>
```

---

## Methods

### size \[#size]

```cpp showLineNumbers={false}
size_t holoscan::InterfacePort::size() const
```

Get number of mappings.

### empty \[#empty]

```cpp showLineNumbers={false}
bool holoscan::InterfacePort::empty() const
```

Check if empty.

### add_mapping \[#addmapping]

```cpp showLineNumbers={false}
void holoscan::InterfacePort::add_mapping(
    std::shared_ptr<Operator> op,
    std::string port_name
)
```

Add a mapping.

---

## Types

### PortType

Type of interface port.

| Name         | Value | Description                                |
| ------------ | ----- | ------------------------------------------ |
| `kData`      |       | Regular data port (for data flow).         |
| `kExecution` |       | Execution control port (for control flow). |

---

## Member variables

| Name        | Type                     | Description                                |
| ----------- | ------------------------ | ------------------------------------------ |
| `mappings`  | `std::vector< Mapping >` | List of internal operator/port mappings.   |
| `is_input`  | `bool`                   | Whether this is an input port (vs output). |
| `port_type` | `PortType`               | Port type (data or execution).             |

---

## Inner classes

### Mapping

```cpp showLineNumbers={false}
struct holoscan::InterfacePort::Mapping
```

A single mapping from external interface port to internal operator port.

| Name                 | Type                          | Description                           |
| -------------------- | ----------------------------- | ------------------------------------- |
| `internal_operator`  | `std::shared_ptr< Operator >` | Internal operator that owns the port. |
| `internal_port_name` | `std::string`                 | Port name on the internal operator.   |