Material Definition Language API nvidia_logo_transpbg.gif Up
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
idata.h
Go to the documentation of this file.
1 /***************************************************************************************************
2  * Copyright 2020 NVIDIA Corporation. All rights reserved.
3  **************************************************************************************************/
6 
7 #ifndef MI_NEURAYLIB_IDATA_H
8 #define MI_NEURAYLIB_IDATA_H
9 
11 
12 namespace mi {
13 
289 class IData :
296  public base::Interface_declare<0x2e5f84bc,0x783a,0x4551,0x9f,0xca,0x72,0x2f,0xb8,0x38,0xc4,0x7c>
297 {
298 public:
300  virtual const char* get_type_name() const = 0;
301 };
302  // end group mi_neuray_types
304 
309 class IData_simple :
319  public base::Interface_declare<0xc33c5a05,0xe7a5,0x4154,0xb8,0x87,0xee,0x1f,0x4d,0x5b,0x02,0x02,
320  IData>
321 {
322 };
323  // end group mi_neuray_simple_types
325 
330 class IData_collection :
348  public base::Interface_declare<0x1bb2be0f,0x0dc6,0x44b2,0x93,0xb9,0xd1,0xba,0x6a,0x31,0x88,0x1c,
349  IData>
350 {
351 public:
353  virtual Size get_length() const = 0;
354 
358  virtual const char* get_key( Size index) const = 0;
359 
361  virtual bool has_key( const char* key) const = 0;
362 
367  virtual const base::IInterface* get_value( const char* key) const = 0;
368 
381  template<class T>
382  const T* get_value( const char* key) const
383  {
384  const base::IInterface* ptr_iinterface = get_value( key);
385  if ( !ptr_iinterface)
386  return 0;
387  const T* ptr_T = static_cast<const T*>( ptr_iinterface->get_interface( typename T::IID()));
388  ptr_iinterface->release();
389  return ptr_T;
390  }
391 
396  virtual base::IInterface* get_value( const char* key) = 0;
397 
410  template<class T>
411  T* get_value( const char* key)
412  {
413  base::IInterface* ptr_iinterface = get_value( key);
414  if ( !ptr_iinterface)
415  return 0;
416  T* ptr_T = static_cast<T*>( ptr_iinterface->get_interface( typename T::IID()));
417  ptr_iinterface->release();
418  return ptr_T;
419  }
420 
425  virtual const base::IInterface* get_value( Size index) const = 0;
426 
439  template<class T>
440  const T* get_value( Size index) const
441  {
442  const base::IInterface* ptr_iinterface = get_value( index);
443  if ( !ptr_iinterface)
444  return 0;
445  const T* ptr_T = static_cast<const T*>( ptr_iinterface->get_interface( typename T::IID()));
446  ptr_iinterface->release();
447  return ptr_T;
448  }
449 
454  virtual base::IInterface* get_value( Size index) = 0;
455 
468  template<class T>
469  T* get_value( Size index)
470  {
471  base::IInterface* ptr_iinterface = get_value( index);
472  if ( !ptr_iinterface)
473  return 0;
474  T* ptr_T = static_cast<T*>( ptr_iinterface->get_interface( typename T::IID()));
475  ptr_iinterface->release();
476  return ptr_T;
477  }
478 
491  virtual Sint32 set_value( const char* key, base::IInterface* value) = 0;
492 
505  virtual Sint32 set_value( Size index, base::IInterface* value) = 0;
506 };
507  // end group mi_neuray_collections
509 
514 class IVoid :
521  public base::Interface_declare<0x3142c0a4,0xa138,0x472f,0x85,0xe5,0xc0,0x13,0xfc,0xd1,0x04,0x6a,
522  IData_simple>
523 {
524 };
525  // end group mi_neuray_simple_types
527 
528 } // namespace mi
529 
530 #endif // MI_NEURAYLIB_IDATA_H