> ## 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::DataSources Class Reference

`#include <dpf_api.h>`

Inheritance diagram for ansys::dpf::DataSources:

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

## Public Member Functions

| Type | Name |
| - | - |
| | [DataSources](#a6428071b5158de19e283481087220d4c) ([Client](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/classansys_1_1dpf_1_1Client.md) const \*const client) |
| | **DataSources** ([DataSources](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/classansys_1_1dpf_1_1DataSources.md) const &) |
| | **DataSources** ([DataSources](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/classansys_1_1dpf_1_1DataSources.md) &&) noexcept |
| | [DataSources](#af3684cac83ff9a5e91bde6f3d421fed6) (std::string const \&result\_file\_path, std::string const \&key) |
| | [DataSources](#a2124e3800c560dc2b676b5ceeecac6d2) (std::string const \&result\_file\_path, std::string const \&key, [Client](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/classansys_1_1dpf_1_1Client.md) const \*const client) |
| | [DataSources](#ab607a7dd632e40f18baa9bdc44631011) (std::string const \&result\_file\_path) |
| | [DataSources](#a85e10756d54a7164a7c47fde17426ce8) (std::string const \&result\_file\_path, [Client](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/classansys_1_1dpf_1_1Client.md) const \*const client) |
| | [DataSources](#a187861f11263eda7b619c769b5ff83a5) (int id, [Client](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/classansys_1_1dpf_1_1Client.md) const \*const client) |
| [DataSources](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/classansys_1_1dpf_1_1DataSources.md) & | **operator=** ([DataSources](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/classansys_1_1dpf_1_1DataSources.md) const &) |
| [DataSources](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/classansys_1_1dpf_1_1DataSources.md) & | **operator=** ([DataSources](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/classansys_1_1dpf_1_1DataSources.md) &&) noexcept |
| void | [addResultFile](#ad2a5bb6f24ca621ffaaee9e7a47cdc20) (std::string const \&file\_path, std::string const \&key) |
| void | [addResultFileWString](#a8480115f09431641ad94e5088629ea10) (std::wstring const \&file\_path) |
| void | [addResultFile](#a596a92f17851f672d0572a404def4f2d) (std::string const \&file\_path) |
| void | [addDomainResultFile](#a84323382bc1f6d128bb86e6c3f15c4b0) (std::string const \&file\_path, std::string const \&key, [dp\_int](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/namespaceansys_1_1dpf#a60d181a1f9d29cc7cc38b25dac4401f0) domain\_id) |
| void | [addFile](#ad8d20dc94dee694a62fce66e91691090) (std::string const \&file\_path, std::string const \&key) |
| void | [addFile](#a51a3d8501269698d90ebf54dc0049d2a) (std::string const \&file\_path) |
| void | [addFile](#a166f58480abfc46773763764419eaf4c) (std::string const \&file\_path, std::string const \&key, std::string const \&result\_key) |
| void | [addDomainFile](#a997a716f9f6a33e05480f9965be17364) (std::string const \&file\_path, std::string const \&key, [dp\_int](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/namespaceansys_1_1dpf#a60d181a1f9d29cc7cc38b25dac4401f0) domain\_id) |
| void | [addUpStream](#a45df078c3f76993557f10d9528bd1484) ([DataSources](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/classansys_1_1dpf_1_1DataSources.md) \&ds) |
| void | [addUpStream](#a34b2782ba0ecc1469787399af5c645c9) ([DataSources](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/classansys_1_1dpf_1_1DataSources.md) \&ds, std::string const \&result\_key) |
| std::string | [resultKey](#a7320cf9a8d0850e64fc8d337ee666178) () const |
| std::string | [resultNamespaceForKey](#adfa425b1477b6ebe977f11097b9fb7c9) (std::string const \&key) const |
| std::vector\< std::string > | [filePaths](#ab406fd24d91af8256c82faee8d962c17) (std::string const \&key) const |
| std::vector\< std::string > | [resultFilePaths](#a4c0974ee4d72e7d7d2d5051796cf7de2) () const |
| std::vector\< std::string > | [keys](#a80afd0dab2f06de1b37097e89ef96e63) () const |
| int | [numPaths](#a74a2a6b4aacae91be09048a58c601d1b) () const |
| std::string | [pathAtKeyByIndex](#af9f900d56ea58cec07e7d04151c2208a) (std::string const \&key, [dp\_index](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/namespaceansys_1_1dpf#a417548d1b705a9ba54ba9429afe68920) index) const |
| std::pair\< std::string, std::string > | [pathAndKeyByIndex](#a3232c71d54216a688008e590ac8f892d) (int index) const |
| [LabelSpace](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/classansys_1_1dpf_1_1LabelSpace.md) | [identifierbyIndex](#a8803654ff5e770591c1c866271f436f6) (int index) const |
| [DataSources](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/classansys_1_1dpf_1_1DataSources.md) | [deep\_copy](#a98fc4cd5c063eef368734854b30b63c2) ([ansys::dpf::Client](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/classansys_1_1dpf_1_1Client.md) const \*const client=nullptr) const |
|  void | **registerNamespace** (std::string const \&result\_key, std::string const \&namspace) |

> [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-r2/classansys_1_1dpf_1_1DpfTypes.md)
>
> | Type | Name |
> | - | - |
> | virtual bool | [empty](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/classansys_1_1dpf_1_1DpfTypes.md#a39cd546c42518e2332be8f287db95459) () const |
> | virtual bool | [hasInternalObject](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/classansys_1_1dpf_1_1DpfTypes.md#ae198f89868d85c7db6dc1a934a1d3c15) () const |
> | virtual std::string | [describe](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/classansys_1_1dpf_1_1DpfTypes.md#a9977945710983bc03d2940fa007847b2) () const |
> | so::API const \* | [callAPI](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/classansys_1_1dpf_1_1DpfTypes.md#aea34d37e0c080126eff70db34bf46597) () const |
> | bool | [isOnCommonAPI](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/classansys_1_1dpf_1_1DpfTypes.md#a9f9789ff61cc9d400a2a344830706b73) () const |
> | bool | [getClient](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/classansys_1_1dpf_1_1DpfTypes.md#a968afd9daa0b0f13b65a2ac61369d73a) ([Client](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/classansys_1_1dpf_1_1Client.md) \&client) const |
> | bool | [hasBeenMovedLocally](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/classansys_1_1dpf_1_1DpfTypes.md#a1a5634202c15404b6b24e8f50e51cb66) () const |
> | bool | [isSameObject](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/classansys_1_1dpf_1_1DpfTypes.md#aa64d5f8fcd7d85ad6ebf708494dbefd7) ([DpfTypes](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/classansys_1_1dpf_1_1DpfTypes.md) const \&rhs) const |

## Static Public Member Functions

| Type | Name |
| - | - |
| static [DataSources](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/classansys_1_1dpf_1_1DataSources.md) | [emptyDataSources](#a014bb2c064ff1dce21325a012a57a4c8) () |

## Detailed Description

Container of files on which the analysis results can be found.

**Examples**

[AveragingTest.cpp](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/AveragingTest_8cpp-example.md), [CompleteRST.cpp](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/CompleteRST_8cpp-example.md), [DataApis.cpp](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/DataApis_8cpp-example.md), [DataExport.cpp](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/DataExport_8cpp-example.md), [OperatorsApis.cpp](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/OperatorsApis_8cpp-example.md), [ResultTest.cpp](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/ResultTest_8cpp-example.md), and [WorkflowExamples.cpp](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/WorkflowExamples_8cpp-example.md).

## Constructor & Destructor Documentation

### DataSources() \[1/6]

```cpp theme={null}
ansys::dpf::DataSources::DataSources(Client const *const client)
```

Create a file container on a server.

**Parameters**

| Direction | Name | Description |
| - | - | - |
| \[in] | client | [Client](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/classansys_1_1dpf_1_1Client.md) instance designating the IP, port and protocol to use. |

### DataSources() \[2/6]

```cpp theme={null}
ansys::dpf::DataSources::DataSources(
    std::string const & result_file_path,
    std::string const & key
)
```

Create a file container with given file and key.

**Parameters**

| Direction | Name | Description |
| - | - | - |
| \[in] | result\_file\_path | [Result](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/classansys_1_1dpf_1_1Result.md) file with which to create data source container. |
| \[in] | key | Key describing type of file. |

### DataSources() \[3/6]

```cpp theme={null}
ansys::dpf::DataSources::DataSources(
    std::string const & result_file_path,
    std::string const & key,
    Client const *const client
)
```

Create a file container with given file and key.

**Parameters**

| Direction | Name | Description |
| - | - | - |
| \[in] | result\_file\_path | [Result](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/classansys_1_1dpf_1_1Result.md) file with which to create data source container. |
| \[in] | key | Key describing type of file. |
| \[in] | client | [Client](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/classansys_1_1dpf_1_1Client.md) instance designating the IP, port and protocol to use. |

### DataSources() \[4/6]

```cpp theme={null}
ansys::dpf::DataSources::DataSources(std::string const & result_file_path)
```

Create a file container with given file.

**Parameters**

| Direction | Name | Description |
| - | - | - |
| \[in] | result\_file\_path | [Result](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/classansys_1_1dpf_1_1Result.md) file with which to create data source container. |

### DataSources() \[5/6]

```cpp theme={null}
ansys::dpf::DataSources::DataSources(
    std::string const & result_file_path,
    Client const *const client
)
```

Create a file container with given file on a server.

**Parameters**

| Direction | Name | Description |
| - | - | - |
| \[in] | result\_file\_path | [Result](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/classansys_1_1dpf_1_1Result.md) file with which to create data source container. |

### DataSources() \[6/6]

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

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


**Parameters**

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

## Member Function Documentation

### addDomainFile()

```cpp theme={null}
void ansys::dpf::DataSources::addDomainFile(
    std::string const & file_path,
    std::string const & key,
    dp_int domain_id
)
```

Add domain file with key and domain id to data sources.

**Parameters**

| Direction | Name | Description |
| - | - | - |
| \[in] | file\_path | File to use with data source container. |
| \[in] | key | Key describing type of file. |
| \[in] | domain\_id | Domain id of file. |

### addDomainResultFile()

```cpp theme={null}
void ansys::dpf::DataSources::addDomainResultFile(
    std::string const & file_path,
    std::string const & key,
    dp_int domain_id
)
```

Define data source result file with key and domain.

**Parameters**

| Direction | Name | Description |
| - | - | - |
| \[in] | file\_path | [Result](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/classansys_1_1dpf_1_1Result.md) file to use with data source container. |
| \[in] | key | Key describing type of file. |
| \[in] | domain\_id | Domain id of file. |

### addFile() \[1/3]

```cpp theme={null}
void ansys::dpf::DataSources::addFile(std::string const & file_path)
```

Add secondary, non-result, file to data sources.

**Parameters**

| Direction | Name | Description |
| - | - | - |
| \[in] | file\_path | File to use with data source container. |

### addFile() \[2/3]

```cpp theme={null}
void ansys::dpf::DataSources::addFile(
    std::string const & file_path,
    std::string const & key
)
```

Add secondary, non-result, file with key to data sources.

**Parameters**

| Direction | Name | Description |
| - | - | - |
| \[in] | file\_path | File to use with data source container. |
| \[in] | key | Key describing type of file. |

**Examples**

[DataApis.cpp](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/DataApis_8cpp-example.md).

### addFile() \[3/3]

```cpp theme={null}
void ansys::dpf::DataSources::addFile(
    std::string const & file_path,
    std::string const & key,
    std::string const & result_key
)
```

Add secondary, non-result, file with key and result key to data sources.

**Parameters**

| Direction | Name | Description |
| - | - | - |
| \[in] | file\_path | File to use with data source container. |
| \[in] | key | Key describing type of file. |
| \[in] | result\_key | [Result](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/classansys_1_1dpf_1_1Result.md) key for file. |

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

```cpp theme={null}
void ansys::dpf::DataSources::addResultFile(std::string const & file_path)
```

Define result for data sources.

**Parameters**

| Direction | Name | Description |
| - | - | - |
| \[in] | file\_path | [Result](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/classansys_1_1dpf_1_1Result.md) file to use with data source container. |

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

```cpp theme={null}
void ansys::dpf::DataSources::addResultFile(
    std::string const & file_path,
    std::string const & key
)
```

Define result file with key for data sources.

**Parameters**

| Direction | Name | Description |
| - | - | - |
| \[in] | file\_path | [Result](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/classansys_1_1dpf_1_1Result.md) file to use with data source container. |
| \[in] | key | Key describing type of file. |

**Examples**

[AveragingTest.cpp](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/AveragingTest_8cpp-example.md), [CompleteRST.cpp](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/CompleteRST_8cpp-example.md), [DataApis.cpp](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/DataApis_8cpp-example.md), [OperatorsApis.cpp](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/OperatorsApis_8cpp-example.md), [ResultTest.cpp](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/ResultTest_8cpp-example.md), and [WorkflowExamples.cpp](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/WorkflowExamples_8cpp-example.md).

### addResultFileWString()

```cpp theme={null}
void ansys::dpf::DataSources::addResultFileWString(std::wstring const & file_path)
```

Define result for data sources.

**Parameters**

| Direction | Name | Description |
| - | - | - |
| \[in] | file\_path | [Result](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/classansys_1_1dpf_1_1Result.md) file to use with data source container. |

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

```cpp theme={null}
void ansys::dpf::DataSources::addUpStream(DataSources & ds)
```

Add up stream to data sources.

**Parameters**

| Direction | Name | Description |
| - | - | - |
| \[in] | ds | Upstream data sources. |

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

```cpp theme={null}
void ansys::dpf::DataSources::addUpStream(
    DataSources & ds,
    std::string const & result_key
)
```

Add up stream with result key to data sources.

**Parameters**

| Direction | Name | Description |
| - | - | - |
| \[in] | ds | Upstream data sources. |
| \[in] | result\_key | [Result](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/classansys_1_1dpf_1_1Result.md) key for upstream source. |

### deep\_copy()

```cpp theme={null}
DataSources ansys::dpf::DataSources::deep_copy(
    ansys::dpf::Client const *const client = nullptr
) const
```

Create a new [DataSources](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/classansys_1_1dpf_1_1DataSources.md) on a server by copying all the data of this [DataSources](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/classansys_1_1dpf_1_1DataSources.md).

**Parameters**

| Direction | Name | Description |
| - | - | - |
| \[in] | client | [Client](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/classansys_1_1dpf_1_1Client.md) instance designating the IP, port and protocol to use. |

### emptyDataSources()

```cpp theme={null}
static DataSources ansys::dpf::DataSources::emptyDataSources()
```

`static`

Create an empty data sources.

**Returns**

Empty [DataSources](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/classansys_1_1dpf_1_1DataSources.md).

### filePaths()

```cpp theme={null}
std::vector< std::string > ansys::dpf::DataSources::filePaths(std::string const & key) const
```

**Returns**

Vector of secondary files given by key.

**Parameters**

| Direction | Name | Description |
| - | - | - |
| \[in] | key | Key describing file type. |

### identifierbyIndex()

```cpp theme={null}
LabelSpace ansys::dpf::DataSources::identifierbyIndex(int index) const
```

**Returns**

[LabelSpace](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/classansys_1_1dpf_1_1LabelSpace.md) or identifier of a path for a given index in data sources.

### keys()

```cpp theme={null}
std::vector< std::string > ansys::dpf::DataSources::keys() const
```

**Returns**

Vector of keys in data sources.

### numPaths()

```cpp theme={null}
int ansys::dpf::DataSources::numPaths() const
```

**Returns**

Size or Num file path in data sources.

**Examples**

[CompleteRST.cpp](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/CompleteRST_8cpp-example.md).

### pathAndKeyByIndex()

```cpp theme={null}
std::pair< std::string, std::string > ansys::dpf::DataSources::pathAndKeyByIndex(int index) const
```

**Returns**

File path and its key for a given index in data sources.

### pathAtKeyByIndex()

```cpp theme={null}
std::string ansys::dpf::DataSources::pathAtKeyByIndex(
    std::string const & key,
    dp_index index
) const
```

**Returns**

Path at given key and given index in data sources.

### resultFilePaths()

```cpp theme={null}
std::vector< std::string > ansys::dpf::DataSources::resultFilePaths() const
```

**Returns**

Vector of result files in data sources.

### resultKey()

```cpp theme={null}
std::string ansys::dpf::DataSources::resultKey() const
```

**Returns**

[Result](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/classansys_1_1dpf_1_1Result.md) key of data sources.

### resultNamespaceForKey()

```cpp theme={null}
std::string ansys::dpf::DataSources::resultNamespaceForKey(std::string const & key) const
```

**Returns**

[Result](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r2/classansys_1_1dpf_1_1Result.md) namespace to a given key of data sources.
