NVIDIA Iray API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
idata.h
Go to the documentation of this file.
1 //*****************************************************************************
2 // Copyright 1986, 2014 NVIDIA Corporation. All rights reserved.
3 //*****************************************************************************
6 //*****************************************************************************
7 
8 #ifndef MI_NEURAYLIB_IDATA_H
9 #define MI_NEURAYLIB_IDATA_H
10 
12 
13 namespace mi {
14 
252 #ifndef MI_SKIP_WITH_MDL_SDK_DOXYGEN
253 
297 #endif // MI_SKIP_WITH_MDL_SDK_DOXYGEN
298 
303 class IData :
310  public base::Interface_declare<0x2e5f84bc,0x783a,0x4551,0x9f,0xca,0x72,0x2f,0xb8,0x38,0xc4,0x7c>
311 {
312 public:
314  virtual const char* get_type_name() const = 0;
315 };
316  // end group mi_neuray_types
318 
323 class IData_simple :
333  public base::Interface_declare<0xc33c5a05,0xe7a5,0x4154,0xb8,0x87,0xee,0x1f,0x4d,0x5b,0x02,0x02,
334  IData>
335 {
336 };
337  // end group mi_neuray_simple_types
339 
344 class IData_collection :
362  public base::Interface_declare<0x1bb2be0f,0x0dc6,0x44b2,0x93,0xb9,0xd1,0xba,0x6a,0x31,0x88,0x1c,
363  IData>
364 {
365 public:
367  virtual Size get_length() const = 0;
368 
372  virtual const char* get_key( Size index) const = 0;
373 
375  virtual bool has_key( const char* key) const = 0;
376 
381  virtual const base::IInterface* get_value( const char* key) const = 0;
382 
395  template<class T>
396  const T* get_value( const char* key) const
397  {
398  const base::IInterface* ptr_iinterface = get_value( key);
399  if ( !ptr_iinterface)
400  return 0;
401  const T* ptr_T = static_cast<const T*>( ptr_iinterface->get_interface( typename T::IID()));
402  ptr_iinterface->release();
403  return ptr_T;
404  }
405 
410  virtual base::IInterface* get_value( const char* key) = 0;
411 
424  template<class T>
425  T* get_value( const char* key)
426  {
427  base::IInterface* ptr_iinterface = get_value( key);
428  if ( !ptr_iinterface)
429  return 0;
430  T* ptr_T = static_cast<T*>( ptr_iinterface->get_interface( typename T::IID()));
431  ptr_iinterface->release();
432  return ptr_T;
433  }
434 
439  virtual const base::IInterface* get_value( Size index) const = 0;
440 
453  template<class T>
454  const T* get_value( Size index) const
455  {
456  const base::IInterface* ptr_iinterface = get_value( index);
457  if ( !ptr_iinterface)
458  return 0;
459  const T* ptr_T = static_cast<const T*>( ptr_iinterface->get_interface( typename T::IID()));
460  ptr_iinterface->release();
461  return ptr_T;
462  }
463 
468  virtual base::IInterface* get_value( Size index) = 0;
469 
482  template<class T>
483  T* get_value( Size index)
484  {
485  base::IInterface* ptr_iinterface = get_value( index);
486  if ( !ptr_iinterface)
487  return 0;
488  T* ptr_T = static_cast<T*>( ptr_iinterface->get_interface( typename T::IID()));
489  ptr_iinterface->release();
490  return ptr_T;
491  }
492 
505  virtual Sint32 set_value( const char* key, base::IInterface* value) = 0;
506 
519  virtual Sint32 set_value( Size index, base::IInterface* value) = 0;
520 };
521  // end group mi_neuray_collections
523 
528 class IVoid :
535  public base::Interface_declare<0x3142c0a4,0xa138,0x472f,0x85,0xe5,0xc0,0x13,0xfc,0xd1,0x04,0x6a,
536  IData_simple>
537 {
538 };
539  // end group mi_neuray_simple_types
541 
542 } // namespace mi
543 
544 #endif // MI_NEURAYLIB_IDATA_H