Skip to main content

EnSight 2025 R2

dvs_server_interface

Last update: 16.07.2025
Go to the documentation of this file.
1/* *************************************************************
2 * Copyright 2017-2025 ANSYS, Inc.
3 * All Rights Reserved.
4 *
5 * Restricted Rights Legend
6 *
7 * Use, duplication, or disclosure of this
8 * software and its documentation by the
9 * Government is subject to restrictions as
10 * set forth in subdivision [(b)(3)(ii)] of
11 * the Rights in Technical Data and Computer
12 * Software clause at 52.227-7013.
13 * *************************************************************
14 */
15
16#ifndef ___DVS_SERVER_INTERFACE___
17#define ___DVS_SERVER_INTERFACE___
18
36#include <map>
37#include <string>
38
39#include "dvs_query_interface.h"
40#include "transport_interface.h"
41#include "dvs_import_export.h"
42
43
44
45namespace DVS
46{
59 class IServer
60 {
61 public:
62
63 IServer() = default;
64 virtual ~IServer() = default;
65 IServer(IServer&&) = default;
66 IServer& operator=(IServer&&) = default;
67 IServer(const IServer&) = default;
68 IServer& operator=(const IServer&) = default;
69
76 virtual void set_options(const std::map<const char*,const char*>& options) = 0;
77
88 virtual void set_option(const char* key, const char* value) = 0;
89
94 virtual void clear_options() = 0;
95
103 virtual bool running() const = 0;
104
114 virtual dvs_ret get_timestep_count(uint32_t& num_pending, uint32_t& num_complete) const = 0;
115
128 virtual dvs_ret startup(uint32_t server_number, uint32_t local_ranks) = 0;
129
150 virtual dvs_ret startup_unthreaded(uint32_t server_number, uint32_t local_ranks) = 0;
151
169 virtual dvs_ret update() = 0;
170
183 virtual dvs_ret terminating() = 0;
184
189 virtual void shutdown() = 0;
190
197 virtual ITransport* create_transport(const std::string& shared_secret) = 0;
198
204 virtual const char* get_uri() = 0;
205
214 virtual DVS::IQuery* create_query(const std::string& filter=std::string(), DVS::IQuery* parent=nullptr) = 0;
215
216 };
217
227 DVS_DLL_EXPORT IServer* CREATE_SERVER_INSTANCE(const char* uri);
228
234 DVS_DLL_EXPORT void DESTROY_SERVER_INSTANCE(DVS::IServer* destroy);
235
236}
237
238#endif //___DVS_SERVER_INTERFACE___
The query interface for the DVS Reader API.
Interface class used to run a dynamic data server in a thread accepting incoming client connections.
virtual const char * get_uri()=0
Get URI of this server.
IServer(IServer &&)=default
default
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.
IServer()=default
default
virtual bool running() const =0
Check to see if the server is running.
virtual dvs_ret startup(uint32_t server_number, uint32_t local_ranks)=0
Start the server.
virtual ITransport * create_transport(const std::string &shared_secret)=0
Create a transport object to communicate with server, must be destroyed.
virtual dvs_ret terminating()=0
Call to begin terminating the server.
IServer(const IServer &)=default
support copying
virtual void shutdown()=0
Shutdown the server, also called on server destruction by DVS::DESTROY_SERVER_INSTANCE()
virtual dvs_ret 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
virtual void 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.
IServer & operator=(const IServer &)=default
default
IServer & operator=(IServer &&)=default
default
virtual dvs_ret startup_unthreaded(uint32_t server_number, uint32_t local_ranks)=0
Startup a server manually without threads.
virtual void clear_options()=0
Clear all options from the server.
virtual ~IServer()=default
default
virtual dvs_ret update()=0
Perform a server update.
virtual DVS::IQuery * 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.
DVS Reader API Query Interface.
DVS_DLL_EXPORT IServer * CREATE_SERVER_INSTANCE(const char *uri)
Create a DVS::IServer instance for clients to connect to.
DVS_DLL_EXPORT void DESTROY_SERVER_INSTANCE(DVS::IServer *destroy)
Destroy the server instance (also shutting it down if needed)
int32_t dvs_ret
Return value of methods, TODO.

Connect with Ansys