    

 ## On this page

  

 

 # Class ansys::dpf::LibraryHandle

 Last update: 25.03.2026 

<a id="classansys-dpf-libraryhandle"></a>

![](https://img.shields.io/badge/language-C%2B%2B-blue "C++")![](https://img.shields.io/badge/-public-brightgreen "public")

Provides an access to use DPF HGP API. The instance of [LibraryHandle](classansys-dpf-libraryhandle.md#classansys-dpf-libraryhandle) is only needed once.

Wraps dataProcessingCore loading in an RAII (Resource acquisition is initialization) structure in order to ensure correct loading/unloading of the DPF core functionalities. Must be the first call made to DPF API.

## Members

- [callAPI](classansys-dpf-libraryhandle.md#classansys-dpf-libraryhandle-1ad6ccabf051eb035f8c92d2a70915d1b5)
- [error](classansys-dpf-libraryhandle.md#classansys-dpf-libraryhandle-1a124c4f3f441f173c91e5db5f72697506)
- [libraryDir](classansys-dpf-libraryhandle.md#classansys-dpf-libraryhandle-1afe1ec06d81aa4f65d48803e6691aed46)
- [LibraryHandle](classansys-dpf-libraryhandle.md#classansys-dpf-libraryhandle-1ace7af23aabdd94273ddce1266a0f402d)
- [LibraryHandle](classansys-dpf-libraryhandle.md#classansys-dpf-libraryhandle-1a6015d31697c46deb75d7274fb5b0cf74)
- [LibraryHandle](classansys-dpf-libraryhandle.md#classansys-dpf-libraryhandle-1a22f10026b439d4e05a8d4917ca286961)
- [LibraryHandle](classansys-dpf-libraryhandle.md#classansys-dpf-libraryhandle-1a0651cd01e74e2cb90f320435bc7fc87a)
- [LibraryHandle](classansys-dpf-libraryhandle.md#classansys-dpf-libraryhandle-1af1ab8962e664dd53b7c4b47988443e7e)
- [LibraryHandle](classansys-dpf-libraryhandle.md#classansys-dpf-libraryhandle-1a385df64ee05cc735acdbd0d519f47fd0)
- [LibraryHandle](classansys-dpf-libraryhandle.md#classansys-dpf-libraryhandle-1a761736a0e5edc45659fb39edf4f25a4f)
- [operator=](classansys-dpf-libraryhandle.md#classansys-dpf-libraryhandle-1a960d04a287464cd7e4337c501b07e55f)
- [operator=](classansys-dpf-libraryhandle.md#classansys-dpf-libraryhandle-1ae6b4015fd07463703a5a61a8d99b19f8)
- [~LibraryHandle](classansys-dpf-libraryhandle.md#classansys-dpf-libraryhandle-1a7a1cac9d869e155572c2e7279770694f)

## Public functions

<a id="classansys-dpf-libraryhandle-1ace7af23aabdd94273ddce1266a0f402d"></a>

### Function LibraryHandle

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

```cpp
ansys::dpf::LibraryHandle::LibraryHandle(std::string const &key="common", std::string const &shared_object_root_name="DataProcessingCore", LoadType load_type=LoadType::try_load, std::string const &dpf_client_api="DPFClientAPI")

```

Must be the first call made to DPF API.

**Parameters**:

- std::string const &amp; **key** = "common" : \[in\] Key used to identify the API (e.g. common, remote...).
- std::string const &amp; **shared\_object\_root\_name** = "DataProcessingCore" : \[in\] Library name of the DPF API to load (e.g. DataProcessingCore that implements the core DPF symbols, Ans.Dpf.GrpcClient that implements the remote gRPC DPF symbols...).
- [LoadType](namespaceansys-dpf.md#namespaceansys-dpf-1ac4f1380f00170887891b5cf54d8c94b3) **load\_type** = [LoadType::try\_load](namespaceansys-dpf.md#namespaceansys-dpf-1ac4f1380f00170887891b5cf54d8c94b3a6d450e9598ea0dffeaff74fbcccb116f) : \[in\] Enum that provides settings at API loading step.
- std::string const &amp; **dpf\_client\_api** = "DPFClientAPI"

**Return type**:

<a id="classansys-dpf-libraryhandle-1a6015d31697c46deb75d7274fb5b0cf74"></a>

### Function LibraryHandle

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

```cpp
ansys::dpf::LibraryHandle::LibraryHandle(Context const &context, std::string const &key="common", std::string const &shared_object_root_name="DataProcessingCore", LoadType load_type=LoadType::try_load, std::string const &dpf_client_api="DPFClientAPI")

```

Must be the first call made to DPF API. Using a [Context](classansys-dpf-context.md#classansys-dpf-context) that defines specific settings.

**Parameters**:

- [Context](classansys-dpf-context.md#classansys-dpf-context) const &amp; **context**: \[in\] [Context](classansys-dpf-context.md#classansys-dpf-context) object that defines settings to load the DPF APIs.
- std::string const &amp; **key** = "common" : \[in\] Key used to identify the API (e.g. common, remote...).
- std::string const &amp; **shared\_object\_root\_name** = "DataProcessingCore" : \[in\] Library name of the DPF API to load (e.g. DataProcessingCore that implements the core DPF symbols, Ans.Dpf.GrpcClient that implements the remote gRPC DPF symbols...).
- [LoadType](namespaceansys-dpf.md#namespaceansys-dpf-1ac4f1380f00170887891b5cf54d8c94b3) **load\_type** = [LoadType::try\_load](namespaceansys-dpf.md#namespaceansys-dpf-1ac4f1380f00170887891b5cf54d8c94b3a6d450e9598ea0dffeaff74fbcccb116f) : \[in\] Enum that provides settings at API loading step.
- std::string const &amp; **dpf\_client\_api** = "DPFClientAPI"

**Return type**:

<a id="classansys-dpf-libraryhandle-1a22f10026b439d4e05a8d4917ca286961"></a>

### Function LibraryHandle

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

```cpp
ansys::dpf::LibraryHandle::LibraryHandle(std::string const &path_to_shared_object, Context const &context, std::string const &key="common", std::string const &shared_object_root_name="DataProcessingCore", LoadType load_type=LoadType::try_load, std::string const &path_to_dpf_client_api="", std::string const &dpf_client_api="DPFClientAPI")

```

Must be the first call made to DPF API. Using a [Context](classansys-dpf-context.md#classansys-dpf-context) that defines specific settings.

**Parameters**:

- std::string const &amp; **path\_to\_shared\_object**: \[in\] path to DataProcessingCore.dll or libDataProcessingCore.so.
- [Context](classansys-dpf-context.md#classansys-dpf-context) const &amp; **context**: \[in\] [Context](classansys-dpf-context.md#classansys-dpf-context) object that defines settings to load the DPF APIs.
- std::string const &amp; **key** = "common" : \[in\] Key used to identify the API (e.g. common, remote...).
- std::string const &amp; **shared\_object\_root\_name** = "DataProcessingCore" : \[in\] Library name of the DPF API to load (e.g. DataProcessingCore that implements the core DPF symbols, Ans.Dpf.GrpcClient that implements the remote gRPC DPF symbols...).
- [LoadType](namespaceansys-dpf.md#namespaceansys-dpf-1ac4f1380f00170887891b5cf54d8c94b3) **load\_type** = [LoadType::try\_load](namespaceansys-dpf.md#namespaceansys-dpf-1ac4f1380f00170887891b5cf54d8c94b3a6d450e9598ea0dffeaff74fbcccb116f) : \[in\] Enum that provides settings at API loading step.
- std::string const &amp; **path\_to\_dpf\_client\_api** = "" : \[in\] path to DPFClientAPI.dll or libDPFClientAPI.so, takes path\_to\_shared\_object by default.
- std::string const &amp; **dpf\_client\_api** = "DPFClientAPI"

**Return type**:

<a id="classansys-dpf-libraryhandle-1a0651cd01e74e2cb90f320435bc7fc87a"></a>

### Function LibraryHandle

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

```cpp
ansys::dpf::LibraryHandle::LibraryHandle(std::string const &key, std::string const &shared_object_root_name, ApiType api_type, LoadType load_type=LoadType::try_load, std::string const &dpf_client_api="DPFClientAPI")

```

**Deprecated**:

This call is deprecated. usage is not maintained.

**Parameters**:

- std::string const &amp; **key**
- std::string const &amp; **shared\_object\_root\_name**
- [ApiType](namespaceansys-dpf.md#namespaceansys-dpf-1a318ab16f856ec8d2ef6e13af94a6dc56) **api\_type**
- [LoadType](namespaceansys-dpf.md#namespaceansys-dpf-1ac4f1380f00170887891b5cf54d8c94b3) **load\_type** = [LoadType::try\_load](namespaceansys-dpf.md#namespaceansys-dpf-1ac4f1380f00170887891b5cf54d8c94b3a6d450e9598ea0dffeaff74fbcccb116f)
- std::string const &amp; **dpf\_client\_api** = "DPFClientAPI"

**Return type**:

<a id="classansys-dpf-libraryhandle-1af1ab8962e664dd53b7c4b47988443e7e"></a>

### Function LibraryHandle

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

```cpp
ansys::dpf::LibraryHandle::LibraryHandle(so::API *api)

```

**Parameters**:

- so::API \* **api**

**Return type**:

<a id="classansys-dpf-libraryhandle-1a385df64ee05cc735acdbd0d519f47fd0"></a>

### Function LibraryHandle

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

```cpp
ansys::dpf::LibraryHandle::LibraryHandle(const LibraryHandle &)=delete

```

**Parameters**:

- const LibraryHandle &amp;

**Return type**:

<a id="classansys-dpf-libraryhandle-1a761736a0e5edc45659fb39edf4f25a4f"></a>

### Function LibraryHandle

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

```cpp
ansys::dpf::LibraryHandle::LibraryHandle(LibraryHandle &&)=delete

```

**Parameters**:

- LibraryHandle &amp;&amp;

**Return type**:

<a id="classansys-dpf-libraryhandle-1a7a1cac9d869e155572c2e7279770694f"></a>

### Function ~LibraryHandle

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

```cpp
ansys::dpf::LibraryHandle::~LibraryHandle()

```

**Return type**:

<a id="classansys-dpf-libraryhandle-1a960d04a287464cd7e4337c501b07e55f"></a>

### Function operator=

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

```cpp
LibraryHandle & ansys::dpf::LibraryHandle::operator=(const LibraryHandle &)=delete

```

**Parameters**:

- const [LibraryHandle](classansys-dpf-libraryhandle.md#classansys-dpf-libraryhandle-1ace7af23aabdd94273ddce1266a0f402d) &amp;

**Return type**: [LibraryHandle](classansys-dpf-libraryhandle.md#classansys-dpf-libraryhandle-1ace7af23aabdd94273ddce1266a0f402d) &amp;

<a id="classansys-dpf-libraryhandle-1ae6b4015fd07463703a5a61a8d99b19f8"></a>

### Function operator=

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

```cpp
LibraryHandle & ansys::dpf::LibraryHandle::operator=(LibraryHandle &&)=delete

```

**Parameters**:

- [LibraryHandle](classansys-dpf-libraryhandle.md#classansys-dpf-libraryhandle-1ace7af23aabdd94273ddce1266a0f402d) &amp;&amp;

**Return type**: [LibraryHandle](classansys-dpf-libraryhandle.md#classansys-dpf-libraryhandle-1ace7af23aabdd94273ddce1266a0f402d) &amp;

<a id="classansys-dpf-libraryhandle-1ad6ccabf051eb035f8c92d2a70915d1b5"></a>

### Function callAPI

![](https://img.shields.io/badge/-public-brightgreen "public")![](https://img.shields.io/badge/-const-lightblue "const")

```cpp
so::API const  * ansys::dpf::LibraryHandle::callAPI() const

```

**Return type**: so::API const \*

<a id="classansys-dpf-libraryhandle-1a124c4f3f441f173c91e5db5f72697506"></a>

### Function error

![](https://img.shields.io/badge/-public-brightgreen "public")![](https://img.shields.io/badge/-const-lightblue "const")

```cpp
ansys::dpf::DpfError const  & ansys::dpf::LibraryHandle::error() const

```

**Return type**: [ansys::dpf::DpfError](classansys-dpf-dpferror.md#classansys-dpf-dpferror) const &amp;

<a id="classansys-dpf-libraryhandle-1afe1ec06d81aa4f65d48803e6691aed46"></a>

### Function libraryDir

![](https://img.shields.io/badge/-public-brightgreen "public")![](https://img.shields.io/badge/-const-lightblue "const")

```cpp
std::string ansys::dpf::LibraryHandle::libraryDir() const

```

Return the path to the directory where the library is loaded.

**Return type**: std::string