> ## 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.

# Class DVS::IServer

![][C++]
![][public]

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

Usage: \

1.) Instantiate [DVS::IServer](#class-dvsiserver) using [DVS::CREATE\_SERVER\_INSTANCE()](https://developer.synopsys.com/docs/ensight/dynamic-visualization-store/reference/namespaces/namespace_d_v_s.md#dvs__server__interface_8h_1a852580b9a49ac305e4ae26ca637bcc75) method \

2.) Set options using [DVS::IServer::set\_options()](#class_d_v_s_1_1_i_server_1a964b0420773ec5f47dbcea04334ba0d3) or [DVS::IServer::set\_option()](#class_d_v_s_1_1_i_server_1a1edb4dec67086f10bc0329b6adf9084c) \

3.) Startup server using [DVS::IServer::startup()](#class_d_v_s_1_1_i_server_1a6699cf48b29583ab3391b9b8397e611c) \

4.) If needed see if it's running via [DVS::IServer::running()](#class_d_v_s_1_1_i_server_1a5fdee3f663dbe7b7dab11621f76737e2) \

5.) Shutdown server using [DVS::IServer::shutdown()](#class_d_v_s_1_1_i_server_1a7ce6bb49a2d383b0821267415a93802d) \

6.) Destroy instance using [DVS::DESTROY\_SERVER\_INSTANCE()](https://developer.synopsys.com/docs/ensight/dynamic-visualization-store/reference/namespaces/namespace_d_v_s.md#dvs__server__interface_8h_1adcdcbab1954ec53631a7136af7fc49b8) \


## Members

* [clear\_options](#class_d_v_s_1_1_i_server_1acf90686fce61dd0bc59af6e411f7861b)
* [create\_query](#class_d_v_s_1_1_i_server_1aee25312f757c5bc4f6dd304dd7da68a9)
* [create\_transport](#class_d_v_s_1_1_i_server_1a68fca8531459488f5694507ad5df0482)
* [get\_timestep\_count](#class_d_v_s_1_1_i_server_1a8a5339f222bcd46b06c2fa9a474b2c37)
* [get\_uri](#class_d_v_s_1_1_i_server_1a087c3fed77651e0f62d7189f44a32443)
* [IServer](#class_d_v_s_1_1_i_server_1a54d47cdb16aa41fb6f101db7d88286bb)
* [IServer](#class_d_v_s_1_1_i_server_1ad41fe7a344c5b6d1d37d71278bce012c)
* [IServer](#class_d_v_s_1_1_i_server_1a1bfc7399b2562a0b219ae556708556da)
* [operator=](#class_d_v_s_1_1_i_server_1aba394d20a8b4ee8a89e02550a0d88640)
* [operator=](#class_d_v_s_1_1_i_server_1a9910b6c51adf4489bc1bc8c86b9fabb3)
* [running](#class_d_v_s_1_1_i_server_1a5fdee3f663dbe7b7dab11621f76737e2)
* [set\_option](#class_d_v_s_1_1_i_server_1a1edb4dec67086f10bc0329b6adf9084c)
* [set\_options](#class_d_v_s_1_1_i_server_1a964b0420773ec5f47dbcea04334ba0d3)
* [shutdown](#class_d_v_s_1_1_i_server_1a7ce6bb49a2d383b0821267415a93802d)
* [startup](#class_d_v_s_1_1_i_server_1a6699cf48b29583ab3391b9b8397e611c)
* [startup\_unthreaded](#class_d_v_s_1_1_i_server_1ac61ce2698eec1adb521bbbf60cb78756)
* [terminating](#class_d_v_s_1_1_i_server_1a6cb1f69ad4b9213dde48d4cd5b3f2111)
* [update](#class_d_v_s_1_1_i_server_1add6fcb530763dc217f5b3c17b25093c0)
* [\~IServer](#class_d_v_s_1_1_i_server_1a54d47cdb16aa41fb6f101db7d88286bb)

## Public Functions

### Function IServer

![][public]

```cpp theme={null}
DVS::IServer::IServer()=default
```

Default

**Return type**:

### Function \~IServer

![][public]

```cpp theme={null}
virtual DVS::IServer::~IServer()=default
```

Default

**Return type**:

### Function IServer

![][public]

```cpp theme={null}
DVS::IServer::IServer(IServer &&)=default
```

Default

**Parameters**:

* IServer &&

**Return type**:

### Function operator=

![][public]

```cpp theme={null}
IServer & DVS::IServer::operator=(IServer &&)=default
```

Default

**Parameters**:

* [IServer](#class-dvsiserver) &&

**Return type**: [IServer](#class-dvsiserver) &

### Function IServer

![][public]

```cpp theme={null}
DVS::IServer::IServer(const IServer &)=default
```

Support Copying

**Parameters**:

* const IServer &

**Return type**:

### Function operator=

![][public]

```cpp theme={null}
IServer & DVS::IServer::operator=(const IServer &)=default
```

Default

**Parameters**:

* const [IServer](#class-dvsiserver) &

**Return type**: [IServer](#class-dvsiserver) &

### Function set\_options

![][public]

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

Set a Collection of Options on the Server. Overwrites Previous Options See. See [Server Options](https://developer.synopsys.com/docs/ensight/dynamic-visualization-store/user-guide/dvs-server.md#server-options).

**Parameters**:

* **options**: Options to Set on the Server, See [DVS::IServer::set\_option()](#class_d_v_s_1_1_i_server_1a1edb4dec67086f10bc0329b6adf9084c) for Options Available

**Parameters**:

* const std::map\< const char \*, const char \* > & **options**

**Return type**: void

### Function set\_option

![][public]

```cpp theme={null}
virtual void DVS::IServer::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](https://developer.synopsys.com/docs/ensight/dynamic-visualization-store/user-guide/dvs-server.md#server-options).

Current available options: \

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

**Parameters**:

* **key**: Name of Option to Set
* **value**: Value of Option

**Parameters**:

* const char \* **key**
* const char \* **value**

**Return type**: void

### Function clear\_options

![][public]

```cpp theme={null}
virtual void DVS::IServer::clear_options()=0
```

Clear All Options From the Server.

**Return type**: void

### Function running

![][public]
![][const]

```cpp theme={null}
virtual bool DVS::IServer::running() const =0
```

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

**Return type**: bool

### Function get\_timestep\_count

![][public]
![][const]

```cpp theme={null}
virtual dvs_ret DVS::IServer::get_timestep_count(uint32_t &num_pending, uint32_t &num_complete) const =0
```

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\_pending**: The Number of Pending Timesteps Not Complete Yet
* **num\_complete**: num\_complete the Number of Complete Timesteps

**Returns**:

[dvs\_ret](https://developer.synopsys.com/docs/ensight/dynamic-visualization-store/reference/files/dynamic__visualization__store__error__codes_8h.md#dynamic__visualization__store__error__codes_8h_1a1d7466ae72e89fe36cbf2408b4f7d9c1) DVS\_SERVER\_NOT\_STARTED or DVS\_NONE

**Parameters**:

* uint32\_t & **num\_pending**
* uint32\_t & **num\_complete**

**Return type**: [dvs\_ret](https://developer.synopsys.com/docs/ensight/dynamic-visualization-store/reference/files/dynamic__visualization__store__error__codes_8h.md#dynamic__visualization__store__error__codes_8h_1a1d7466ae72e89fe36cbf2408b4f7d9c1)

### Function startup

![][public]

```cpp theme={null}
virtual dvs_ret DVS::IServer::startup(uint32_t server_number, uint32_t local_ranks)=0
```

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\_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](https://developer.synopsys.com/docs/ensight/dynamic-visualization-store/reference/files/dynamic__visualization__store__error__codes_8h.md#dynamic__visualization__store__error__codes_8h_1a1d7466ae72e89fe36cbf2408b4f7d9c1) DVS\_NONE on success, else error code

**Parameters**:

* uint32\_t **server\_number**
* uint32\_t **local\_ranks**

**Return type**: [dvs\_ret](https://developer.synopsys.com/docs/ensight/dynamic-visualization-store/reference/files/dynamic__visualization__store__error__codes_8h.md#dynamic__visualization__store__error__codes_8h_1a1d7466ae72e89fe36cbf2408b4f7d9c1)

### Function startup\_unthreaded

![][public]

```cpp theme={null}
virtual dvs_ret DVS::IServer::startup_unthreaded(uint32_t server_number, uint32_t local_ranks)=0
```

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()](#class_d_v_s_1_1_i_server_1a6cb1f69ad4b9213dde48d4cd5b3f2111) 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()](#class_d_v_s_1_1_i_server_1ac61ce2698eec1adb521bbbf60cb78756) and then loop calling [update()](#class_d_v_s_1_1_i_server_1add6fcb530763dc217f5b3c17b25093c0) until some end condition is met. Please see [test\_dvs\_server.cpp](https://developer.synopsys.com/docs/ensight/dynamic-visualization-store/reference/files/test__dvs__server_8cpp.md) for an example.

**Parameters**:

* **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](https://developer.synopsys.com/docs/ensight/dynamic-visualization-store/reference/files/dynamic__visualization__store__error__codes_8h.md#dynamic__visualization__store__error__codes_8h_1a1d7466ae72e89fe36cbf2408b4f7d9c1) DVS\_NONE on success, else error code

**Parameters**:

* uint32\_t **server\_number**
* uint32\_t **local\_ranks**

**Return type**: [dvs\_ret](https://developer.synopsys.com/docs/ensight/dynamic-visualization-store/reference/files/dynamic__visualization__store__error__codes_8h.md#dynamic__visualization__store__error__codes_8h_1a1d7466ae72e89fe36cbf2408b4f7d9c1)

### Function update

![][public]

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

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()](#class_d_v_s_1_1_i_server_1a8a5339f222bcd46b06c2fa9a474b2c37) will not update unless this is called.

Important: This is not needed to be called if using the normal [startup()](#class_d_v_s_1_1_i_server_1a6699cf48b29583ab3391b9b8397e611c) 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](https://developer.synopsys.com/docs/ensight/dynamic-visualization-store/reference/files/dynamic__visualization__store__error__codes_8h.md#dynamic__visualization__store__error__codes_8h_1a1d7466ae72e89fe36cbf2408b4f7d9c1) DVS\_NONE on Success

**Return type**: [dvs\_ret](https://developer.synopsys.com/docs/ensight/dynamic-visualization-store/reference/files/dynamic__visualization__store__error__codes_8h.md#dynamic__visualization__store__error__codes_8h_1a1d7466ae72e89fe36cbf2408b4f7d9c1)

### Function terminating

![][public]

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

Call to Begin Terminating the Server.

This method begins terminating the server when [startup\_unthreaded()](#class_d_v_s_1_1_i_server_1ac61ce2698eec1adb521bbbf60cb78756) 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](https://developer.synopsys.com/docs/ensight/dynamic-visualization-store/reference/files/dynamic__visualization__store__error__codes_8h.md#dynamic__visualization__store__error__codes_8h_1a1d7466ae72e89fe36cbf2408b4f7d9c1) DVS\_NONE on Success, DVS\_SERVER\_FAILED\_READER\_CREATE if the Server Wasn't Started

**Return type**: [dvs\_ret](https://developer.synopsys.com/docs/ensight/dynamic-visualization-store/reference/files/dynamic__visualization__store__error__codes_8h.md#dynamic__visualization__store__error__codes_8h_1a1d7466ae72e89fe36cbf2408b4f7d9c1)

### Function shutdown

![][public]

```cpp theme={null}
virtual void DVS::IServer::shutdown()=0
```

Shutdown the Server, Also Called on Server Destruction by [DVS::DESTROY\_SERVER\_INSTANCE()](https://developer.synopsys.com/docs/ensight/dynamic-visualization-store/reference/namespaces/namespace_d_v_s.md#dvs__server__interface_8h_1adcdcbab1954ec53631a7136af7fc49b8).

**Return type**: void

### Function create\_transport

![][public]

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

Create a Transport Object to Communicate With Server, Must Be Destroyed.

**Parameters**:

* **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

**Parameters**:

* const std::string & **shared\_secret**

**Return type**: ITransport \*

### Function get\_uri

![][public]

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

Get URI of This Server.

**Returns**:

URI This Server Was Created With

**Return type**: const char \*

### Function create\_query

![][public]

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

Create a DVS Query Instance. This Will Inherit the DVS Server Reader Instance.

**Parameters**:

* **parent**: An Eventual Parent Query to Create the New Query With. Defaults to nullptr
* **filter**: An Eventual Filter String to Apply to the New Query. Defaults to the Empty String

**Returns**:

The Query Instance Created.

**Parameters**:

* const std::string & **filter** = std::string()
* [DVS::IQuery](https://developer.synopsys.com/docs/ensight/dynamic-visualization-store/reference/classes/class_d_v_s_1_1_i_query.md) \* **parent** = nullptr

**Return type**: [DVS::IQuery](https://developer.synopsys.com/docs/ensight/dynamic-visualization-store/reference/classes/class_d_v_s_1_1_i_query.md) \*

[public]: https://img.shields.io/badge/-public-brightgreen "public"

[C++]: https://img.shields.io/badge/language-C%2B%2B-blue "C++"

[protected]: https://img.shields.io/badge/-protected-yellow "protected"

[static]: https://img.shields.io/badge/-static-lightgrey "static"

[Python]: https://img.shields.io/badge/language-Python-blue "Python"

[private]: https://img.shields.io/badge/-private-red "private"

[const]: https://img.shields.io/badge/-const-lightblue "const"
