NVIDIA Iray API Home  Up
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
mi::bridge::IClient_session Class Referenceabstract

Represents the client side of a Bridge session. More...

Inheritance diagram for mi::bridge::IClient_session:
Inheritance graph
[legend]

Public Member Functions

virtual Client_session_state  get_state ()=0
  Returns the state of the session. More...
 
virtual void  add_session_state_callback (IClient_session_state_callback *callback)=0
  Adds a session state callback. More...
 
virtual void  remove_session_state_callback (IClient_session_state_callback *callback)=0
  Removes a previously added session state callback. More...
 
virtual IClient_scope get_scope (neuraylib::IScope *local_scope)=0
  Returns a Bridge scope that mirrors a local scope to the Bridge server. More...
 
virtual IClient_video_context create_video_context ()=0
  Creates a new video context. More...
 
virtual Sint32  measure_bandwidth (IClient_measure_bandwidth_callback *progress_callback, bool upload, Uint32 package_size, Uint32 package_count=1)=0
  Measures the bandwidth to the Bridge server. More...
 
virtual void  set_receiving_logger (base::ILogger *logger)=0
  Sets the receiving logger for log messages forwarded from the Bridge server. More...
 
virtual base::ILogger get_receiving_logger () const =0
  Returns the receiving logger for log messages forwarded from the Bridge server. More...
 
virtual Sint32  set_forwarding_log_level (base::Message_severity level)=0
  Sets the log level of messages that are forwarded from the Bridge server. More...
 
virtual base::Message_severity  get_forwarding_log_level () const =0
  Returns the currently set log level for messages forwarded from the server. More...
 
virtual Size  get_bytes_written () const =0
  Returns the number of bytes written to the server so far. More...
 
virtual Size  get_bytes_read () const =0
  Returns the number of bytes read from the server so far. More...
 

Additional Inherited Members

- Public Types inherited from mi::base::Interface_declare< 0x70bb8712, 0x1305, 0x4c76, 0xb9, 0x38, 0xad, 0x27, 0x91, 0xea, 0xbd, 0x78 >
typedef Interface_declare< id1,
id2, id3, id4, id5, id6, id7,
id8, id9, id10, id11,
IInterface
Self
  Own type. More...
 
typedef Uuid_t< id1, id2, id3,
id4, id5, id6, id7, id8, id9,
id10, id11 > 
IID
  Declares the interface ID (IID) of this interface. More...
 
- Static Public Member Functions inherited from mi::base::Interface_declare< 0x70bb8712, 0x1305, 0x4c76, 0xb9, 0x38, 0xad, 0x27, 0x91, 0xea, 0xbd, 0x78 >
static bool  compare_iid (const Uuid &iid)
  Compares the interface ID iid against the interface ID of this interface and of its ancestors. More...
 

Detailed Description

Represents the client side of a Bridge session.

A session can be opened by mi::bridge::IBridge_client::get_session(). Note that repeated calls of that method with the same arguments return the same session, i.e., sessions are shared between different callers. Sharing the same session is vital for features such as incremental changes, and to share other resources that would otherwise be duplicated. The session will be destroyed and client- and server-side resources will be released when all references to the session has been released.

The session will automatically connect to the server. Use add_session_state_callback() for callbacks about session state changes. A closed session can not be used anymore. Use mi::bridge::IBridge_client::get_session() to attempt to reconnect.

See Also
mi::bridge::IBridge_client::get_session()

Member Function Documentation

virtual void mi::bridge::IClient_session::add_session_state_callback ( IClient_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 IClient_video_context* mi::bridge::IClient_session::create_video_context ( )
pure virtual

Creates a new video context.

The video context will be assigned an id which needs to be transfered to the server, along with any other data required to set up the video source properly. The server use this id to get the corresponding server-side video context which can be used to stream video frames to the client. The recommended way of transferring the id to the server is by executing a Bridge job.

Returns
The created video context, or NULL in case of failure.
virtual Size mi::bridge::IClient_session::get_bytes_read ( ) const
pure virtual

Returns the number of bytes read from the server so far.

See Also
get_bytes_written()
virtual Size mi::bridge::IClient_session::get_bytes_written ( ) const
pure virtual

Returns the number of bytes written to the server so far.

See Also
get_bytes_read()
virtual base::Message_severity mi::bridge::IClient_session::get_forwarding_log_level ( ) const
pure virtual

Returns the currently set log level for messages forwarded from the server.

See Also
set_forwarding_log_level
virtual base::ILogger* mi::bridge::IClient_session::get_receiving_logger ( ) const
pure virtual

Returns the receiving logger for log messages forwarded from the Bridge server.

Note that if no receiving logger has been set, this method returns NULL and logging is done using the currently general configured logger.

See Also
set_receiving_logger()
virtual IClient_scope* mi::bridge::IClient_session::get_scope ( neuraylib::IScope local_scope)
pure virtual

Returns a Bridge scope that mirrors a local scope to the Bridge server.

The first call for a given local scope creates the corresponding scope on the server. If the client scope instance is destroyed, the corresponding scope on the server is destroyed as well.

Note
"Mirroring" does not imply that all DB elements in the scope are automatically replicated on the server. It is up to the executed jobs to indicate which DB elements need to be replicated. A Bridge scope (and Bridge transaction) just establishes the context for that.
Parameters
local_scope The local scope to mirror.
Returns
The Bridge scope that mirrors the local scope, or NULL in case of failure.
virtual Client_session_state mi::bridge::IClient_session::get_state ( )
pure virtual

Returns the state of the session.

See Also
mi::bridge::Client_session_state
virtual Sint32 mi::bridge::IClient_session::measure_bandwidth ( IClient_measure_bandwidth_callback progress_callback,
bool  upload,
Uint32  package_size,
Uint32  package_count = 1 
)
pure virtual

Measures the bandwidth to the Bridge server.

The bandwidth is measured by sending a specified number of packages with a specified size in bytes. This method is asynchronous, the provided callback interface will be called when there is progress and when the measurement is done.

Note
For meaningful results the method should only be called when the session is not used to upload or download other real data at the same time.
Parameters
progress_callback A callback interface that will be called with progress information.
upload true for measuring upload bandwidth, false for measuring download bandwidth.
package_size The size in bytes of a single package.
package_count The number of packages to upload or download.
Returns
0 if the measurement was successfully started, -1 otherwise.
virtual void mi::bridge::IClient_session::remove_session_state_callback ( IClient_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.
virtual Sint32 mi::bridge::IClient_session::set_forwarding_log_level ( base::Message_severity  level)
pure virtual

Sets the log level of messages that are forwarded from the Bridge server.

Note that this does not affect the log level of the server, nor the log level of the client. It only filters the messages forwarded by the server to the client. Also note that the server will never send out log messages more verbose than the configured limit for the bridge application the session is connected to.

See Also
get_forwarding_log_level()
virtual void mi::bridge::IClient_session::set_receiving_logger ( base::ILogger logger)
pure virtual

Sets the receiving logger for log messages forwarded from the Bridge server.

If the provided logger is NULL then forwarded log entries will be written to the general configured logger as if they were generated locally, but with a prefix identifying the server that they originated from (default behavior).

See Also
set_receiving_logger()
Parameters
logger The receiving logger. It is valid to pass NULL in which case logging is reset to be done to the general configured logger.