    

 ## On this page

  

 

 # dvs\_server\_interface

 Last update: 16.07.2025 

[Go to the documentation of this file.](dvs__server__interface_8h.xhtml)<a id="l00001" name="l00001"></a> 1/\* \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

<a id="l00002" name="l00002"></a> 2 \* Copyright 2017-2023 ANSYS, Inc.

<a id="l00003" name="l00003"></a> 3 \* All Rights Reserved.

<a id="l00004" name="l00004"></a> 4 \*

<a id="l00005" name="l00005"></a> 5 \* Restricted Rights Legend

<a id="l00006" name="l00006"></a> 6 \*

<a id="l00007" name="l00007"></a> 7 \* Use, duplication, or disclosure of this

<a id="l00008" name="l00008"></a> 8 \* software and its documentation by the

<a id="l00009" name="l00009"></a> 9 \* Government is subject to restrictions as

<a id="l00010" name="l00010"></a> 10 \* set forth in subdivision \[(b)(3)(ii)\] of

<a id="l00011" name="l00011"></a> 11 \* the Rights in Technical Data and Computer

<a id="l00012" name="l00012"></a> 12 \* Software clause at 52.227-7013.

<a id="l00013" name="l00013"></a> 13 \* \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

<a id="l00014" name="l00014"></a> 14 \*/

<a id="l00015" name="l00015"></a> 15 

<a id="l00016" name="l00016"></a> 16\#ifndef \_\_\_DVS\_SERVER\_INTERFACE\_\_\_

<a id="l00017" name="l00017"></a> 17\#define \_\_\_DVS\_SERVER\_INTERFACE\_\_\_

<a id="l00018" name="l00018"></a> 18 

<a id="l00036" name="l00036"></a> 36\#include &lt;map&gt;

<a id="l00037" name="l00037"></a> 37\#include &lt;string&gt;

<a id="l00038" name="l00038"></a> 38 

<a id="l00039" name="l00039"></a> 39\#include "transport\_interface.h"

<a id="l00040" name="l00040"></a> 40\#include "include/dvs\_import\_export.h"

<a id="l00041" name="l00041"></a> 41 

<a id="l00042" name="l00042"></a> 42namespace DVS

