neuray API Programmer's Manual

mi::bridge::IServer_session Class Reference

[Bridge server]

Public Member Functions

virtual void add_session_state_callback( IServer_session_state_callback* callback) =0
Adds a session state callback. More...
virtual IApplicationget_application() const =0
Returns the application this session belongs to.
virtual const char* get_client_bridge_protocol_version() =0
Returns the client Bridge protocol version. More...
virtual const char* get_client_build_number() =0
Returns build number of the client.
virtual IServer_transaction_listget_pending_transactions() =0
Returns a list of the currently pending Bridge transactions for this session in the order they were started on the client. More...
virtual const char* get_security_token() const =0
Returns the security token specified by the client.
virtual const char* get_session_id() const =0
Returns the session ID.
virtual Server_session_state get_state() const =0
Returns the state of this session.
virtual IServer_video_contextget_video_context( Sint32 context_id) =0
Returns the video context for a given ID. More...
virtual void remove_session_state_callback( IServer_session_state_callback* callback) =0
Removes a previously added session state callback. More...

Member Functions

virtual void mi::​bridge::​IServer_session::add_session_state_callback( IServer_session_state_callback* callback) [pure virtual]

Adds a session state callback. When adding a callback it will be called immediately once with the current state, and then every time the session state changes.

See also:

remove_session_state_callback()

Parameters

callback
The callback to be added.
virtual IApplication* mi::​bridge::​IServer_session::get_application() const [pure virtual]

Returns the application this session belongs to.

virtual const char* mi::​bridge::​IServer_session::get_client_bridge_protocol_version() [pure virtual]

Returns the client Bridge protocol version. This is usually the same as the server Bridge protocol version, but can differ if the server for instance accepts older clients.

virtual const char* mi::​bridge::​IServer_session::get_client_build_number() [pure virtual]

Returns build number of the client.

virtual IServer_transaction_list* mi::​bridge::​IServer_session::get_pending_transactions() [pure virtual]

Returns a list of the currently pending Bridge transactions for this session in the order they were started on the client. This is also the order the transactions will be started on the server, but some transactions in the list might not have been started yet on the server which means there won't be a database transaction yet.

Note that even though transactions will be started in the order specified by this list some transactions will execute in sequence and others in parallel, depending on how the transactions were started on the client.

Also note that even though all transactions in the list were pending when this call was made they might have been already committed or aborted when the list is processed and that any transactions added after this call won't be present in the list.

Two transactions will execute in sequence if the second transaction is started after the previous transaction was committed. Example: start A, commit A, start B commit B. They will execute in parallel if the second transaction is started before the previous transaction is committed. For instance start A, start B, commit A, commit B.

Returns

A list of pending transactions in the order they were started on the client.

virtual const char* mi::​bridge::​IServer_session::get_security_token() const [pure virtual]

Returns the security token specified by the client.

virtual const char* mi::​bridge::​IServer_session::get_session_id() const [pure virtual]

Returns the session ID.

virtual Server_session_state mi::​bridge::​IServer_session::get_state() const [pure virtual]

Returns the state of this session.

virtual IServer_video_context* mi::​bridge::​IServer_session::get_video_context( Sint32 context_id) [pure virtual]

Returns the video context for a given ID. Video contexts must first be created by the client and can then be retrieved on the server via this method. The video context ID is assigned when the video context is created on the client side and must be transferred to the server before calling this method. The recommended way to do this is to execute a Bridge job containing the video context ID and optionally other data that is required for the server-side application to set up the video source and to start producing frames.

Parameters

context_id
The video context ID.

Returns

The video context or NULL if no video context with the provided ID exists.

virtual void mi::​bridge::​IServer_session::remove_session_state_callback( IServer_session_state_callback* callback) [pure virtual]

Removes a previously added session state callback.

See also:

add_session_state_callback()

Parameters

callback
The callback to be removed.