> ## 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::LibraryHandle

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

Provides an access to use DPF HGP API. The instance of [LibraryHandle](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-libraryhandle.md) 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-1ad6ccabf051eb035f8c92d2a70915d1b5)
* [error](#classansys-dpf-libraryhandle-1a124c4f3f441f173c91e5db5f72697506)
* [libraryDir](#classansys-dpf-libraryhandle-1afe1ec06d81aa4f65d48803e6691aed46)
* [LibraryHandle](#classansys-dpf-libraryhandle-1ace7af23aabdd94273ddce1266a0f402d)
* [LibraryHandle](#classansys-dpf-libraryhandle-1a6015d31697c46deb75d7274fb5b0cf74)
* [LibraryHandle](#classansys-dpf-libraryhandle-1a22f10026b439d4e05a8d4917ca286961)
* [LibraryHandle](#classansys-dpf-libraryhandle-1a0651cd01e74e2cb90f320435bc7fc87a)
* [LibraryHandle](#classansys-dpf-libraryhandle-1af1ab8962e664dd53b7c4b47988443e7e)
* [LibraryHandle](#classansys-dpf-libraryhandle-1a385df64ee05cc735acdbd0d519f47fd0)
* [LibraryHandle](#classansys-dpf-libraryhandle-1a761736a0e5edc45659fb39edf4f25a4f)
* [operator=](#classansys-dpf-libraryhandle-1a960d04a287464cd7e4337c501b07e55f)
* [operator=](#classansys-dpf-libraryhandle-1ae6b4015fd07463703a5a61a8d99b19f8)
* [\~LibraryHandle](#classansys-dpf-libraryhandle-1a7a1cac9d869e155572c2e7279770694f)

## Public functions

### Function LibraryHandle

![][public]

```cpp theme={null}
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 & **key** = "common" : \[in] Key used to identify the API (e.g. common, remote...).
* std::string const & **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](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1ac4f1380f00170887891b5cf54d8c94b3) **load\_type** = [LoadType::try\_load](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1ac4f1380f00170887891b5cf54d8c94b3a6d450e9598ea0dffeaff74fbcccb116f) : \[in] Enum that provides settings at API loading step.
* std::string const & **dpf\_client\_api** = "DPFClientAPI"

**Return type**:

### Function LibraryHandle

![][public]

```cpp theme={null}
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](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-context.md) that defines specific settings.

**Parameters**:

* [Context](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-context.md) const & **context**: \[in] [Context](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-context.md) object that defines settings to load the DPF APIs.
* std::string const & **key** = "common" : \[in] Key used to identify the API (e.g. common, remote...).
* std::string const & **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](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1ac4f1380f00170887891b5cf54d8c94b3) **load\_type** = [LoadType::try\_load](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1ac4f1380f00170887891b5cf54d8c94b3a6d450e9598ea0dffeaff74fbcccb116f) : \[in] Enum that provides settings at API loading step.
* std::string const & **dpf\_client\_api** = "DPFClientAPI"

**Return type**:

### Function LibraryHandle

![][public]

```cpp theme={null}
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](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-context.md) that defines specific settings.

**Parameters**:

* std::string const & **path\_to\_shared\_object**: \[in] path to DataProcessingCore.dll or libDataProcessingCore.so.
* [Context](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-context.md) const & **context**: \[in] [Context](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-context.md) object that defines settings to load the DPF APIs.
* std::string const & **key** = "common" : \[in] Key used to identify the API (e.g. common, remote...).
* std::string const & **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](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1ac4f1380f00170887891b5cf54d8c94b3) **load\_type** = [LoadType::try\_load](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1ac4f1380f00170887891b5cf54d8c94b3a6d450e9598ea0dffeaff74fbcccb116f) : \[in] Enum that provides settings at API loading step.
* std::string const & **path\_to\_dpf\_client\_api** = "" : \[in] path to DPFClientAPI.dll or libDPFClientAPI.so, takes path\_to\_shared\_object by default.
* std::string const & **dpf\_client\_api** = "DPFClientAPI"

**Return type**:

### Function LibraryHandle

![][public]

```cpp theme={null}
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 & **key**
* std::string const & **shared\_object\_root\_name**
* [ApiType](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1a318ab16f856ec8d2ef6e13af94a6dc56) **api\_type**
* [LoadType](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1ac4f1380f00170887891b5cf54d8c94b3) **load\_type** = [LoadType::try\_load](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1ac4f1380f00170887891b5cf54d8c94b3a6d450e9598ea0dffeaff74fbcccb116f)
* std::string const & **dpf\_client\_api** = "DPFClientAPI"

**Return type**:

### Function LibraryHandle

![][public]

```cpp theme={null}
ansys::dpf::LibraryHandle::LibraryHandle(so::API *api)
```

**Parameters**:

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

**Return type**:

### Function LibraryHandle

![][public]

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

**Parameters**:

* const LibraryHandle &

**Return type**:

### Function LibraryHandle

![][public]

```cpp theme={null}
ansys::dpf::LibraryHandle::LibraryHandle(LibraryHandle &&)=delete
```

**Parameters**:

* LibraryHandle &&

**Return type**:

### Function \~LibraryHandle

![][public]

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

**Return type**:

### Function operator=

![][public]

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

**Parameters**:

* const [LibraryHandle](#classansys-dpf-libraryhandle-1ace7af23aabdd94273ddce1266a0f402d) &

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

### Function operator=

![][public]

```cpp theme={null}
LibraryHandle & ansys::dpf::LibraryHandle::operator=(LibraryHandle &&)=delete
```

**Parameters**:

* [LibraryHandle](#classansys-dpf-libraryhandle-1ace7af23aabdd94273ddce1266a0f402d) &&

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

### Function callAPI

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

```cpp theme={null}
so::API const  * ansys::dpf::LibraryHandle::callAPI() const
```

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

### Function error

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

```cpp theme={null}
ansys::dpf::DpfError const  & ansys::dpf::LibraryHandle::error() const
```

**Return type**: [ansys::dpf::DpfError](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-dpferror.md) const &

### Function libraryDir

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

```cpp theme={null}
std::string ansys::dpf::LibraryHandle::libraryDir() const
```

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

**Return type**: std::string

[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"
