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

Provides an access to use DPF HGP API. The instance of [LibraryHandle](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1LibraryHandle.md) is only needed once.

`#include <dpf_api_base.h>`

## Public Member Functions

| Type | Name |
| - | - |
| | [LibraryHandle](#ace7af23aabdd94273ddce1266a0f402d) (std::string const \&key="common", std::string const \&shared\_object\_root\_name="DataProcessingCore", LoadType load\_type=[LoadType::try\_load](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/namespaceansys_1_1dpf#ac4f1380f00170887891b5cf54d8c94b3a6d450e9598ea0dffeaff74fbcccb116f), std::string const \&dpf\_client\_api="DPFClientAPI") |
| | [LibraryHandle](#a6015d31697c46deb75d7274fb5b0cf74) ([Context](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Context.md) const \&context, std::string const \&key="common", std::string const \&shared\_object\_root\_name="DataProcessingCore", LoadType load\_type=[LoadType::try\_load](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/namespaceansys_1_1dpf#ac4f1380f00170887891b5cf54d8c94b3a6d450e9598ea0dffeaff74fbcccb116f), std::string const \&dpf\_client\_api="DPFClientAPI") |
| | [LibraryHandle](#a22f10026b439d4e05a8d4917ca286961) (std::string const \&path\_to\_shared\_object, [Context](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Context.md) const \&context, std::string const \&key="common", std::string const \&shared\_object\_root\_name="DataProcessingCore", LoadType load\_type=[LoadType::try\_load](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/namespaceansys_1_1dpf#ac4f1380f00170887891b5cf54d8c94b3a6d450e9598ea0dffeaff74fbcccb116f), std::string const \&path\_to\_dpf\_client\_api="", std::string const \&dpf\_client\_api="DPFClientAPI") |
| | [LibraryHandle](#a0651cd01e74e2cb90f320435bc7fc87a) (std::string const \&key, std::string const \&shared\_object\_root\_name, [ApiType](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/namespaceansys_1_1dpf#a318ab16f856ec8d2ef6e13af94a6dc56) api\_type, [LoadType](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/namespaceansys_1_1dpf#ac4f1380f00170887891b5cf54d8c94b3) load\_type=[LoadType::try\_load](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/namespaceansys_1_1dpf#ac4f1380f00170887891b5cf54d8c94b3a6d450e9598ea0dffeaff74fbcccb116f), std::string const \&dpf\_client\_api="DPFClientAPI") |
| | **LibraryHandle** (so::API \*api) |
| | **LibraryHandle** (const [LibraryHandle](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1LibraryHandle.md) &)=delete |
| | **LibraryHandle** ([LibraryHandle](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1LibraryHandle.md) &&)=delete |
| [LibraryHandle](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1LibraryHandle.md) & | **operator=** (const [LibraryHandle](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1LibraryHandle.md) &)=delete |
| [LibraryHandle](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1LibraryHandle.md) & | **operator=** ([LibraryHandle](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1LibraryHandle.md) &&)=delete |
|  so::API const \* | **callAPI** () const |
| [ansys::dpf::DpfError](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1DpfError.md) const & | **error** () const |

## Detailed Description

Provides an access to use DPF HGP API. The instance of [LibraryHandle](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1LibraryHandle.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.

## Constructor & Destructor Documentation

### LibraryHandle() \[1/4]

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

| Direction | Name | Description |
| - | - | - |
| \[in] | key | Key used to identify the API (e.g. common, remote...). |
| \[in] | shared\_object\_root\_name | 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...). |
| \[in] | load\_type | Enum that provides settings at API loading step. |

### LibraryHandle() \[2/4]

```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/2025-r1/classansys_1_1dpf_1_1Context.md) that defines specific settings.

**Parameters**

| Direction | Name | Description |
| - | - | - |
| \[in] | context | [Context](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Context.md) object that defines settings to load the DPF APIs. |
| \[in] | key | Key used to identify the API (e.g. common, remote...). |
| \[in] | shared\_object\_root\_name | 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...). |
| \[in] | load\_type | Enum that provides settings at API loading step. |

### LibraryHandle() \[3/4]

```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/2025-r1/classansys_1_1dpf_1_1Context.md) that defines specific settings.

**Parameters**

| Direction | Name | Description |
| - | - | - |
| \[in] | path\_to\_shared\_object | path to DataProcessingCore.dll or libDataProcessingCore.so. |
| \[in] | context | [Context](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Context.md) object that defines settings to load the DPF APIs. |
| \[in] | key | Key used to identify the API (e.g. common, remote...). |
| \[in] | shared\_object\_root\_name | 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...). |
| \[in] | load\_type | Enum that provides settings at API loading step. |
| \[in] | path\_to\_dpf\_client\_api | path to DPFClientAPI.dll or libDPFClientAPI.so, takes path\_to\_shared\_object by default. |

### LibraryHandle() \[4/4]

```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"
)
```

> [!WARNING]
>
> ****[Deprecated:](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/deprecated#_deprecated000001)****
>
> This call is deprecated. usage is not maintained.
