Represents the client-side part of a job that can be executed by the Bridge server.
More...
#include <ibridge_client.h>
|
typedef Interface_declare< id1, ... > | Self |
| Own type. More...
|
|
typedef Uuid_t< id1, ... > | IID |
| Declares the interface ID (IID) of this interface. More...
|
|
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 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 part of a job that can be executed by the Bridge server.
The corresponding server-side part of the job must return the same ID from mi::neuraylib::ISerializable::get_class_id() and be registered as a Bridge job on the server.
The client-side part must implement mi::neuraylib::ISerializable::serialize() to serialize the data that is received by mi::bridge::IServer_job::deserialize(), and mi::bridge::IClient_job::receive_remote_result() to deserialize the result of the job which is produced by mi::bridge::IServer_job::execute().
It is recommended to derived your implementation from mi::bridge::Client_job and overriding only the required methods.
- See also
- mi::bridge::IClient_session::execute()
◆ error_callback()
virtual void mi::bridge::IClient_job::error_callback |
( |
Sint32 |
error_code, |
|
|
const char * |
msg |
|
) |
| |
|
pure virtual |
A callback that indicates an error during job execution or if the job was canceled.
- Parameters
-
error_code |
- 0: The job was explicitly canceled or the transaction was aborted.
- -1: Network error.
- -2: Corresponding server side job does not exist.
- <= -3: Unspecified error.
|
msg | A short explanation of the error. |
◆ get_references() [1/2]
virtual void mi::bridge::IClient_job::get_references |
( |
IElement_set * |
result | ) |
const |
|
pure virtual |
Returns the database elements that will be used by this job on the server, identified by a set of names.
The Bridge will guarantee that any elements returned by this method and any elements indirectly referenced by them will be updated in the server-side cache and database before this Bridge job executes on the server.
- Note
- The elements identified by the overload get_references(neuraylib::ITag_set*)const will also be updated.
- See also
- upload_only()
- Parameters
-
[out] | result | The set of element names referenced by the Bridge job. The passed-in element set is empty. |
◆ get_references() [2/2]
Returns the database elements that will be used by this job on the server, identified by a set of tags.
The Bridge will guarantee that any elements returned by this method and any elements indirectly referenced by them will be updated in the server-side cache and database before this Bridge job executes on the server.
- Note
- The elements identified by the overload get_references(IElement_set*)constwill also be updated.
- See also
- upload_only()
- Parameters
-
[out] | result | The set of tags referenced by the Bridge job. The passed-in tag set is empty. |
◆ progress_callback()
A callback that provides progress information.
This method is called whenever the state of the job changes and also periodically if the job stays in a state for a long time. During execution of the job, custom progress information can be encoded into chunks of result data.
- See also
- Client_job_state, receive_remote_result(), IServer_job::execute()
- Parameters
-
job_progress | An instance that contains all progress information. The instance may only be used from within this callback. |
◆ receive_remote_result()
virtual void mi::bridge::IClient_job::receive_remote_result |
( |
neuraylib::IDeserializer * |
deserializer, |
|
|
bool |
last_result |
|
) |
| |
|
pure virtual |
Deserializes the job result from the execution of the job on the server.
The execution of the job might produce intermediate results by flushing the data serialized so far. Each call to mi::neuraylib::ISerializer::flush() on the server will result in a single call to receive_remote_result() with the last_result
flag set to false
, even if no data was flushed. When the execution on the server finishes this method will be called one last time with the last_result
flag set to true
with the remaining data.
See mi::bridge::IServer_job::execute() for more information and a couple of example use cases.
- Parameters
-
deserializer | The deserializer from which to read the (partial) result. |
last_result | true if this is the last chunk of result data the job will produce, false otherwise. |
◆ upload_only()
virtual bool mi::bridge::IClient_job::upload_only |
( |
| ) |
const |
|
pure virtual |
Indicates whether the referenced elements should really be updated in the server-side database.
Usually, this method returns false
, meaning that referenced elements are updated in the server-side cache and database. In some circumstances it is not necessary to update the server-side database because only the cache is needed, e.g., when saving snapshots. In this case, one can optimize the update process by returning true
, meaning that only the server side cache but not the database are updated before executing the job.
- See also
- get_references()