    

 ## On this page

  

 

 # ansys::dpf::Session Class Reference

 Last update: 16.07.2025 

`#include <dpf_api.h>`

Inheritance diagram for ansys::dpf::Session:

 ![](/sites/default/files/migrate-content/dpf_cpp_client_library_2023_r2/classansys_1_1dpf_1_1Session.png)



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

 [Session](classansys_1_1dpf_1_1Session.xhtml#a35c8573a7a81b571b6856c75142921a5) ([Client](classansys_1_1dpf_1_1Client.xhtml) const \*const client) <a id="a4f2358b004b5e805e163dfcb46eac7ab" name="a4f2358b004b5e805e163dfcb46eac7ab"></a> **Session** ([Session](classansys_1_1dpf_1_1Session.xhtml) const &amp;) <a id="abd64f9adfdc41f1e304e0cc874f7bf1a" name="abd64f9adfdc41f1e304e0cc874f7bf1a"></a> **Session** ([Session](classansys_1_1dpf_1_1Session.xhtml) &amp;&amp;)=delete <a id="a4fbe681f5d623efaa51bca1ad73b5bfb" name="a4fbe681f5d623efaa51bca1ad73b5bfb"></a>[Session](classansys_1_1dpf_1_1Session.xhtml) &amp; **operator=** ([Session](classansys_1_1dpf_1_1Session.xhtml) const &amp;) <a id="af4c0f6c0a74d4c837ef94919eea9a7f1" name="af4c0f6c0a74d4c837ef94919eea9a7f1"></a>[Session](classansys_1_1dpf_1_1Session.xhtml) &amp; **operator=** ([Session](classansys_1_1dpf_1_1Session.xhtml) &amp;&amp;)=delete std::string [id](classansys_1_1dpf_1_1Session.xhtml#a4fdd43dbb146e6bef0e69fdc3f6b8ac8) () const void [add](classansys_1_1dpf_1_1Session.xhtml#a44217e8e1b859b6bbc3cd902597a441b) ([Workflow](classansys_1_1dpf_1_1Workflow.xhtml) &amp;wf, std::string const &amp;identifier) std::string [add](classansys_1_1dpf_1_1Session.xhtml#a1ca0f541376f2606d6a1d38d73b42095) ([Workflow](classansys_1_1dpf_1_1Workflow.xhtml) &amp;wf) [Workflow](classansys_1_1dpf_1_1Workflow.xhtml) [getWorkflow](classansys_1_1dpf_1_1Session.xhtml#a1eb04b4b9a1df351de2211ed4a9065f3) (std::string const &amp;identifier) [Workflow](classansys_1_1dpf_1_1Workflow.xhtml) [getWorkflowByIndex](classansys_1_1dpf_1_1Session.xhtml#a0c351a7e9deb14ef205168a8c2a14535) ([dp\_index](namespaceansys_1_1dpf.xhtml#a417548d1b705a9ba54ba9429afe68920) index) [dp\_int](namespaceansys_1_1dpf.xhtml#a60d181a1f9d29cc7cc38b25dac4401f0) [numberOfWorkflow](classansys_1_1dpf_1_1Session.xhtml#ae6197db1ac01a01c67f4f87955c2b849) () const <a id="abf5a4032d5b54f0b31d83279af643ecb" name="abf5a4032d5b54f0b31d83279af643ecb"></a>void **flushWorkflows** () void [addEventHandler](classansys_1_1dpf_1_1Session.xhtml#a9d2f09db50b3767c062100bfc0b67e2c) ([EventHandler](classansys_1_1dpf_1_1EventHandler.xhtml) &amp;event\_handler) ![-](/sites/default/files/migrate-content/dpf_cpp_client_library_2023_r2/closed.png) Public Member Functions inherited from [ansys::dpf::DpfTypes](classansys_1_1dpf_1_1DpfTypes.xhtml)virtual bool [empty](classansys_1_1dpf_1_1DpfTypes.xhtml#a39cd546c42518e2332be8f287db95459) () const virtual std::string [describe](classansys_1_1dpf_1_1DpfTypes.xhtml#a9977945710983bc03d2940fa007847b2) () const so::API const \* [callAPI](classansys_1_1dpf_1_1DpfTypes.xhtml#aea34d37e0c080126eff70db34bf46597) () const bool [isOnCommonAPI](classansys_1_1dpf_1_1DpfTypes.xhtml#a9f9789ff61cc9d400a2a344830706b73) () const bool [getClient](classansys_1_1dpf_1_1DpfTypes.xhtml#a968afd9daa0b0f13b65a2ac61369d73a) ([Client](classansys_1_1dpf_1_1Client.xhtml) &amp;client) const bool [hasBeenMovedLocally](classansys_1_1dpf_1_1DpfTypes.xhtml#a1a5634202c15404b6b24e8f50e51cb66) () const bool [isSameObject](classansys_1_1dpf_1_1DpfTypes.xhtml#aa64d5f8fcd7d85ad6ebf708494dbefd7) ([DpfTypes](classansys_1_1dpf_1_1DpfTypes.xhtml) const &amp;rhs) const <a id="details" name="details"></a>## Detailed Description

Define a DPF session.



## Constructor &amp; Destructor Documentation

<a id="a35c8573a7a81b571b6856c75142921a5" name="a35c8573a7a81b571b6856c75142921a5"></a>## [◆ ](#a35c8573a7a81b571b6856c75142921a5)Session()

 ansys::dpf::Session::Session  ( [Client](classansys_1_1dpf_1_1Client.xhtml) const \*const  *client*) 

Create a new [Session](classansys_1_1dpf_1_1Session.xhtml) on a server.

Parameters \[in\]client[Client](classansys_1_1dpf_1_1Client.xhtml) instance designating the IP, port and protocol to use. 



## Member Function Documentation

<a id="a1ca0f541376f2606d6a1d38d73b42095" name="a1ca0f541376f2606d6a1d38d73b42095"></a>## [◆ ](#a1ca0f541376f2606d6a1d38d73b42095)add() \[1/2\]

 std::string ansys::dpf::Session::add  ( [Workflow](classansys_1_1dpf_1_1Workflow.xhtml) &amp;  *wf*) 

Add workflow to session.

ReturnsIdentifier for workflow. Parameters \[in\]wf[Workflow](classansys_1_1dpf_1_1Workflow.xhtml "Group a set of connected operators in order to define a whole data treatment.") to add. 



<a id="a44217e8e1b859b6bbc3cd902597a441b" name="a44217e8e1b859b6bbc3cd902597a441b"></a>## [◆ ](#a44217e8e1b859b6bbc3cd902597a441b)add() \[2/2\]

 void ansys::dpf::Session::add  ( [Workflow](classansys_1_1dpf_1_1Workflow.xhtml) &amp;  *wf*,    std::string const &amp;  *identifier*   ) 

Add a workflow to session.

Parameters \[in\]wf[Workflow](classansys_1_1dpf_1_1Workflow.xhtml) to add. \[out\]identifierIdentifier for workflow. 



<a id="a9d2f09db50b3767c062100bfc0b67e2c" name="a9d2f09db50b3767c062100bfc0b67e2c"></a>## [◆ ](#a9d2f09db50b3767c062100bfc0b67e2c)addEventHandler()

 void ansys::dpf::Session::addEventHandler  ( [EventHandler](classansys_1_1dpf_1_1EventHandler.xhtml) &amp;  *event\_handler*) 

Add event handler to handle status of DPF session.

Parameters \[in\]event\_handlerHandler for session status. 



<a id="a1eb04b4b9a1df351de2211ed4a9065f3" name="a1eb04b4b9a1df351de2211ed4a9065f3"></a>## [◆ ](#a1eb04b4b9a1df351de2211ed4a9065f3)getWorkflow()

 [Workflow](classansys_1_1dpf_1_1Workflow.xhtml) ansys::dpf::Session::getWorkflow  ( std::string const &amp;  *identifier*) 

Returns[Workflow](classansys_1_1dpf_1_1Workflow.xhtml) given by identifier. Parameters \[in\]identifierIdentifier of workflow. 



<a id="a0c351a7e9deb14ef205168a8c2a14535" name="a0c351a7e9deb14ef205168a8c2a14535"></a>## [◆ ](#a0c351a7e9deb14ef205168a8c2a14535)getWorkflowByIndex()

 [Workflow](classansys_1_1dpf_1_1Workflow.xhtml) ansys::dpf::Session::getWorkflowByIndex  ( [dp\_index](namespaceansys_1_1dpf.xhtml#a417548d1b705a9ba54ba9429afe68920)  *index*) 

Returns[Workflow](classansys_1_1dpf_1_1Workflow.xhtml) given by index. Parameters \[in\]indexIndex of workflow. 



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

 std::string ansys::dpf::Session::id  ( )  const

ReturnsId of session. 



<a id="ae6197db1ac01a01c67f4f87955c2b849" name="ae6197db1ac01a01c67f4f87955c2b849"></a>## [◆ ](#ae6197db1ac01a01c67f4f87955c2b849)numberOfWorkflow()

 [dp\_int](namespaceansys_1_1dpf.xhtml#a60d181a1f9d29cc7cc38b25dac4401f0) ansys::dpf::Session::numberOfWorkflow  ( )  const

ReturnsNumber of workflows in session.