Skip to main content

Post-processing tools 2025 R1

DVS::IServer Class Reference

Last update: 16.07.2025

#include <dvs_server_interface.h>

Public Member Functions

 IServer ()=default
 
virtual ~IServer ()=default
 
 IServer (IServer &&)=default
 
IServeroperator= (IServer &&)=default
 
 IServer (const IServer &)=default
 
IServeroperator= (const IServer &)=default
 
virtual void set_options (const std::map< const char *, const char * > &options)=0
 
virtual void set_option (const char *key, const char *value)=0
 
virtual void clear_options ()=0
 
virtual bool running () const =0
 
virtual dvs_ret get_timestep_count (uint32_t &num_pending, uint32_t &num_complete) const =0
 
virtual dvs_ret startup (uint32_t server_number, uint32_t local_ranks)=0
 
virtual dvs_ret startup_unthreaded (uint32_t server_number, uint32_t local_ranks)=0
 
virtual dvs_ret update ()=0
 
virtual dvs_ret terminating ()=0
 
virtual void shutdown ()=0
 
virtual ITransport * create_transport (const std::string &shared_secret)=0
 
virtual const char * get_uri ()=0
 
virtual DVS::IQuerycreate_query (const std::string &filter=std::string(), DVS::IQuery *parent=nullptr)=0
 

Detailed Description

Usage:
1.) Instantiate DVS::IServer using DVS::CREATE_SERVER_INSTANCE() method
2.) Set options using DVS::IServer::set_options() or DVS::IServer::set_option()
3.) Startup server using DVS::IServer::startup()
4.) If needed see if it's running via DVS::IServer::running()
5.) Shutdown server using DVS::IServer::shutdown()
6.) Destroy instance using DVS::DESTROY_SERVER_INSTANCE()

Definition at line 59 of file dvs_server_interface.h.

Member Function Documentation

◆ create_query()

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
[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 string
Returns
The query instance created.

◆ create_transport()

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
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.
Returns
ITransport* instance to transport object owned by Server instance

◆ get_timestep_count()

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
num_pendingthe number of pending timesteps not complete yet
num_completenum_complete the number of complete timesteps
Returns
dvs_ret DVS_SERVER_NOT_STARTED or DVS_NONE

◆ get_uri()

virtual const char * DVS::IServer::get_uri ( )
pure virtual

Get URI of this server.

Returns
URI this server was created with

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

Returns
true if running/started

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

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

◆ set_options()

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.

Parameters
optionsoptions to set on the server, see DVS::IServer::set_option() for options available

◆ startup()

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
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
Returns
dvs_ret DVS_NONE on success, else error code

◆ startup_unthreaded()

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() 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() and then loop calling update() until some end condition is met. Please see test_dvs_server.cpp 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
Returns
dvs_ret DVS_NONE on success, else error code

◆ terminating()

virtual dvs_ret DVS::IServer::terminating ( )
pure virtual

Call to begin terminating the server.

This method begins terminating the server when startup_unthreaded() 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()

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

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

Connect with Ansys