|
typedef Interface_declare< id1, ... > | Self |
| Own type. More...
|
|
typedef Uuid_t< id1, ... > | IID |
| Declares the interface ID (IID) of this interface. More...
|
|
typedef Uuid_t<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0> | IID |
| Declares the interface ID (IID) of this interface. More...
|
|
static bool | compare_iid (const Uuid &iid) |
| Compares the interface ID iid against the interface ID of this interface and of its ancestors. More...
|
|
static bool | compare_iid (const Uuid &iid) |
| Compares the interface ID iid against the interface ID of this interface. More...
|
|
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()
Marks the provided job to be canceled and returns immediately.
A job progress callback will be made to inform when the job is canceled or completed. Note that it is not always possible to cancel a job depending on the timing so a job can still be completed even after successfully calling this method.
Known limitation: Canceling jobs doing uploads doesn't cancel the upload itself and even if the job is canceled successfully some or all uploaded elements might be stored in the database. To make sure that elements from a job is not persisted in the server side database the transaction must be aborted. This will automatically cancel all Bridge jobs running in that transaction.
- Parameters
-
- Returns
- 0: Job canceled.
- 1: Job not executing or already canceled.
- -1: Invalid arguments (
job
is NULL
).
- -3: Network error.
- <= -4: Unspecified error.
virtual Sint32 mi::bridge::IClient_session::execute |
( |
IClient_job * |
job, |
|
|
neuraylib::ITransaction * |
transaction |
|
) |
| |
|
pure virtual |
Schedules the provided job for execution on the server and returns immediately.
Jobs are executed asynchronously, but sequentially (per transaction) on the server in the same order as execution is requested by this method. A job is only executed after its referenced database elements have been updated from the Bridge client to the Bridge server.
Note that the same IClient_job instance must not be executed several times in parallel. This is true both within a single transaction and in multiple transactions.
- Parameters
-
job | The job to execute. |
transaction | The transaction in which context the job will be executed. |
- Returns
- 0: Success.
- -1: Invalid arguments (
job
or transaction is NULL
).
- -2: Invalid transaction state (already committed or aborted).
- -3: Network error.
- -4: The job reference elements that can't be accessed.
- <= -5: Unspecified error.
virtual Sint32 mi::bridge::IClient_session::set_hash_overrides |
( |
const IMap * |
overrides, |
|
|
const char * |
top_level_element, |
|
|
neuraylib::ITransaction * |
transaction |
|
) |
| |
|
pure virtual |
Allows the data for specific elements to be overridden by specifying the hash of the data to use regardless of the actual data stored in the db.
The replacements will only be done when executing a bridge job that returns the provided top_level_element in its get_references() method and only when executed in the same scope as the scope of the provided transaction. When an edited element is detected for the job the overrides map will be consulted to see if an override for the element with that name exists. If it does the element won't be serialized and the override hash from the map will be used instead. The server then use the hash when loading the data from the cache, meaning that it can be different than the actual data on the client. For this to work, the data for the hash must be guaranteed to already be in the server side cache. This can be achieved by storing snapshots in the server side cache with all required data before rendering the scene containing hash overrides.
- Parameters
-
overrides | An IMap with the name of the element to override as key and the hash as string value. The map must be of type Map<String>. Call this method with a NULL override map to release it or replace it with a new one. The map instance is retained by bridge to avoid expensive copying and must not be modified after this call. |
transaction | The hash overrides will be applied only for jobs executing in the same scope as this transaction. The top level element must be visible in this transaction. |
top_level_element | The top level element. The overrides applies to this element and all elements it reference when executing a job that returns the specified top level element in its get_references() method. |
- Returns
- 0: Success.
- -1: Invalid arguments (
job
or transaction is NULL
).
- -2: Invalid transaction state (already committed or aborted).
- <= -2: Unspecified error.