MDL SDK API nvidia_logo_transpbg.gif Up
idata.h
Go to the documentation of this file.
1/***************************************************************************************************
2 * Copyright 2024 NVIDIA Corporation. All rights reserved.
3 **************************************************************************************************/
6
7#ifndef MI_NEURAYLIB_IDATA_H
8#define MI_NEURAYLIB_IDATA_H
9
11
12namespace mi {
13
295class IData :
296 public base::Interface_declare<0x2e5f84bc,0x783a,0x4551,0x9f,0xca,0x72,0x2f,0xb8,0x38,0xc4,0x7c>
297{
298public:
300 virtual const char* get_type_name() const = 0;
301};
302 // end group mi_neuray_types
304
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
348 public base::Interface_declare<0x1bb2be0f,0x0dc6,0x44b2,0x93,0xb9,0xd1,0xba,0x6a,0x31,0x88,0x1c,
349 IData>
350{
351public:
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
520class 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
This interface represents collections.
Definition: idata.h:350
T * get_value(const char *key)
Returns the value for key key.
Definition: idata.h:411
const T * get_value(const char *key) const
Returns the value for key key.
Definition: idata.h:382
virtual const char * get_key(Size index) const =0
Returns the key corresponding to index.
T * get_value(Size index)
Returns the value for index index.
Definition: idata.h:469
virtual const base::IInterface * get_value(const char *key) const =0
Returns the value for key key.
virtual Sint32 set_value(const char *key, base::IInterface *value)=0
Stores the value for key key.
virtual const base::IInterface * get_value(Size index) const =0
Returns the value for index index.
const T * get_value(Size index) const
Returns the value for index index.
Definition: idata.h:440
virtual Size get_length() const =0
Returns the number of values.
virtual base::IInterface * get_value(const char *key)=0
Returns the value for key key.
virtual bool has_key(const char *key) const =0
Indicates whether the key key exists or not.
virtual base::IInterface * get_value(Size index)=0
Returns the value for index index.
virtual Sint32 set_value(Size index, base::IInterface *value)=0
Stores the value for index index.
This interface represents simple types.
Definition: idata.h:321
This interface is the base interface of all types.
Definition: idata.h:297
virtual const char * get_type_name() const =0
Returns the type name.
This interface represents the void type.
Definition: idata.h:523
The basic extensible interface.
Definition: iinterface.h:103
Mixin class template for deriving new interface declarations.
Definition: interface_declare.h:43
virtual const IInterface * get_interface(const Uuid &interface_id) const =0
Acquires a const interface from another.
virtual Uint32 release() const =0
Decrements the reference count.
Uint64 Size
Unsigned integral type that is large enough to hold the size of all types.
Definition: types.h:112
signed int Sint32
32-bit signed integer.
Definition: types.h:46
Mixin class template for deriving new interface declarations.
Common namespace for APIs of NVIDIA Advanced Rendering Center GmbH.
Definition: example_derivatives.dox:5