    

 ## On this page

  

 

 # DVS::IServer Class Reference

 Last update: 16.07.2025 

Interface class used to run a dynamic data server in a thread accepting incoming client connections. [More...](#details)

`#include <<a class="el" href="dvs__server__interface_8h_source.html">dvs_server_interface.h</a>>`

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

<a id="a54d47cdb16aa41fb6f101db7d88286bb" name="a54d47cdb16aa41fb6f101db7d88286bb"></a> **IServer** ()=default default   
 <a id="ad41fe7a344c5b6d1d37d71278bce012c" name="ad41fe7a344c5b6d1d37d71278bce012c"></a>virtual **~IServer** ()=default default   
 <a id="a1bfc7399b2562a0b219ae556708556da" name="a1bfc7399b2562a0b219ae556708556da"></a> **IServer** ([IServer](class_d_v_s_1_1_i_server.html) &amp;&amp;)=default default   
 <a id="aba394d20a8b4ee8a89e02550a0d88640" name="aba394d20a8b4ee8a89e02550a0d88640"></a>[IServer](class_d_v_s_1_1_i_server.html) &amp; **operator=** ([IServer](class_d_v_s_1_1_i_server.html) &amp;&amp;)=default default   
 <a id="a79d4ea86ffdb968a03c9b81aa3fc8612" name="a79d4ea86ffdb968a03c9b81aa3fc8612"></a> **IServer** (const [IServer](class_d_v_s_1_1_i_server.html) &amp;)=default support copying   
 <a id="a9910b6c51adf4489bc1bc8c86b9fabb3" name="a9910b6c51adf4489bc1bc8c86b9fabb3"></a>[IServer](class_d_v_s_1_1_i_server.html) &amp; **operator=** (const [IServer](class_d_v_s_1_1_i_server.html) &amp;)=default default   
 virtual void [set\_options](#a964b0420773ec5f47dbcea04334ba0d3) (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](group__group__dvs__server.html#dvs_server_options).   
 virtual void [set\_option](#a1edb4dec67086f10bc0329b6adf9084c) (const char \*key, const char \*value)=0 Set a specific option on the server, these are used during startup See See [Server Options](group__group__dvs__server.html#dvs_server_options).   
 <a id="acf90686fce61dd0bc59af6e411f7861b" name="acf90686fce61dd0bc59af6e411f7861b"></a>virtual void **clear\_options** ()=0 Clear all options from the server.   
 virtual bool [running](#a5fdee3f663dbe7b7dab11621f76737e2) () const =0 Check to see if the server is running.   
 virtual [dvs\_ret](dynamic__visualization__store__error__codes_8h.html#a1d7466ae72e89fe36cbf2408b4f7d9c1) [get\_timestep\_count](#a8a5339f222bcd46b06c2fa9a474b2c37) (uint32\_t &amp;num\_pending, uint32\_t &amp;num\_complete) const =0 return the current number of pending and complete timesteps in the server   
 virtual [dvs\_ret](dynamic__visualization__store__error__codes_8h.html#a1d7466ae72e89fe36cbf2408b4f7d9c1) [startup](#a6699cf48b29583ab3391b9b8397e611c) (uint32\_t server\_number, uint32\_t local\_ranks)=0 Start the server.   
 virtual [dvs\_ret](dynamic__visualization__store__error__codes_8h.html#a1d7466ae72e89fe36cbf2408b4f7d9c1) [startup\_unthreaded](#ac61ce2698eec1adb521bbbf60cb78756) (uint32\_t server\_number, uint32\_t local\_ranks)=0 Startup a server manually without threads.   
 virtual [dvs\_ret](dynamic__visualization__store__error__codes_8h.html#a1d7466ae72e89fe36cbf2408b4f7d9c1) [update](#add6fcb530763dc217f5b3c17b25093c0) ()=0 Perform a server update.   
 virtual [dvs\_ret](dynamic__visualization__store__error__codes_8h.html#a1d7466ae72e89fe36cbf2408b4f7d9c1) [terminating](#a6cb1f69ad4b9213dde48d4cd5b3f2111) ()=0 Call to begin terminating the server.   
 <a id="a7ce6bb49a2d383b0821267415a93802d" name="a7ce6bb49a2d383b0821267415a93802d"></a>virtual void **shutdown** ()=0 Shutdown the server, also called on server destruction by [DVS::DESTROY\_SERVER\_INSTANCE()](dvs__server__interface_8h.html#adcdcbab1954ec53631a7136af7fc49b8 "Destroy the server instance (also shutting it down if needed)")   
 virtual ITransport \* [create\_transport](#a68fca8531459488f5694507ad5df0482) (const std::string &amp;shared\_secret)=0 Create a transport object to communicate with server, must be destroyed.   
 virtual const char \* [get\_uri](#a087c3fed77651e0f62d7189f44a32443) ()=0 Get URI of this server.   
 virtual [DVS::IQuery](class_d_v_s_1_1_i_query.html) \* [create\_query](#aee25312f757c5bc4f6dd304dd7da68a9) (const std::string &amp;filter=std::string(), [DVS::IQuery](class_d_v_s_1_1_i_query.html) \*parent=nullptr)=0 Create a DVS query instance. This will inherit the DVS server reader instance.   
 <a id="details" name="details"></a>## Detailed Description

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

Usage:   
1.) Instantiate [DVS::IServer](class_d_v_s_1_1_i_server.html "Interface class used to run a dynamic data server in a thread accepting incoming client connections.") using [DVS::CREATE\_SERVER\_INSTANCE()](dvs__server__interface_8h.html#a852580b9a49ac305e4ae26ca637bcc75 "Create a DVS::IServer instance for clients to connect to.") method   
2.) Set options using [DVS::IServer::set\_options()](#a964b0420773ec5f47dbcea04334ba0d3 "Set a collection of options on the server. Overwrites previous options See. See Server Options.") or [DVS::IServer::set\_option()](#a1edb4dec67086f10bc0329b6adf9084c "Set a specific option on the server, these are used during startup See See Server Options.")   
3.) Startup server using [DVS::IServer::startup()](#a6699cf48b29583ab3391b9b8397e611c "Start the server.")   
4.) If needed see if it's running via [DVS::IServer::running()](#a5fdee3f663dbe7b7dab11621f76737e2 "Check to see if the server is running.")   
5.) Shutdown server using [DVS::IServer::shutdown()](#a7ce6bb49a2d383b0821267415a93802d "Shutdown the server, also called on server destruction by DVS::DESTROY_SERVER_INSTANCE()")   
6.) Destroy instance using [DVS::DESTROY\_SERVER\_INSTANCE()](dvs__server__interface_8h.html#adcdcbab1954ec53631a7136af7fc49b8 "Destroy the server instance (also shutting it down if needed)")

Definition at line [59](dvs__server__interface_8h_source.html#l00059) of file [dvs\_server\_interface.h](dvs__server__interface_8h_source.html).



## Member Function Documentation

<a id="aee25312f757c5bc4f6dd304dd7da68a9" name="aee25312f757c5bc4f6dd304dd7da68a9"></a>## [◆ ](#aee25312f757c5bc4f6dd304dd7da68a9)create\_query()

 virtual [DVS::IQuery](class_d_v_s_1_1_i_query.html) \* DVS::IServer::create\_query  ( const std::string &amp; *filter* = std::string(),    [DVS::IQuery](class_d_v_s_1_1_i_query.html) \* *parent* = nullptr )  pure virtual 

Create a DVS query instance. This will inherit the DVS server reader instance.

Parameters \[in\]parentAn eventual parent query to create the new query with. Defaults to nullptr \[in\]filterAn eventual filter string to apply to the new query. Defaults to the empty stringReturnsThe query instance created. 



<a id="a68fca8531459488f5694507ad5df0482" name="a68fca8531459488f5694507ad5df0482"></a>## [◆ ](#a68fca8531459488f5694507ad5df0482)create\_transport()

 virtual ITransport \* DVS::IServer::create\_transport  ( const std::string &amp; *shared\_secret*)   pure virtual 

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

Parameters shared\_secretThe transport protocol shared secret string used to validate connections. It may be an empty string. If "SERVER\_SECURITY\_SECRET" is set as a server option shared\_secret will be ignored. ReturnsITransport\* instance to transport object owned by Server instance 



<a id="a8a5339f222bcd46b06c2fa9a474b2c37" name="a8a5339f222bcd46b06c2fa9a474b2c37"></a>## [◆ ](#a8a5339f222bcd46b06c2fa9a474b2c37)get\_timestep\_count()

 virtual [dvs\_ret](dynamic__visualization__store__error__codes_8h.html#a1d7466ae72e89fe36cbf2408b4f7d9c1) DVS::IServer::get\_timestep\_count  ( uint32\_t &amp; *num\_pending*,    uint32\_t &amp; *num\_complete* ) const  pure virtual 

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

Simple count of the current state of the timesteps in the server

Parameters num\_pendingthe number of pending timesteps not complete yet num\_completenum\_complete the number of complete timesteps Returnsdvs\_ret DVS\_SERVER\_NOT\_STARTED or DVS\_NONE 



<a id="a087c3fed77651e0f62d7189f44a32443" name="a087c3fed77651e0f62d7189f44a32443"></a>## [◆ ](#a087c3fed77651e0f62d7189f44a32443)get\_uri()

 virtual const char \* DVS::IServer::get\_uri  ( )   pure virtual 

Get URI of this server.

ReturnsURI this server was created with 



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

 virtual bool DVS::IServer::running  ( )  const  pure virtual 

Check to see if the server is running.

Currently this is a dumb check to see if the server was tried to start. If port listening failed this will call will not fail currently.

Returnstrue if running/started 



<a id="a1edb4dec67086f10bc0329b6adf9084c" name="a1edb4dec67086f10bc0329b6adf9084c"></a>## [◆ ](#a1edb4dec67086f10bc0329b6adf9084c)set\_option()

 virtual void DVS::IServer::set\_option  ( const char \* *key*,    const char \* *value* )  pure virtual 

Set a specific option on the server, these are used during startup See See [Server Options](group__group__dvs__server.html#dvs_server_options).

Current available options:   
CACHE\_URI: This will set the location and type of cache to store data to.

Parameters keyName of option to set valueValue of option 



<a id="a964b0420773ec5f47dbcea04334ba0d3" name="a964b0420773ec5f47dbcea04334ba0d3"></a>## [◆ ](#a964b0420773ec5f47dbcea04334ba0d3)set\_options()

 virtual void DVS::IServer::set\_options  ( const std::map&lt; const char \*, const char \* &gt; &amp; *options*)   pure virtual 

Set a collection of options on the server. Overwrites previous options See. See [Server Options](group__group__dvs__server.html#dvs_server_options).

Parameters optionsoptions to set on the server, see [DVS::IServer::set\_option()](#a1edb4dec67086f10bc0329b6adf9084c "Set a specific option on the server, these are used during startup See See Server Options.") for options available 



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

 virtual [dvs\_ret](dynamic__visualization__store__error__codes_8h.html#a1d7466ae72e89fe36cbf2408b4f7d9c1) DVS::IServer::startup  ( uint32\_t *server\_number*,    uint32\_t *local\_ranks* )  pure virtual 

Start the server.

server\_number is used by the DVS server, for each group of servers this number should be unique and monotonically increasing with no gaps (valid: 0, 1, 2 invalid: 0, 2)

local\_ranks is used to determine how many clients will be connecting to this server

Parameters server\_numberThe server number (zero based) for this server, should be unique for each server in this server group local\_ranksNumber of local ranks this server will handle Returnsdvs\_ret DVS\_NONE on success, else error code 



<a id="ac61ce2698eec1adb521bbbf60cb78756" name="ac61ce2698eec1adb521bbbf60cb78756"></a>## [◆ ](#ac61ce2698eec1adb521bbbf60cb78756)startup\_unthreaded()

 virtual [dvs\_ret](dynamic__visualization__store__error__codes_8h.html#a1d7466ae72e89fe36cbf2408b4f7d9c1) DVS::IServer::startup\_unthreaded  ( uint32\_t *server\_number*,    uint32\_t *local\_ranks* )  pure virtual 

Startup a server manually without threads.

This method is for when a user wants to manually run their own server to more tightly control the execution and threading model. This call WILL block until the first timestep is received and will not return unless [terminating()](#a6cb1f69ad4b9213dde48d4cd5b3f2111 "Call to begin terminating the server.") has been called from another thread or interrupt.

server\_number is used by the DVS server, for each group of servers this number should be unique and monotonically increasing with no gaps (valid: 0, 1, 2 invalid: 0, 2)

local\_ranks is used to determine how many clients will be connecting to this server

The normal call chain would be to call [startup\_unthreaded()](#ac61ce2698eec1adb521bbbf60cb78756 "Startup a server manually without threads.") and then loop calling [update()](#add6fcb530763dc217f5b3c17b25093c0 "Perform a server update.") until some end condition is met. Please see [test\_dvs\_server.cpp](test__dvs__server_8cpp.html "Test server to provide example of create a simple server application.") for an example.

Parameters server\_numberThe server number (zero based) for this server, should be unique for each server in this server group local\_ranksNumber of local ranks this server will handle Returnsdvs\_ret DVS\_NONE on success, else error code 



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

 virtual [dvs\_ret](dynamic__visualization__store__error__codes_8h.html#a1d7466ae72e89fe36cbf2408b4f7d9c1) DVS::IServer::terminating  ( )   pure virtual 

Call to begin terminating the server.

This method begins terminating the server when [startup\_unthreaded()](#ac61ce2698eec1adb521bbbf60cb78756 "Startup a server manually without threads.") is invoked. This will cause new updates sending new timesteps, to fail and exit early from any waiting calls on the server.

Important: This call is not needed if using the normal startup method as it will handle this for you.

Returnsdvs\_ret DVS\_NONE on success, DVS\_SERVER\_FAILED\_READER\_CREATE if the server wasn't started 



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

 virtual [dvs\_ret](dynamic__visualization__store__error__codes_8h.html#a1d7466ae72e89fe36cbf2408b4f7d9c1) DVS::IServer::update  ( )   pure virtual 

Perform a server update.

This method performs a server update. This will: 1.) Perform a complete timestep check and flush complete timesteps to the cache 2.) Perform a check if any new delete\_item calls should be processed 3.) Perform a check to see if the dataset definition needs to be updated

The number of pending timesteps from [get\_timestep\_count()](#a8a5339f222bcd46b06c2fa9a474b2c37 "return the current number of pending and complete timesteps in the server") will not update unless this is called.

Important: This is not needed to be called if using the normal [startup()](#a6699cf48b29583ab3391b9b8397e611c "Start the server.") procedure and should only be used when manually running the server with startup\_unthreaded. This must be called periodically for the server to function properly.

Returnsdvs\_ret DVS\_NONE on success 



---

The documentation for this class was generated from the following file:- D:/ANSYSDev/Product-src/ensight/user\_defined\_src/readers/dvs/include/[dvs\_server\_interface.h](dvs__server__interface_8h_source.html)