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

# Class ansys::dpf::DataSources

![][C++]
![][public]

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

**Inherits from**:

* [ansys::dpf::DpfTypes](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-dpftypes.md)

## Members

* [addDomainFile](#classansys-dpf-datasources-1a997a716f9f6a33e05480f9965be17364)
* [addDomainResultFile](#classansys-dpf-datasources-1a84323382bc1f6d128bb86e6c3f15c4b0)
* [addFile](#classansys-dpf-datasources-1ad8d20dc94dee694a62fce66e91691090)
* [addFile](#classansys-dpf-datasources-1a51a3d8501269698d90ebf54dc0049d2a)
* [addFile](#classansys-dpf-datasources-1a166f58480abfc46773763764419eaf4c)
* [addResultFile](#classansys-dpf-datasources-1ad2a5bb6f24ca621ffaaee9e7a47cdc20)
* [addResultFile](#classansys-dpf-datasources-1a596a92f17851f672d0572a404def4f2d)
* [addResultFileWString](#classansys-dpf-datasources-1a8480115f09431641ad94e5088629ea10)
* [addUpStream](#classansys-dpf-datasources-1a45df078c3f76993557f10d9528bd1484)
* [addUpStream](#classansys-dpf-datasources-1a34b2782ba0ecc1469787399af5c645c9)
* [callAPI](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-dpftypes.md#classansys-dpf-dpftypes-1aea34d37e0c080126eff70db34bf46597)
* [DataSources](#classansys-dpf-datasources-1ad0322bbcce3526b0a5cfb7b74a4e5578)
* [DataSources](#classansys-dpf-datasources-1a6428071b5158de19e283481087220d4c)
* [DataSources](#classansys-dpf-datasources-1aa03af46c3f99a1f27aac744b1fc9db1a)
* [DataSources](#classansys-dpf-datasources-1a1685cb861c0112d06c9be089013cf553)
* [DataSources](#classansys-dpf-datasources-1af3684cac83ff9a5e91bde6f3d421fed6)
* [DataSources](#classansys-dpf-datasources-1a2124e3800c560dc2b676b5ceeecac6d2)
* [DataSources](#classansys-dpf-datasources-1ab607a7dd632e40f18baa9bdc44631011)
* [DataSources](#classansys-dpf-datasources-1a85e10756d54a7164a7c47fde17426ce8)
* [DataSources](#classansys-dpf-datasources-1a187861f11263eda7b619c769b5ff83a5)
* [deep\_copy](#classansys-dpf-datasources-1a98fc4cd5c063eef368734854b30b63c2)
* [describe](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-dpftypes.md#classansys-dpf-dpftypes-1a9977945710983bc03d2940fa007847b2)
* [empty](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-dpftypes.md#classansys-dpf-dpftypes-1a39cd546c42518e2332be8f287db95459)
* [emptyDataSources](#classansys-dpf-datasources-1a014bb2c064ff1dce21325a012a57a4c8)
* [filePaths](#classansys-dpf-datasources-1ab406fd24d91af8256c82faee8d962c17)
* [getClient](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-dpftypes.md#classansys-dpf-dpftypes-1a968afd9daa0b0f13b65a2ac61369d73a)
* [getHash](#classansys-dpf-datasources-1a27af11a7f6a10abb4ce707e338065420)
* [getHashableKey](#classansys-dpf-datasources-1a5847c55b3f521ae84f106f3413888a95)
* [hasBeenMovedLocally](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-dpftypes.md#classansys-dpf-dpftypes-1a1a5634202c15404b6b24e8f50e51cb66)
* [hasInternalObject](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-dpftypes.md#classansys-dpf-dpftypes-1ae198f89868d85c7db6dc1a934a1d3c15)
* [identifierbyIndex](#classansys-dpf-datasources-1a8803654ff5e770591c1c866271f436f6)
* [isOnCommonAPI](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-dpftypes.md#classansys-dpf-dpftypes-1a9f9789ff61cc9d400a2a344830706b73)
* [isSameObject](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-dpftypes.md#classansys-dpf-dpftypes-1aa64d5f8fcd7d85ad6ebf708494dbefd7)
* [keys](#classansys-dpf-datasources-1a80afd0dab2f06de1b37097e89ef96e63)
* [numPaths](#classansys-dpf-datasources-1a74a2a6b4aacae91be09048a58c601d1b)
* [operator=](#classansys-dpf-datasources-1a1d22445fd9d22b9a7adc4853d9c31386)
* [operator=](#classansys-dpf-datasources-1a9c18012971ddaaf102576c92fb76814d)
* [pathAndKeyByIndex](#classansys-dpf-datasources-1a3232c71d54216a688008e590ac8f892d)
* [pathAtKeyByIndex](#classansys-dpf-datasources-1af9f900d56ea58cec07e7d04151c2208a)
* [registerNamespace](#classansys-dpf-datasources-1a3e58ea69bbb8b0e13f2368885f490a9d)
* [resultFilePaths](#classansys-dpf-datasources-1a4c0974ee4d72e7d7d2d5051796cf7de2)
* [resultKey](#classansys-dpf-datasources-1a7320cf9a8d0850e64fc8d337ee666178)
* [resultNamespaceForKey](#classansys-dpf-datasources-1adfa425b1477b6ebe977f11097b9fb7c9)
* [setHashableKey](#classansys-dpf-datasources-1a97dfdec6f9ba966084790215b8eb682e)
* [\~DataSources](#classansys-dpf-datasources-1aed25d8728c9a1a337adeb8131ef473ba)
* [\~DpfTypes](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-dpftypes.md#classansys-dpf-dpftypes-1ab7c83b6ea160c2b115e056f6c312112f)

## Friends

## Public functions

### Function DataSources

![][public]

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

**Return type**:

### Function DataSources

![][public]

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

Create a file container on a server.

**Parameters**:

* [Client](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-client.md) const \*const **client**: \[in] [Client](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-client.md) instance designating the IP, port and protocol to use.

**Return type**:

### Function \~DataSources

![][public]

```cpp theme={null}
virtual ansys::dpf::DataSources::~DataSources()
```

**Return type**:

### Function DataSources

![][public]

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

**Parameters**:

* DataSources const &

**Return type**:

### Function DataSources

![][public]

```cpp theme={null}
ansys::dpf::DataSources::DataSources(DataSources &&) noexcept
```

**Parameters**:

* DataSources &&

**Return type**:

### Function DataSources

![][public]

```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**:

* std::string const & **result\_file\_path**: \[in] [Result](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-result.md) file with which to create data source container.
* std::string const & **key**: \[in] Key describing type of file.

**Return type**:

### Function DataSources

![][public]

```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**:

* std::string const & **result\_file\_path**: \[in] [Result](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-result.md) file with which to create data source container.
* std::string const & **key**: \[in] Key describing type of file.
* [Client](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-client.md) const \*const **client**: \[in] [Client](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-client.md) instance designating the IP, port and protocol to use.

**Return type**:

### Function DataSources

![][public]

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

Create a file container with given file.

**Parameters**:

* std::string const & **result\_file\_path**: \[in] [Result](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-result.md) file with which to create data source container.

**Return type**:

### Function DataSources

![][public]

```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**:

* std::string const & **result\_file\_path**: \[in] [Result](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-result.md) file with which to create data source container.
* [Client](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-client.md) const \*const **client**

**Return type**:

### Function DataSources

![][public]

```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/api-reference/classansys-dpf-datasources.md) on a server.

**Parameters**:

* int **id**: \[in] Id of the [DataSources](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-datasources.md) object on the server's database.
* [Client](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-client.md) const \*const **client**: \[in] [Client](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-client.md) instance designating the IP, port and protocol to use.

**Return type**:

### Function operator=

![][public]

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

**Parameters**:

* DataSources const &

**Return type**: DataSources &

### Function operator=

![][public]

```cpp theme={null}
DataSources & ansys::dpf::DataSources::operator=(DataSources &&) noexcept
```

**Parameters**:

* DataSources &&

**Return type**: DataSources &

### Function addResultFile

![][public]

```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**:

* std::string const & **file\_path**: \[in] [Result](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-result.md) file to use with data source container.
* std::string const & **key**: \[in] Key describing type of file.

**Return type**: void

### Function addResultFileWString

![][public]

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

Define result for data sources.

**Parameters**:

* std::wstring const & **file\_path**: \[in] [Result](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-result.md) file to use with data source container.

**Return type**: void

### Function addResultFile

![][public]

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

Define result for data sources.

**Parameters**:

* std::string const & **file\_path**: \[in] [Result](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-result.md) file to use with data source container.

**Return type**: void

### Function addDomainResultFile

![][public]

```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**:

* std::string const & **file\_path**: \[in] [Result](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-result.md) file to use with data source container.
* std::string const & **key**: \[in] Key describing type of file.
* [dp\_int](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1a60d181a1f9d29cc7cc38b25dac4401f0) **domain\_id**: \[in] Domain id of file.

**Return type**: void

### Function addFile

![][public]

```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**:

* std::string const & **file\_path**: \[in] File to use with data source container.
* std::string const & **key**: \[in] Key describing type of file.

**Return type**: void

### Function addFile

![][public]

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

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

**Parameters**:

* std::string const & **file\_path**: \[in] File to use with data source container.

**Return type**: void

### Function addFile

![][public]

```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**:

* std::string const & **file\_path**: \[in] File to use with data source container.
* std::string const & **key**: \[in] Key describing type of file.
* std::string const & **result\_key**: \[in] [Result](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-result.md) key for file.

**Return type**: void

### Function addDomainFile

![][public]

```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**:

* std::string const & **file\_path**: \[in] File to use with data source container.
* std::string const & **key**: \[in] Key describing type of file.
* [dp\_int](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1a60d181a1f9d29cc7cc38b25dac4401f0) **domain\_id**: \[in] Domain id of file.

**Return type**: void

### Function addUpStream

![][public]

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

Add up stream to data sources.

**Parameters**:

* DataSources & **ds**: \[in] Upstream data sources.

**Return type**: void

### Function addUpStream

![][public]

```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**:

* DataSources & **ds**: \[in] Upstream data sources.
* std::string const & **result\_key**: \[in] [Result](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-result.md) key for upstream source.

**Return type**: void

### Function resultKey

![][public]
![][const]

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

**Returns**:

[Result](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-result.md) key of data sources.

**Return type**: std::string

### Function resultNamespaceForKey

![][public]
![][const]

```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/api-reference/classansys-dpf-result.md) namespace to a given key of data sources.

**Parameters**:

* std::string const & **key**

**Return type**: std::string

### Function filePaths

![][public]
![][const]

```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**:

* std::string const & **key**: \[in] Key describing file type.

**Return type**: std::vector\< std::string >

### Function resultFilePaths

![][public]
![][const]

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

**Returns**:

Vector of result files in data sources.

**Return type**: std::vector\< std::string >

### Function keys

![][public]
![][const]

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

**Returns**:

Vector of keys in data sources.

**Return type**: std::vector\< std::string >

### Function numPaths

![][public]
![][const]

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

**Returns**:

Size or Num file path in data sources.

**Return type**: int

### Function pathAtKeyByIndex

![][public]
![][const]

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

**Parameters**:

* std::string const & **key**
* [dp\_index](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1a417548d1b705a9ba54ba9429afe68920) **index**

**Return type**: std::string

### Function pathAndKeyByIndex

![][public]
![][const]

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

**Parameters**:

* int **index**

**Return type**: std::pair\< std::string, std::string >

### Function identifierbyIndex

![][public]
![][const]

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

**Returns**:

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

**Parameters**:

* int **index**

**Return type**: [LabelSpace](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-labelspace.md)

### Function deep\_copy

![][public]
![][const]

```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/api-reference/classansys-dpf-datasources.md) on a server by copying all the data of this [DataSources](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-datasources.md).

**Parameters**:

* [ansys::dpf::Client](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-client.md) const \*const **client** = nullptr : \[in] [Client](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-client.md) instance designating the IP, port and protocol to use.

**Return type**: DataSources

### Function getHashableKey

![][public]
![][const]

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

Set and get an simpler hashable entity (here a file path) instead of the full [DataSources](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-datasources.md) to save time

**Return type**: std::string

### Function setHashableKey

![][public]
![][const]

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

**Parameters**:

* const std::string & **unique\_identifier**

**Return type**: void

### Function getHash

![][public]
![][const]

```cpp theme={null}
size_t ansys::dpf::DataSources::getHash() const
```

Compute and get the hash of a data\_sources

**Return type**: size\_t

### Function registerNamespace

![][public]

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

**Parameters**:

* std::string const & **result\_key**
* std::string const & **namspace**

**Return type**: void

## Public static functions

### Function emptyDataSources

![][public]
![][static]

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

Create an empty data sources.
**Returns**:

Empty [DataSources](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-datasources.md).

**Return type**: DataSources

[C++]: https://img.shields.io/badge/language-C%2B%2B-blue "C++"

[const]: https://img.shields.io/badge/-const-lightblue "const"

[public]: https://img.shields.io/badge/-public-brightgreen "public"

[static]: https://img.shields.io/badge/-static-lightgrey "static"
