> ## Documentation Index
> Fetch the complete documentation index at: https://developer.synopsys.com/llms.txt
> Use this file to discover all available pages before exploring further.

# sysc::CouplingInterface Class Reference

Part of [C++ Interfaces for Participant Library](https://developer.synopsys.com/docs/system-coupling/system-coupling-cpp-library/group__SystemCouplingParticipantAPIs)

Provide a class for a coupling interface.

`#include <CouplingInterface.hpp>`

## Public Member Functions

| Type | Name |
| - | - |
| | [CouplingInterface](#a606ddfa3113e3e0bf1ee7eee2b58793d) ([CouplingInterfaceName](https://developer.synopsys.com/docs/system-coupling/system-coupling-cpp-library/group__SystemCouplingParticipantAPIs#ga8a62847c55d192b835faff927dbf41a3) interfaceName) Provide a constructor for the [CouplingInterface](https://developer.synopsys.com/docs/system-coupling/system-coupling-cpp-library/classsysc_1_1CouplingInterface.md) class. |
| void | [addSideOneRegion](#ab7a385065f0fde034baa88a88f274946) (const [Region](https://developer.synopsys.com/docs/system-coupling/system-coupling-cpp-library/classsysc_1_1Region.md) \&region) Add region to side one of the interface. |
| void | [addSideTwoRegion](#a5afdb8ffa5c06d66fe30e6f150230b67) (const [Region](https://developer.synopsys.com/docs/system-coupling/system-coupling-cpp-library/classsysc_1_1Region.md) \&region) Add region to side two of the interface. |
|  const [CouplingInterfaceName](https://developer.synopsys.com/docs/system-coupling/system-coupling-cpp-library/group__SystemCouplingParticipantAPIs#ga8a62847c55d192b835faff927dbf41a3) & | [getName](#a16898e4f25dd40d0e8bc2efec9c4db1d) () const Get coupling interface name. |
|  std::size\_t | [getNumSideOneRegions](#a84873c1535d70a88096d44242c97a1b7) () const Get the number of regions on side one of the interface. |
|  std::size\_t | [getNumSideTwoRegions](#a03a32678f212092a83149ea2b0c54f20) () const Get the number of regions on side two of the interface. |
|  const [Region](https://developer.synopsys.com/docs/system-coupling/system-coupling-cpp-library/classsysc_1_1Region.md) & | [getSideOneRegion](#a1191a096450bd4569325be7bef6cb1f6) (std::size\_t index) const Get the region on side one, given an index. |
|  const [Region](https://developer.synopsys.com/docs/system-coupling/system-coupling-cpp-library/classsysc_1_1Region.md) & | [getSideTwoRegion](#a2809a5c10d6fc48e7c079fb09deaccd3) (std::size\_t index) const Get the region on side two, given an index. |
|  void | [addDataTransfer](#ab1230f4b0c7dc52fff73d1ddcd67f03e) (const [DataTransfer](https://developer.synopsys.com/docs/system-coupling/system-coupling-cpp-library/classsysc_1_1DataTransfer.md) \&dataTransfer) Add a data transfer. |
|  std::size\_t | [getNumDataTransfers](#a9ac1bf66c466b9567e26fdf5c2108c05) () const noexcept Get the number of data transfers. |
|  const [DataTransfer](https://developer.synopsys.com/docs/system-coupling/system-coupling-cpp-library/classsysc_1_1DataTransfer.md) & | [getDataTransfer](#a712f091ef0bb543a6539c32fd6762fa8) (std::size\_t index) const Get the data transfer, given an index. |

## Detailed Description

Provide a class for a coupling interface.

Coupling interface can be used to set up the transfers of data between different regions within the same participant solver. Interface contains two sides and each side can contain one or more regions.

All regions on one side of the interface must have the same topology.

Definition at line [28](https://developer.synopsys.com/docs/system-coupling/system-coupling-cpp-library/CouplingInterface_8hpp_source) of file [CouplingInterface.hpp](https://developer.synopsys.com/docs/system-coupling/system-coupling-cpp-library/CouplingInterface_8hpp_source).

## Constructor & Destructor Documentation

### CouplingInterface()

```cpp theme={null}
sysc::CouplingInterface::CouplingInterface(CouplingInterfaceName interfaceName)
```

Provide a constructor for the [CouplingInterface](https://developer.synopsys.com/docs/system-coupling/system-coupling-cpp-library/classsysc_1_1CouplingInterface.md) class.

**Parameters**

| Direction | Name | Description |
| - | - | - |
| \[in] | interfaceName | A unique name for the coupling interface. |

## Member Function Documentation

### addSideOneRegion()

```cpp theme={null}
void sysc::CouplingInterface::addSideOneRegion(const Region & region)
```

Add region to side one of the interface.

If this region has already been added to the interface on side one, then this call will have no effect.

If a different region with the same name has already been added to the interface on side one, then a runtime error will be thrown.

If a region with the same name has already been added to the interface on side two, then a runtime error will be thrown.

If the region name contains invalid characters, a runtime error will be thrown.

**Parameters**

| Direction | Name | Description |
| - | - | - |
| \[in] | region | [Region](https://developer.synopsys.com/docs/system-coupling/system-coupling-cpp-library/classsysc_1_1Region.md) to be added to side one of the interface. |

### addSideTwoRegion()

```cpp theme={null}
void sysc::CouplingInterface::addSideTwoRegion(const Region & region)
```

Add region to side two of the interface.

If this region has already been added to the interface on side two, then this call will have no effect.

If a different region with the same name has already been added to the interface on side two, then a runtime error will be thrown.

If a region with the same name has already been added to the interface on side one, then a runtime error will be thrown.

If the region name contains invalid characters, a runtime error will be thrown.

**Parameters**

| Direction | Name | Description |
| - | - | - |
| \[in] | region | [Region](https://developer.synopsys.com/docs/system-coupling/system-coupling-cpp-library/classsysc_1_1Region.md) to be added to side one of the interface. |
