NVIDIA Iray API Home  Up
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ibridge_client.h
Go to the documentation of this file.
1 //*****************************************************************************
2 // Copyright 1986, 2016 NVIDIA Corporation. All rights reserved.
3 //*****************************************************************************
6 //*****************************************************************************
7 
8 #ifndef MI_NEURAYLIB_IBRIDGE_CLIENT_H
9 #define MI_NEURAYLIB_IBRIDGE_CLIENT_H
10 
11 #include <mi/base/enums.h>
14 
15 namespace mi {
16 
17 class IMap;
18 class IString;
19 
20 namespace base { class ILogger; }
21 
22 namespace neuraylib {
23 class IDeserializer;
24 class ITransaction;
25 class IScope;
26 class IProgress_callback;
27 class ITag_set;
28 }
29 
32 namespace bridge {
33 
35 
85 enum Client_job_state
98 {
101 
105 
112 
119 
127 
130 
131  CLIENT_JOB_FORCE_32_BIT = 0xffffffffU
132 };
133 
134 mi_static_assert( sizeof( Client_job_state) == sizeof( Uint32));
135 
137 class IClient_job_progress : public
138  mi::base::Interface_declare<0x7f51a745,0xfcf0,0x4b2d,0x92,0x93,0x2b,0x84,0xd7,0x8c,0xc0,0xe6>
139 {
140 public:
144  virtual Client_job_state get_state() const = 0;
145 
151  virtual Size get_updated_element_count() const = 0;
152 
157  virtual Size get_pending_hash_calculation_count() const = 0;
158 
163  virtual Size get_pending_cache_status_count() const = 0;
164 
168  virtual Size get_cache_miss_count() const = 0;
169 
173  virtual Size get_cache_miss_bytes() const = 0;
174 
178  virtual Size get_uploaded_cache_miss_count() const = 0;
179 
183  virtual Size get_uploaded_cache_miss_bytes() const = 0;
184 
190  virtual Size get_pending_data_serialization_count() const = 0;
191 
194  virtual const char* get_currently_uploaded_element_name() const = 0;
195 
198  virtual Size get_currently_uploaded_element_size() const = 0;
199 
203 };
204 
208 class IElement_set : public
209  mi::base::Interface_declare<0x2242471d,0x96f3,0x4962,0x84,0x7e,0xd1,0x20,0xa9,0x6b,0xb6,0x98>
210 {
211 public:
215  virtual Size get_length() const = 0;
216 
220  virtual const char* get_element( Size index) const = 0;
221 
223  virtual void add_element( const char* element_name) = 0;
224 };
225 
241 class IClient_job : public
242  mi::base::Interface_declare<0xe02e4aeb,0x6edd,0x4e40,0xbb,0xe0,0x6c,0xc5,0xe7,0x69,0xa6,0xe,
243  neuraylib::ISerializable>
244 {
245 public:
260  virtual void get_references( neuraylib::ITag_set* result) const = 0;
261 
276  virtual void get_references( IElement_set* result) const = 0;
277 
288  virtual bool upload_only() const = 0;
289 
304  virtual void receive_remote_result(
305  neuraylib::IDeserializer* deserializer, bool last_result) = 0;
306 
317  virtual void progress_callback( IClient_job_progress* job_progress) = 0;
318 
327  virtual void error_callback( Sint32 error_code, const char* msg) = 0;
328 };
329 
334 template <Uint32 i_id1, Uint16 i_id2, Uint16 i_id3
335 , Uint8 i_id4, Uint8 i_id5, Uint8 i_id6, Uint8 i_id7
336 , Uint8 i_id8, Uint8 i_id9, Uint8 i_id10, Uint8 i_id11
337 , class I = IClient_job>
339 {
340 public:
343 
346 
352  static bool compare_iid( const base::Uuid& iid)
353  {
354  if( iid == IID())
355  return true;
356  return I::compare_iid( iid);
357  }
358 
369  virtual const base::IInterface* get_interface( const base::Uuid& interface_id) const
370  {
371  if( interface_id == IID()) {
372  const Self* self = static_cast<const Self*>( this);
373  self->retain();
374  return self;
375  }
376  return I::get_interface_static( this, interface_id);
377  }
378 
389  virtual base::IInterface* get_interface( const base::Uuid& interface_id)
390  {
391  if( interface_id == IID()) {
392  Self* self = static_cast<Self*>( this);
393  self->retain();
394  return self;
395  }
396  return I::get_interface_static( this, interface_id);
397  }
398 
400 
402  virtual base::Uuid get_class_id() const
403  {
404  return IID();
405  }
406 
408  virtual void deserialize( neuraylib::IDeserializer* deserializer)
409  {
410  // avoid warnings
411  (void) deserializer;
412  }
413 
415  virtual void get_references( neuraylib::ITag_set* result) const
416  {
417  // avoid warnings
418  (void) result;
419  }
420 
422  virtual void get_references( IElement_set* result) const
423  {
424  // avoid warnings
425  (void) result;
426  }
427 
429  virtual bool upload_only() const { return false; }
430 };
431 
438  0xf9b3c8e2,0x7688,0x4bf8,0x91,0x36,0xcd,0x3a,0x3f,0x51,0x30,0x7a>
439 {
440  void serialize( neuraylib::ISerializer* serializer) const
441  {
442  // avoid warnings
443  (void) serializer;
444  }
445 
446  void receive_remote_result( neuraylib::IDeserializer* deserializer, bool last_result)
447  {
448  // avoid warnings
449  (void) deserializer;
450  (void) last_result;
451  }
452 };
453 
458  mi::base::Interface_declare<0xa110400a,0x8dfe,0x47d5,0xaf,0x28,0x64,0xe2,0xe5,0xd5,0xa6,0x6f>
459 {
460 public:
468  virtual void transaction_done_callback( Sint32 error_code) = 0;
469 };
470 
478 class IClient_transaction : public
479  mi::base::Interface_declare<0x5820ed8e,0xe2c6,0x4a35,0xa1,0xd4,0xc4,0x82,0x87,0x16,0xe0,0x36>
480 {
481 public:
496  virtual Sint32 execute( IClient_job* job) = 0;
497 
519  virtual Sint32 commit( IClient_transaction_callback* callback = 0) = 0;
520 
542  virtual Sint32 abort( IClient_transaction_callback* callback = 0) = 0;
543 };
544 
554 class IClient_scope : public
555  mi::base::Interface_declare<0xfff9d40,0xaa9e,0x4974,0xb4,0xcd,0x85,0xb9,0x8b,0x50,0x8b,0xeb>
556 {
557 public:
573 };
574 
579 {
583 
587 
597 
604 };
605 
606 mi_static_assert( sizeof( Client_session_state) == sizeof( Uint32));
607 
613  mi::base::Interface_declare<0x9ea6d3b3,0x3d0b,0x4d10,0x89,0xc8,0x89,0xf1,0x20,0x49,0xc6,0xe1>
614 {
615 public:
617  virtual void session_state_callback( Client_session_state state) = 0;
618 };
619 
624  mi::base::Interface_declare<0x80cf9612,0x3fd4,0x4ed0,0xb1,0x63,0xc0,0xd9,0x84,0xe2,0x6,0xaa>
625 {
626 public:
631  virtual void progress_callback( Size bytes_done, Size total_bytes) = 0;
632 
638  virtual void done_callback( Size total_bytes, Float64 total_time) = 0;
639 
645  virtual void error_callback( Sint32 error_code) = 0;
646 };
647 
662 class IClient_session : public
663  mi::base::Interface_declare<0x70bb8712,0x1305,0x4c76,0xb9,0x38,0xad,0x27,0x91,0xea,0xbd,0x78>
664 {
665 public:
668  virtual Client_session_state get_state() = 0;
669 
678  virtual void add_session_state_callback( IClient_session_state_callback* callback) = 0;
679 
686 
701  virtual IClient_scope* get_scope( neuraylib::IScope* local_scope) = 0;
702 
713 
730  virtual Sint32 measure_bandwidth(
731  IClient_measure_bandwidth_callback* progress_callback,
732  bool upload,
733  Uint32 package_size,
734  Uint32 package_count = 1) = 0;
735 
746  virtual void set_receiving_logger( base::ILogger* logger) = 0;
747 
754  virtual base::ILogger* get_receiving_logger() const = 0;
755 
765 
770 
774  virtual Size get_bytes_written() const = 0;
775 
779  virtual Size get_bytes_read() const = 0;
780 };
781 
785 class IBridge_client : public
786  mi::base::Interface_declare<0xbe270827,0xad68,0x4044,0x94,0x6e,0x9d,0x41,0x4d,0xf,0x75,0x65>
787 {
788 public:
816  virtual IClient_session* get_session(
817  const char* application_url, const char* security_token = 0) = 0;
818 
820  virtual const char* get_bridge_protocol_version() const = 0;
821 };
822  // end group mi_neuray_bridge_client
824 
825 } // namespace bridge
826 
827 } // namespace mi
828 
829 #endif // MI_NEURAYLIB_IBRIDGE_CLIENT_H