neuray API Programmer's Manual

mi::bridge::IBridge_server Class Reference

[Bridge server]

Description

API component that serves as entry point for the server-side Bridge API. Can be used to create Bridge application and a context to import or remove snapshots.

Public Member Functions

virtual Sint32 calculate_hash( neuraylib::​ITransaction* transaction, const char* element, IString* o_hash, Size* o_size) =0
Returns the hash and serialized size for the provided element. More...
virtual IApplicationcreate_application( const char* application_path, http::​IServer* http_server) =0
Creates a Bridge application. More...
virtual IBridge_snapshot_contextcreate_snapshot_context( const char* disk_cache) =0
Creates a snapshot context for importing or deleting snapshots. More...
virtual const char* get_bridge_protocol_version() const =0
Returns the Bridge protocol version string.

Member Functions

virtual Sint32 mi::​bridge::​IBridge_server::calculate_hash( neuraylib::​ITransaction* transaction, const char* element, IString* o_hash, Size* o_size) [pure virtual]

Returns the hash and serialized size for the provided element.

Parameters

transaction
The transaction to use when looking up the element.
element
The name of the element.
o_hash
The hash will be written to this IString on success.
o_size
The serialized size in bytes will be assigned to this variable on success.

Returns

  • 0: Success.
  • -1: Invalid arguments.
  • -2: Failed to look up element with the provided name.
  • <= -2: Unspecified error.

virtual IApplication* mi::​bridge::​IBridge_server::create_application( const char* application_path, http::​IServer* http_server) [pure virtual]

Creates a Bridge application. The application will listen on the provided path on the given HTTP server for clients. The application has to be opened for connections before clients can open a session to it.

See also:

mi::bridge::IBridge_client::get_session()

Parameters

application_path
The path component of the WebSocket URL to the application. This identifier allows to run different Bridge applications on the same HTTP server. Note that the application path must begin with a slash.
http_server
The HTTP server instance that handles WebSocket requests for this application.

Returns

The created Bridge application, or NULL in case of failure (invalid arguments, application_path does not start with a slash, or an application for these arguments exists already).

virtual IBridge_snapshot_context* mi::​bridge::​IBridge_server::create_snapshot_context( const char* disk_cache) [pure virtual]

Parameters

disk_cache
The location of the disk cache. This can be either a directory on the local machine (prefix "path:") or the address of some cache manager (prefix "address:").

Returns

The snapshot context.

virtual const char* mi::​bridge::​IBridge_server::get_bridge_protocol_version() const [pure virtual]

Returns the Bridge protocol version string.