> ## Documentation Index
> Fetch the complete documentation index at: https://developer.synopsys.com/llms.txt
> Use this file to discover all available pages before exploring further.

# DVS::IServer Class Reference

`#include <dvs_server_interface.h>`

## Public Member Functions

| Type | Name |
| - | - |
| | **IServer** ()=default |
|  virtual | **\~IServer** ()=default |
| | **IServer** ([IServer](https://developer.synopsys.com/docs/ensight/ensight-apis/2025-r1/class_d_v_s_1_1_i_server.md) &&)=default |
| [IServer](https://developer.synopsys.com/docs/ensight/ensight-apis/2025-r1/class_d_v_s_1_1_i_server.md) & | **operator=** ([IServer](https://developer.synopsys.com/docs/ensight/ensight-apis/2025-r1/class_d_v_s_1_1_i_server.md) &&)=default |
| | **IServer** (const [IServer](https://developer.synopsys.com/docs/ensight/ensight-apis/2025-r1/class_d_v_s_1_1_i_server.md) &)=default |
| [IServer](https://developer.synopsys.com/docs/ensight/ensight-apis/2025-r1/class_d_v_s_1_1_i_server.md) & | **operator=** (const [IServer](https://developer.synopsys.com/docs/ensight/ensight-apis/2025-r1/class_d_v_s_1_1_i_server.md) &)=default |
| virtual void | [set\_options](#a964b0420773ec5f47dbcea04334ba0d3) (const std::map\< const char \*, const char \* > \&options)=0 |
| virtual void | [set\_option](#a1edb4dec67086f10bc0329b6adf9084c) (const char \*key, const char \*value)=0 |
|  virtual void | **clear\_options** ()=0 |
| virtual bool | [running](#a5fdee3f663dbe7b7dab11621f76737e2) () const =0 |
| virtual [dvs\_ret](https://developer.synopsys.com/docs/ensight/ensight-apis/2025-r1/dynamic__visualization__store__error__codes_8h#a1d7466ae72e89fe36cbf2408b4f7d9c1) | [get\_timestep\_count](#a8a5339f222bcd46b06c2fa9a474b2c37) (uint32\_t \&num\_pending, uint32\_t \&num\_complete) const =0 |
| virtual [dvs\_ret](https://developer.synopsys.com/docs/ensight/ensight-apis/2025-r1/dynamic__visualization__store__error__codes_8h#a1d7466ae72e89fe36cbf2408b4f7d9c1) | [startup](#a6699cf48b29583ab3391b9b8397e611c) (uint32\_t server\_number, uint32\_t local\_ranks)=0 |
| virtual [dvs\_ret](https://developer.synopsys.com/docs/ensight/ensight-apis/2025-r1/dynamic__visualization__store__error__codes_8h#a1d7466ae72e89fe36cbf2408b4f7d9c1) | [startup\_unthreaded](#ac61ce2698eec1adb521bbbf60cb78756) (uint32\_t server\_number, uint32\_t local\_ranks)=0 |
| virtual [dvs\_ret](https://developer.synopsys.com/docs/ensight/ensight-apis/2025-r1/dynamic__visualization__store__error__codes_8h#a1d7466ae72e89fe36cbf2408b4f7d9c1) | [update](#add6fcb530763dc217f5b3c17b25093c0) ()=0 |
| virtual [dvs\_ret](https://developer.synopsys.com/docs/ensight/ensight-apis/2025-r1/dynamic__visualization__store__error__codes_8h#a1d7466ae72e89fe36cbf2408b4f7d9c1) | [terminating](#a6cb1f69ad4b9213dde48d4cd5b3f2111) ()=0 |
|  virtual void | **shutdown** ()=0 |
| virtual ITransport \* | [create\_transport](#a68fca8531459488f5694507ad5df0482) (const std::string \&shared\_secret)=0 |
| virtual const char \* | [get\_uri](#a087c3fed77651e0f62d7189f44a32443) ()=0 |
| virtual [DVS::IQuery](https://developer.synopsys.com/docs/ensight/ensight-apis/2025-r1/class_d_v_s_1_1_i_query.md) \* | [create\_query](#aee25312f757c5bc4f6dd304dd7da68a9) (const std::string \&filter=std::string(), [DVS::IQuery](https://developer.synopsys.com/docs/ensight/ensight-apis/2025-r1/class_d_v_s_1_1_i_query.md) \*parent=nullptr)=0 |

## Detailed Description

Usage: \
&#x20;1.) Instantiate [DVS::IServer](https://developer.synopsys.com/docs/ensight/ensight-apis/2025-r1/class_d_v_s_1_1_i_server.md) using [DVS::CREATE\_SERVER\_INSTANCE()](https://developer.synopsys.com/docs/ensight/ensight-apis/2025-r1/dvs__server__interface_8h#a852580b9a49ac305e4ae26ca637bcc75) method \
&#x20;2.) Set options using [DVS::IServer::set\_options()](#a964b0420773ec5f47dbcea04334ba0d3) or [DVS::IServer::set\_option()](#a1edb4dec67086f10bc0329b6adf9084c) \
&#x20;3.) Startup server using [DVS::IServer::startup()](#a6699cf48b29583ab3391b9b8397e611c) \
&#x20;4.) If needed see if it's running via [DVS::IServer::running()](#a5fdee3f663dbe7b7dab11621f76737e2) \
&#x20;5.) Shutdown server using [DVS::IServer::shutdown()](#a7ce6bb49a2d383b0821267415a93802d) \
&#x20;6.) Destroy instance using [DVS::DESTROY\_SERVER\_INSTANCE()](https://developer.synopsys.com/docs/ensight/ensight-apis/2025-r1/dvs__server__interface_8h#adcdcbab1954ec53631a7136af7fc49b8) \


Definition at line [59](https://developer.synopsys.com/docs/ensight/ensight-apis/2025-r1/dvs__server__interface_8h_source.md) of file [dvs\_server\_interface.h](https://developer.synopsys.com/docs/ensight/ensight-apis/2025-r1/dvs__server__interface_8h_source.md).

## Member Function Documentation

### create\_query()

```cpp theme={null}
virtual DVS::IQuery * DVS::IServer::create_query(
    const std::string & filter = std::string(),
    DVS::IQuery * parent = nullptr
)
```

`pure virtual`

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

**Parameters**

| Direction | Name | Description |
| - | - | - |
| \[in] | parent | An eventual parent query to create the new query with. Defaults to nullptr |
| \[in] | filter | An eventual filter string to apply to the new query. Defaults to the empty string |

**Returns**

The query instance created.

### create\_transport()

```cpp theme={null}
virtual ITransport * DVS::IServer::create_transport(const std::string & shared_secret)
```

`pure virtual`

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

**Parameters**

| Name | Description |
| - | - |
| shared\_secret | The 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. |

**Returns**

ITransport\* instance to transport object owned by Server instance

### get\_timestep\_count()

```cpp theme={null}
virtual dvs_ret DVS::IServer::get_timestep_count(
    uint32_t & num_pending,
    uint32_t & 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**

| Name | Description |
| - | - |
| num\_pending | the number of pending timesteps not complete yet |
| num\_complete | num\_complete the number of complete timesteps |

**Returns**

dvs\_ret DVS\_SERVER\_NOT\_STARTED or DVS\_NONE

### get\_uri()

```cpp theme={null}
virtual const char * DVS::IServer::get_uri()
```

`pure virtual`

Get URI of this server.

**Returns**

URI this server was created with

### running()

```cpp theme={null}
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.

**Returns**

true if running/started

### set\_option()

```cpp theme={null}
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](https://developer.synopsys.com/docs/ensight/ensight-apis/2025-r1/group__group__dvs__server.md#dvs_server_options).

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

**Parameters**

| Name | Description |
| - | - |
| key | Name of option to set |
| value | Value of option |

### set\_options()

```cpp theme={null}
virtual void DVS::IServer::set_options(
    const std::map< const char *, const char * > & options
)
```

`pure virtual`

Set a collection of options on the server. Overwrites previous options See. See [Server Options](https://developer.synopsys.com/docs/ensight/ensight-apis/2025-r1/group__group__dvs__server.md#dvs_server_options).

**Parameters**

| Name | Description |
| - | - |
| options | options to set on the server, see [DVS::IServer::set\_option()](#a1edb4dec67086f10bc0329b6adf9084c) for options available |

### startup()

```cpp theme={null}
virtual dvs_ret 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**

| Name | Description |
| - | - |
| server\_number | The server number (zero based) for this server, should be unique for each server in this server group |
| local\_ranks | Number of local ranks this server will handle |

**Returns**

dvs\_ret DVS\_NONE on success, else error code

### startup\_unthreaded()

```cpp theme={null}
virtual dvs_ret 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) 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) and then loop calling [update()](#add6fcb530763dc217f5b3c17b25093c0) until some end condition is met. Please see [test\_dvs\_server.cpp](https://developer.synopsys.com/docs/ensight/ensight-apis/2025-r1/test__dvs__server_8cpp) for an example.

**Parameters**

| Name | Description |
| - | - |
| server\_number | The server number (zero based) for this server, should be unique for each server in this server group |
| local\_ranks | Number of local ranks this server will handle |

**Returns**

dvs\_ret DVS\_NONE on success, else error code

### terminating()

```cpp theme={null}
virtual dvs_ret DVS::IServer::terminating()
```

`pure virtual`

Call to begin terminating the server.

This method begins terminating the server when [startup\_unthreaded()](#ac61ce2698eec1adb521bbbf60cb78756) 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.

**Returns**

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

### update()

```cpp theme={null}
virtual dvs_ret 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) will not update unless this is called.

Important: This is not needed to be called if using the normal [startup()](#a6699cf48b29583ab3391b9b8397e611c) 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.

**Returns**

dvs\_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/[dvs\_server\_interface.h](https://developer.synopsys.com/docs/ensight/ensight-apis/2025-r1/dvs__server__interface_8h_source.md)
