Represents the client-side part of a job that can be executed by the Bridge server. More...
Public Member Functions | |
virtual void | get_references (neuraylib::ITag_set *result) const =0 |
Returns the database elements that will be used by this job on the server, identified by a set of tags. More... |
|
virtual void | get_references (IElement_set *result) const =0 |
Returns the database elements that will be used by this job on the server, identified by a set of names. More... |
|
virtual bool | upload_only () const =0 |
Indicates whether the referenced elements should really be updated in the server-side database. More... |
|
virtual void | receive_remote_result (neuraylib::IDeserializer *deserializer, bool last_result)=0 |
Deserializes the job result from the execution of the job on the server. More... |
|
virtual void | progress_callback (IClient_job_progress *job_progress)=0 |
A callback that provides progress information. More... |
|
virtual void | error_callback (Sint32 error_code, const char *msg)=0 |
A callback that indicates an error during job execution. More... |
|
Additional Inherited Members | |
Public Types inherited from mi::base::Interface_declare< 0xe02e4aeb, 0x6edd, 0x4e40, 0xbb, 0xe0, 0x6c, 0xc5, 0xe7, 0x69, 0xa6, 0xe, neuraylib::ISerializable > | |
typedef Interface_declare< id1, id2, id3, id4, id5, id6, id7, id8, id9, id10, id11, neuraylib::ISerializable > |
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< 0xe02e4aeb, 0x6edd, 0x4e40, 0xbb, 0xe0, 0x6c, 0xc5, 0xe7, 0x69, 0xa6, 0xe, neuraylib::ISerializable > | |
static bool | compare_iid (const Uuid &iid) |
Compares the interface ID iid against the interface ID of this interface and of its ancestors. 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.
|
pure virtual |
A callback that indicates an error during job execution.
error_code |
|
msg | A short explanation of the error. |
|
pure virtual |
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.
[out] | result | The set of tags referenced by the Bridge job. The passed-in tag set is empty. |
|
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.
[out] | result | The set of element names referenced by the Bridge job. The passed-in element set is empty. |
|
pure virtual |
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.
job_progress | An instance that contains all progress information. The instance may only be used from within this callback. |
|
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.
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. |
|
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.