    

 ## On this page

  

 

 # ansys::dpf::Context Class Reference

 Last update: 16.07.2025 

`#include <dpf_api_base.h>`

## <a id="pub-methods" name="pub-methods"></a>Public Member Functions

 [Context](classansys_1_1dpf_1_1Context.xhtml#ae26354fe1dea7b2691e115275704278b) ([EDpfContext](namespaceansys_1_1dpf.xhtml#a02d1b14b4a34eeae292e89f8ee7cfe60) context=EDpfContext::eDefault, std::string const &amp;setup\_file\_path="") [EDpfContext](namespaceansys_1_1dpf.xhtml#a02d1b14b4a34eeae292e89f8ee7cfe60) [getContext](classansys_1_1dpf_1_1Context.xhtml#af4b49f2ed79e09c7d20d59895d52c139) () const std::string const &amp; [getSetupFilePath](classansys_1_1dpf_1_1Context.xhtml#a8e69df73d5d7695a12619e98bb4ef82b) () const ## <a id="pub-static-methods" name="pub-static-methods"></a>Static Public Member Functions

static [Context](classansys_1_1dpf_1_1Context.xhtml) [entryContext](classansys_1_1dpf_1_1Context.xhtml#a30b9265329478de651ae53b753831bc4) () static [Context](classansys_1_1dpf_1_1Context.xhtml) [premiumContext](classansys_1_1dpf_1_1Context.xhtml#a8416bcd2b6a76249a97bf259851aa121) () <a id="details" name="details"></a>## Detailed Description

[Context](classansys_1_1dpf_1_1Context.xhtml) for [LibraryHandle](classansys_1_1dpf_1_1LibraryHandle.xhtml "Provides an access to use DPF HGP API. The instance of LibraryHandle is only needed once."). It defines the licensing logic DPF starts with.

See also[Using DPF Context](group__group__11.xhtml)

## Constructor &amp; Destructor Documentation

<a id="ae26354fe1dea7b2691e115275704278b" name="ae26354fe1dea7b2691e115275704278b"></a>## [◆ ](#ae26354fe1dea7b2691e115275704278b)Context()

 ansys::dpf::Context::Context  ( [EDpfContext](namespaceansys_1_1dpf.xhtml#a02d1b14b4a34eeae292e89f8ee7cfe60)  *context* = `EDpfContext::eDefault`,    std::string const &amp;  *setup\_file\_path* = `""`   ) 

Defines the settings that will be used to load DPF. A DPF xml file is used to define those settings.

Parameters \[in\]contextDefines setup to use. \[in\]setup\_file\_pathOptional path to a DPF xml file if using a custom defined location. 



## Member Function Documentation

<a id="a30b9265329478de651ae53b753831bc4" name="a30b9265329478de651ae53b753831bc4"></a>## [◆ ](#a30b9265329478de651ae53b753831bc4)entryContext()

 static [Context](classansys_1_1dpf_1_1Context.xhtml) ansys::dpf::Context::entryContext  ( )   static 

ReturnsEntry context instance that does not allow DPF to perform any license checkout, meaning that licensed DPF operators run will fail. See also[Using DPF Context](group__group__11.xhtml) 



<a id="af4b49f2ed79e09c7d20d59895d52c139" name="af4b49f2ed79e09c7d20d59895d52c139"></a>## [◆ ](#af4b49f2ed79e09c7d20d59895d52c139)getContext()

 [EDpfContext](namespaceansys_1_1dpf.xhtml#a02d1b14b4a34eeae292e89f8ee7cfe60) ansys::dpf::Context::getContext  ( )  const

ReturnsDPF context enum value. 



<a id="a8e69df73d5d7695a12619e98bb4ef82b" name="a8e69df73d5d7695a12619e98bb4ef82b"></a>## [◆ ](#a8e69df73d5d7695a12619e98bb4ef82b)getSetupFilePath()

 std::string const &amp; ansys::dpf::Context::getSetupFilePath  ( )  const

ReturnsDPF file path DPF has been started with, if specified. 



<a id="a8416bcd2b6a76249a97bf259851aa121" name="a8416bcd2b6a76249a97bf259851aa121"></a>## [◆ ](#a8416bcd2b6a76249a97bf259851aa121)premiumContext()

 static [Context](classansys_1_1dpf_1_1Context.xhtml) ansys::dpf::Context::premiumContext  ( )   static 

ReturnsPremium context instance that allows DPF to perform license checkouts, allowing licensed DPF operators to run. See also[Using DPF Context](group__group__11.xhtml)