> ## 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.

# ansys::dpf::Streams Class Reference

Defines an open, ready-to-use, data sources.

`#include <dpf_api.h>`

Inheritance diagram for ansys::dpf::Streams:

![](https://mintcdn.com/synopsys-00a47cbc/Srh1_f--TdKCLyqD/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Streams.png?fit=max\&auto=format\&n=Srh1_f--TdKCLyqD\&q=85\&s=a4062404b051451392109e3ad8854187)

## Public Member Functions

| Type | Name |
| - | - |
| | [Streams](#a2fb94c03c22c93198568b298397a39f0) ([DataSources](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1DataSources.md) const \&dataSources) |
| | **Streams** ([Streams](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Streams.md) const &) |
| | **Streams** ([Streams](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Streams.md) &&) noexcept |
| | [Streams](#a24c07bb8c759f0a8b2cacd44af9ac929) (int id, [Client](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Client.md) const \*const client) |
| [Streams](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Streams.md) & | **operator=** ([Streams](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Streams.md) const &) |
| [Streams](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Streams.md) & | **operator=** ([Streams](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Streams.md) &&) noexcept |
| void | [releaseFiles](#a959c1869453d29b05a9fe3ce191404fb) () |
| void | [addStream](#a13bc16955004519b53af3b0cc4ab613a) ([ExternalStream](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1ExternalStream.md) \*stream) |
| void | [addStream](#a6451cbe0726b6ab1da471b7bda20fabb) ([ExternalStream](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1ExternalStream.md) \*stream, [LabelSpace](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1LabelSpace.md) const \&identifier) |
|  template\<typename ExternalStreamType > ExternalStreamType \*const | **getExternalStream** (std::string const \&key) const |
|  template\<typename ExternalStreamType > ExternalStreamType \*const | **getExternalStream** ([LabelSpace](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1LabelSpace.md) const \&identifier) const |
| [DataSources](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1DataSources.md) | **dataSources** () const |

> [accordion] Public Member Functions inherited from ansys::dpf::DpfTypes
>
> Public Member Functions inherited from [ansys::dpf::DpfTypes](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1DpfTypes.md)
>
> | Type | Name |
> | - | - |
> | virtual bool | [empty](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1DpfTypes.md#a39cd546c42518e2332be8f287db95459) () const |
> | virtual bool | [hasInternalObject](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1DpfTypes.md#ae198f89868d85c7db6dc1a934a1d3c15) () const |
> | virtual std::string | [describe](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1DpfTypes.md#a9977945710983bc03d2940fa007847b2) () const |
> | so::API const \* | [callAPI](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1DpfTypes.md#aea34d37e0c080126eff70db34bf46597) () const |
> | bool | [isOnCommonAPI](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1DpfTypes.md#a9f9789ff61cc9d400a2a344830706b73) () const |
> | bool | [getClient](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1DpfTypes.md#a968afd9daa0b0f13b65a2ac61369d73a) ([Client](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Client.md) \&client) const |
> | bool | [hasBeenMovedLocally](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1DpfTypes.md#a1a5634202c15404b6b24e8f50e51cb66) () const |
> | bool | [isSameObject](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1DpfTypes.md#aa64d5f8fcd7d85ad6ebf708494dbefd7) ([DpfTypes](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1DpfTypes.md) const \&rhs) const |

## Static Public Member Functions

| Type | Name |
| - | - |
| static [Streams](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Streams.md) | [emptyStreams](#a5bace24c4a163ba13a5aca8fb6f24199) () |

## Detailed Description

Defines an open, ready-to-use, data sources.

[Streams](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Streams.md) is an entity containing the data sources. Once the files in the streams are opened, they stay opened and they keep some data in cache to make the next evaluations faster. To close the files, release the streams.

## Constructor & Destructor Documentation

### Streams() \[1/2]

```cpp theme={null}
ansys::dpf::Streams::Streams(DataSources const & dataSources)
```

Create a stream from given data sources.

**Parameters**

| Direction | Name | Description |
| - | - | - |
| \[in] | dataSources | Data source from which to create stream. |

### Streams() \[2/2]

```cpp theme={null}
ansys::dpf::Streams::Streams(
    int id,
    Client const *const client
)
```

Retrieve an existing instance of [Streams](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Streams.md) on a server. \


**Parameters**

| Direction | Name | Description |
| - | - | - |
| \[in] | id | Id of the [Streams](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Streams.md) on the server's database. |
| \[in] | client | [Client](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Client.md) instance designating the IP, port and protocol to use. |

## Member Function Documentation

### addStream() \[1/2]

```cpp theme={null}
void ansys::dpf::Streams::addStream(ExternalStream * stream)
```

Add external stream.

**Parameters**

| Direction | Name | Description |
| - | - | - |
| \[in] | stream | External stream to add. |

### addStream() \[2/2]

```cpp theme={null}
void ansys::dpf::Streams::addStream(
    ExternalStream * stream,
    LabelSpace const & identifier
)
```

Add external stream.

**Parameters**

| Direction | Name | Description |
| - | - | - |
| \[in] | stream | External stream to add. |
| \[in] | identifier | Identifier returned by the data sources. |

### emptyStreams()

```cpp theme={null}
static Streams ansys::dpf::Streams::emptyStreams()
```

`static`

Create an empty streams.

**Returns**

Empty [Streams](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Streams.md).

### releaseFiles()

```cpp theme={null}
void ansys::dpf::Streams::releaseFiles()
```

Closes all files and releases file resources.
