Skip to main content

DPF Cpp Client Library 2026 R1

Class ansys::dpf::LibraryHandle

Last update: 25.03.2026

Provides an access to use DPF HGP API. The instance of 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

Public functions

Function LibraryHandle

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 load_type = LoadType::try_load : [in] Enum that provides settings at API loading step.
  • std::string const & dpf_client_api = "DPFClientAPI"

Return type:

Function LibraryHandle

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 that defines specific settings.

Parameters:

  • Context const & context: [in] Context 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 load_type = LoadType::try_load : [in] Enum that provides settings at API loading step.
  • std::string const & dpf_client_api = "DPFClientAPI"

Return type:

Function LibraryHandle

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 that defines specific settings.

Parameters:

  • std::string const & path_to_shared_object: [in] path to DataProcessingCore.dll or libDataProcessingCore.so.
  • Context const & context: [in] Context 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 load_type = LoadType::try_load : [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

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 api_type
  • LoadType load_type = LoadType::try_load
  • std::string const & dpf_client_api = "DPFClientAPI"

Return type:

Function LibraryHandle

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

Parameters:

  • so::API * api

Return type:

Function LibraryHandle

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

Parameters:

  • const LibraryHandle &

Return type:

Function LibraryHandle

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

Parameters:

  • LibraryHandle &&

Return type:

Function ~LibraryHandle

ansys::dpf::LibraryHandle::~LibraryHandle()

Return type:

Function operator=

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

Parameters:

Return type: LibraryHandle &

Function operator=

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

Parameters:

Return type: LibraryHandle &

Function callAPI

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

Return type: so::API const *

Function error

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

Return type: ansys::dpf::DpfError const &

Function libraryDir

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

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

Return type: std::string

Connect with Ansys