<a id="l00043" name="l00043"></a> 43{

<a id="l00056" name="l00056"></a>[ 56](class_d_v_s_1_1_i_server.xhtml) class [IServer](class_d_v_s_1_1_i_server.xhtml)

<a id="l00057" name="l00057"></a> 57 {

<a id="l00058" name="l00058"></a> 58 public:

<a id="l00059" name="l00059"></a> 59 

<a id="l00060" name="l00060"></a>[ 60](class_d_v_s_1_1_i_server.xhtml#a54d47cdb16aa41fb6f101db7d88286bb) [IServer](class_d_v_s_1_1_i_server.xhtml#a54d47cdb16aa41fb6f101db7d88286bb)() = default; 

<a id="l00061" name="l00061"></a>[ 61](class_d_v_s_1_1_i_server.xhtml#ad41fe7a344c5b6d1d37d71278bce012c) virtual [~IServer](class_d_v_s_1_1_i_server.xhtml#ad41fe7a344c5b6d1d37d71278bce012c)() = default; 

<a id="l00062" name="l00062"></a>[ 62](class_d_v_s_1_1_i_server.xhtml#a1bfc7399b2562a0b219ae556708556da) [IServer](class_d_v_s_1_1_i_server.xhtml#a1bfc7399b2562a0b219ae556708556da)([IServer](class_d_v_s_1_1_i_server.xhtml)&amp;&amp;) = default; 

<a id="l00063" name="l00063"></a>[ 63](class_d_v_s_1_1_i_server.xhtml#aba394d20a8b4ee8a89e02550a0d88640) [IServer](class_d_v_s_1_1_i_server.xhtml)&amp; [operator=](class_d_v_s_1_1_i_server.xhtml#aba394d20a8b4ee8a89e02550a0d88640)([IServer](class_d_v_s_1_1_i_server.xhtml)&amp;&amp;) = default; 

<a id="l00064" name="l00064"></a>[ 64](class_d_v_s_1_1_i_server.xhtml#a79d4ea86ffdb968a03c9b81aa3fc8612) [IServer](class_d_v_s_1_1_i_server.xhtml#a79d4ea86ffdb968a03c9b81aa3fc8612)(const [IServer](class_d_v_s_1_1_i_server.xhtml)&amp;) = default; 

<a id="l00065" name="l00065"></a>[ 65](class_d_v_s_1_1_i_server.xhtml#a9910b6c51adf4489bc1bc8c86b9fabb3) [IServer](class_d_v_s_1_1_i_server.xhtml)&amp; [operator=](class_d_v_s_1_1_i_server.xhtml#a9910b6c51adf4489bc1bc8c86b9fabb3)(const [IServer](class_d_v_s_1_1_i_server.xhtml)&amp;) = default; 

<a id="l00066" name="l00066"></a> 66 

<a id="l00073" name="l00073"></a>[ 73](class_d_v_s_1_1_i_server.xhtml#a964b0420773ec5f47dbcea04334ba0d3) virtual void [set\_options](class_d_v_s_1_1_i_server.xhtml#a964b0420773ec5f47dbcea04334ba0d3)(const std::map&lt;const char*,const char*&gt;&amp; options) = 0;

<a id="l00074" name="l00074"></a> 74 

<a id="l00085" name="l00085"></a>[ 85](class_d_v_s_1_1_i_server.xhtml#a1edb4dec67086f10bc0329b6adf9084c) virtual void [set\_option](class_d_v_s_1_1_i_server.xhtml#a1edb4dec67086f10bc0329b6adf9084c)(const char* key, const char* value) = 0;

<a id="l00086" name="l00086"></a> 86 

<a id="l00091" name="l00091"></a>[ 91](class_d_v_s_1_1_i_server.xhtml#acf90686fce61dd0bc59af6e411f7861b) virtual void [clear\_options](class_d_v_s_1_1_i_server.xhtml#acf90686fce61dd0bc59af6e411f7861b)() = 0;

<a id="l00092" name="l00092"></a> 92 

<a id="l00100" name="l00100"></a>[ 100](class_d_v_s_1_1_i_server.xhtml#a5fdee3f663dbe7b7dab11621f76737e2) virtual bool [running](class_d_v_s_1_1_i_server.xhtml#a5fdee3f663dbe7b7dab11621f76737e2)() const = 0;

<a id="l00101" name="l00101"></a> 101 

<a id="l00111" name="l00111"></a>[ 111](class_d_v_s_1_1_i_server.xhtml#a8a5339f222bcd46b06c2fa9a474b2c37) virtual [dvs\_ret](dynamic__visualization__store__error__codes_8h.xhtml#a1d7466ae72e89fe36cbf2408b4f7d9c1) [get\_timestep\_count](class_d_v_s_1_1_i_server.xhtml#a8a5339f222bcd46b06c2fa9a474b2c37)(uint32_t&amp; num_pending, uint32_t&amp; num_complete) const = 0;

<a id="l00112" name="l00112"></a> 112 

<a id="l00125" name="l00125"></a>[ 125](class_d_v_s_1_1_i_server.xhtml#a6699cf48b29583ab3391b9b8397e611c) virtual [dvs\_ret](dynamic__visualization__store__error__codes_8h.xhtml#a1d7466ae72e89fe36cbf2408b4f7d9c1) [startup](class_d_v_s_1_1_i_server.xhtml#a6699cf48b29583ab3391b9b8397e611c)(uint32_t server_number, uint32_t local_ranks) = 0;

<a id="l00126" name="l00126"></a> 126 

<a id="l00147" name="l00147"></a>[ 147](class_d_v_s_1_1_i_server.xhtml#ac61ce2698eec1adb521bbbf60cb78756) virtual [dvs\_ret](dynamic__visualization__store__error__codes_8h.xhtml#a1d7466ae72e89fe36cbf2408b4f7d9c1) [startup\_unthreaded](class_d_v_s_1_1_i_server.xhtml#ac61ce2698eec1adb521bbbf60cb78756)(uint32_t server_number, uint32_t local_ranks) = 0;

<a id="l00148" name="l00148"></a> 148 

<a id="l00166" name="l00166"></a>[ 166](class_d_v_s_1_1_i_server.xhtml#add6fcb530763dc217f5b3c17b25093c0) virtual [dvs\_ret](dynamic__visualization__store__error__codes_8h.xhtml#a1d7466ae72e89fe36cbf2408b4f7d9c1) [update](class_d_v_s_1_1_i_server.xhtml#add6fcb530763dc217f5b3c17b25093c0)() = 0;

<a id="l00167" name="l00167"></a> 167 

<a id="l00180" name="l00180"></a>[ 180](class_d_v_s_1_1_i_server.xhtml#a6cb1f69ad4b9213dde48d4cd5b3f2111) virtual [dvs\_ret](dynamic__visualization__store__error__codes_8h.xhtml#a1d7466ae72e89fe36cbf2408b4f7d9c1) [terminating](class_d_v_s_1_1_i_server.xhtml#a6cb1f69ad4b9213dde48d4cd5b3f2111)() = 0;

<a id="l00181" name="l00181"></a> 181 

<a id="l00186" name="l00186"></a>[ 186](class_d_v_s_1_1_i_server.xhtml#a7ce6bb49a2d383b0821267415a93802d) virtual void [shutdown](class_d_v_s_1_1_i_server.xhtml#a7ce6bb49a2d383b0821267415a93802d)() = 0;

<a id="l00187" name="l00187"></a> 187 

<a id="l00194" name="l00194"></a>[ 194](class_d_v_s_1_1_i_server.xhtml#a68fca8531459488f5694507ad5df0482) virtual ITransport* [create\_transport](class_d_v_s_1_1_i_server.xhtml#a68fca8531459488f5694507ad5df0482)(const std::string&amp; shared_secret) = 0;

<a id="l00195" name="l00195"></a> 195 

<a id="l00201" name="l00201"></a>[ 201](class_d_v_s_1_1_i_server.xhtml#a087c3fed77651e0f62d7189f44a32443) virtual const char* [get\_uri](class_d_v_s_1_1_i_server.xhtml#a087c3fed77651e0f62d7189f44a32443)() = 0;

<a id="l00202" name="l00202"></a> 202 

<a id="l00203" name="l00203"></a> 203 };

<a id="l00204" name="l00204"></a> 204 

<a id="l00214" name="l00214"></a>[ 214](dvs__server__interface_8h.xhtml#a852580b9a49ac305e4ae26ca637bcc75) DVS_DLL_EXPORT [IServer](class_d_v_s_1_1_i_server.xhtml)* [CREATE\_SERVER\_INSTANCE](dvs__server__interface_8h.xhtml#a852580b9a49ac305e4ae26ca637bcc75)(const char* uri);

<a id="l00215" name="l00215"></a> 215 

<a id="l00221" name="l00221"></a>[ 221](dvs__server__interface_8h.xhtml#adcdcbab1954ec53631a7136af7fc49b8) DVS_DLL_EXPORT void [DESTROY\_SERVER\_INSTANCE](dvs__server__interface_8h.xhtml#adcdcbab1954ec53631a7136af7fc49b8)([DVS::IServer](class_d_v_s_1_1_i_server.xhtml)* destroy);

<a id="l00222" name="l00222"></a> 222 

<a id="l00223" name="l00223"></a> 223}

<a id="l00224" name="l00224"></a> 224 

<a id="l00225" name="l00225"></a> 225\#endif //\_\_\_DVS\_SERVER\_INTERFACE\_\_\_

[DVS::IServer](class_d_v_s_1_1_i_server.xhtml)

Interface class used to run a dynamic data server in a thread accepting incoming client connections.

**Definition:** [dvs\_server\_interface.h:57](dvs__server__interface_8h_source.xhtml#l00056)



[DVS::IServer::get\_uri](class_d_v_s_1_1_i_server.xhtml#a087c3fed77651e0f62d7189f44a32443)

virtual const char * get_uri()=0

Get URI of this server.



[DVS::IServer::IServer](class_d_v_s_1_1_i_server.xhtml#a1bfc7399b2562a0b219ae556708556da)

IServer(IServer &amp;&amp;)=default

default



[DVS::IServer::set\_option](class_d_v_s_1_1_i_server.xhtml#a1edb4dec67086f10bc0329b6adf9084c)

virtual void set_option(const char *key, const char *value)=0

Set a specific option on the server, these are used during startup See See Server Options.



[DVS::IServer::IServer](class_d_v_s_1_1_i_server.xhtml#a54d47cdb16aa41fb6f101db7d88286bb)

IServer()=default

default



[DVS::IServer::running](class_d_v_s_1_1_i_server.xhtml#a5fdee3f663dbe7b7dab11621f76737e2)

virtual bool running() const =0

Check to see if the server is running.



[DVS::IServer::startup](class_d_v_s_1_1_i_server.xhtml#a6699cf48b29583ab3391b9b8397e611c)

virtual dvs_ret startup(uint32_t server_number, uint32_t local_ranks)=0

Start the server.



[DVS::IServer::create\_transport](class_d_v_s_1_1_i_server.xhtml#a68fca8531459488f5694507ad5df0482)

virtual ITransport * create_transport(const std::string &amp;shared_secret)=0

Create a transport object to communicate with server, must be destroyed.



[DVS::IServer::terminating](class_d_v_s_1_1_i_server.xhtml#a6cb1f69ad4b9213dde48d4cd5b3f2111)

virtual dvs_ret terminating()=0

Call to begin terminating the server.



[DVS::IServer::IServer](class_d_v_s_1_1_i_server.xhtml#a79d4ea86ffdb968a03c9b81aa3fc8612)

IServer(const IServer &amp;)=default

support copying



[DVS::IServer::shutdown](class_d_v_s_1_1_i_server.xhtml#a7ce6bb49a2d383b0821267415a93802d)

virtual void shutdown()=0

Shutdown the server, also called on server destruction by DVS::DESTROY_SERVER_INSTANCE()



[DVS::IServer::get\_timestep\_count](class_d_v_s_1_1_i_server.xhtml#a8a5339f222bcd46b06c2fa9a474b2c37)

virtual dvs_ret get_timestep_count(uint32_t &amp;num_pending, uint32_t &amp;num_complete) const =0

return the current number of pending and complete timesteps in the server



[DVS::IServer::set\_options](class_d_v_s_1_1_i_server.xhtml#a964b0420773ec5f47dbcea04334ba0d3)

virtual void set_options(const std::map&lt; const char *, const char * &gt; &amp;options)=0

Set a collection of options on the server. Overwrites previous options See. See Server Options.



[DVS::IServer::operator=](class_d_v_s_1_1_i_server.xhtml#a9910b6c51adf4489bc1bc8c86b9fabb3)

IServer &amp; operator=(const IServer &amp;)=default

default



[DVS::IServer::operator=](class_d_v_s_1_1_i_server.xhtml#aba394d20a8b4ee8a89e02550a0d88640)

IServer &amp; operator=(IServer &amp;&amp;)=default

default



[DVS::IServer::startup\_unthreaded](class_d_v_s_1_1_i_server.xhtml#ac61ce2698eec1adb521bbbf60cb78756)

virtual dvs_ret startup_unthreaded(uint32_t server_number, uint32_t local_ranks)=0

Startup a server manually without threads.



[DVS::IServer::clear\_options](class_d_v_s_1_1_i_server.xhtml#acf90686fce61dd0bc59af6e411f7861b)

virtual void clear_options()=0

Clear all options from the server.



[DVS::IServer::~IServer](class_d_v_s_1_1_i_server.xhtml#ad41fe7a344c5b6d1d37d71278bce012c)

virtual ~IServer()=default

default



[DVS::IServer::update](class_d_v_s_1_1_i_server.xhtml#add6fcb530763dc217f5b3c17b25093c0)

virtual dvs_ret update()=0

Perform a server update.



[DVS::CREATE\_SERVER\_INSTANCE](dvs__server__interface_8h.xhtml#a852580b9a49ac305e4ae26ca637bcc75)

DVS_DLL_EXPORT IServer * CREATE_SERVER_INSTANCE(const char *uri)

Create a DVS::IServer instance for clients to connect to.



[DVS::DESTROY\_SERVER\_INSTANCE](dvs__server__interface_8h.xhtml#adcdcbab1954ec53631a7136af7fc49b8)

DVS_DLL_EXPORT void DESTROY_SERVER_INSTANCE(DVS::IServer *destroy)

Destroy the server instance (also shutting it down if needed)



[dvs\_ret](dynamic__visualization__store__error__codes_8h.xhtml#a1d7466ae72e89fe36cbf2408b4f7d9c1)

int32_t dvs_ret

Return value of methods, TODO.

**Definition:** [dynamic\_visualization\_store\_error\_codes.h:32](dynamic__visualization__store__error__codes_8h_source.xhtml#l00032)