Material Definition Language API nvidia_logo_transpbg.gif Up
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ivalue.h
Go to the documentation of this file.
1 /***************************************************************************************************
2  * Copyright 2019 NVIDIA Corporation. All rights reserved.
3  **************************************************************************************************/
6 
7 #ifndef MI_NEURAYLIB_IVALUE_H
8 #define MI_NEURAYLIB_IVALUE_H
9 
10 #include <mi/base/handle.h>
11 #include <mi/math/color.h>
12 #include <mi/math/matrix.h>
13 #include <mi/math/spectrum.h>
14 #include <mi/math/vector.h>
15 #include <mi/neuraylib/itype.h>
16 
17 namespace mi {
18 
19 namespace neuraylib {
20 
25 class IValue : public
29  mi::base::Interface_declare<0xbf837f4a,0x9034,0x4f32,0xaf,0x5c,0x75,0xb3,0x67,0x64,0x53,0x23>
30 {
31 public:
33  enum Kind {
64  // Undocumented, for alignment only.
65  VK_FORCE_32_BIT = 0xffffffffU
66  };
67 
69  virtual Kind get_kind() const = 0;
70 
72  virtual const IType* get_type() const = 0;
73 
75  template <class T>
76  const T* get_type() const
77  {
78  const IType* ptr_type = get_type();
79  if( !ptr_type)
80  return 0;
81  const T* ptr_T = static_cast<const T*>( ptr_type->get_interface( typename T::IID()));
82  ptr_type->release();
83  return ptr_T;
84  }
85 };
86 
87 mi_static_assert( sizeof( IValue::Kind) == sizeof( Uint32));
88 
90 class IValue_atomic : public
91  mi::base::Interface_declare<0xf2413c80,0x8e71,0x4974,0xaa,0xf2,0x60,0xd5,0xe2,0x94,0x9d,0x3e,
92  neuraylib::IValue>
93 {
94 public:
96  const IType_atomic* get_type() const = 0;
97 };
98 
100 class IValue_bool : public
101  mi::base::Interface_declare<0xaf253a14,0x1f04,0x4b67,0xba,0x70,0x7b,0x01,0x05,0xfb,0xc8,0xf5,
102  neuraylib::IValue_atomic>
103 {
104 public:
106  static const Kind s_kind = VK_BOOL;
107 
109  const IType_bool* get_type() const = 0;
110 
112  virtual bool get_value() const = 0;
113 
115  virtual void set_value( bool value) = 0;
116 };
117 
119 class IValue_int : public
120  mi::base::Interface_declare<0x91e6f145,0x280d,0x4d68,0x95,0x57,0xe1,0xd0,0x9c,0xd2,0x5c,0x74,
121  neuraylib::IValue_atomic>
122 {
123 public:
125  static const Kind s_kind = VK_INT;
126 
128  const IType_int* get_type() const = 0;
129 
131  virtual Sint32 get_value() const = 0;
132 
134  virtual void set_value( Sint32 value) = 0;
135 };
136 
138 class IValue_enum : public
139  mi::base::Interface_declare<0xdc876204,0x8a97,0x40e9,0xb9,0xb6,0xca,0xdc,0xdd,0x60,0x1f,0xbf,
140  neuraylib::IValue_atomic>
141 {
142 public:
144  static const Kind s_kind = VK_ENUM;
145 
147  virtual const IType_enum* get_type() const = 0;
148 
150  virtual Sint32 get_value() const = 0;
151 
153  virtual Size get_index() const = 0;
154 
160  virtual Sint32 set_value( Sint32 value) = 0;
161 
165  virtual Sint32 set_index( Size index) = 0;
166 
168  virtual const char* get_name() const = 0;
169 
173  virtual Sint32 set_name( const char* name) = 0;
174 };
175 
177 class IValue_float : public
178  mi::base::Interface_declare<0x21f07151,0x74b5,0x4296,0x90,0x29,0xc7,0xde,0x49,0x38,0x2a,0xbc,
179  neuraylib::IValue_atomic>
180 {
181 public:
183  static const Kind s_kind = VK_FLOAT;
184 
186  const IType_float* get_type() const = 0;
187 
189  virtual Float32 get_value() const = 0;
190 
192  virtual void set_value( Float32 value) = 0;
193 };
194 
196 class IValue_double : public
197  mi::base::Interface_declare<0xbdc84417,0x3e83,0x4bab,0x90,0xb1,0x9f,0x57,0xed,0x7b,0x15,0x03,
198  neuraylib::IValue_atomic>
199 {
200 public:
202  static const Kind s_kind = VK_DOUBLE;
203 
205  const IType_double* get_type() const = 0;
206 
208  virtual Float64 get_value() const = 0;
209 
211  virtual void set_value( Float64 value) = 0;
212 };
213 
215 class IValue_string : public
216  mi::base::Interface_declare<0x64b28506,0x8675,0x4724,0xa1,0x0d,0xc6,0xf2,0x35,0x46,0x26,0x39,
217  neuraylib::IValue_atomic>
218 {
219 public:
221  static const Kind s_kind = VK_STRING;
222 
224  const IType_string* get_type() const = 0;
225 
227  virtual const char* get_value() const = 0;
228 
230  virtual void set_value( const char* value) = 0;
231 };
232 
234 class IValue_compound : public
235  mi::base::Interface_declare<0xdabc8fe3,0x5c70,0x4ef0,0xa2,0xf7,0x34,0x30,0xb5,0x67,0xdc,0x75,
236  neuraylib::IValue>
237 {
238 public:
240  virtual const IType_compound* get_type() const = 0;
241 
243  virtual Size get_size() const = 0;
244 
246  virtual const IValue* get_value( Size index) const = 0;
247 
249  template <class T>
250  const T* get_value( Size index) const
251  {
252  const IValue* ptr_value = get_value( index);
253  if( !ptr_value)
254  return 0;
255  const T* ptr_T = static_cast<const T*>( ptr_value->get_interface( typename T::IID()));
256  ptr_value->release();
257  return ptr_T;
258  }
259 
261  virtual IValue* get_value( Size index) = 0;
262 
264  template <class T>
265  T* get_value( Size index)
266  {
267  IValue* ptr_value = get_value( index);
268  if( !ptr_value)
269  return 0;
270  T* ptr_T = static_cast<T*>( ptr_value->get_interface( typename T::IID()));
271  ptr_value->release();
272  return ptr_T;
273  }
274 
284  virtual Sint32 set_value( Size index, IValue* value) = 0;
285 };
286 
291 class IValue_vector : public
292  mi::base::Interface_declare<0xf5d09fc3,0xd783,0x4571,0x8d,0x59,0x41,0xb1,0xff,0xd3,0x91,0x49,
293  neuraylib::IValue_compound>
294 {
295 public:
297  static const Kind s_kind = VK_VECTOR;
298 
300  virtual const IType_vector* get_type() const = 0;
301 
303  virtual const IValue_atomic* get_value( Size index) const = 0;
304 
306  template <class T>
307  const T* get_value( Size index) const
308  {
309  const IValue_atomic* ptr_value = get_value( index);
310  if( !ptr_value)
311  return 0;
312  const T* ptr_T = static_cast<const T*>( ptr_value->get_interface( typename T::IID()));
313  ptr_value->release();
314  return ptr_T;
315  }
316 
318  virtual IValue_atomic* get_value( Size index) = 0;
319 
321  template <class T>
322  T* get_value( Size index)
323  {
324  IValue_atomic* ptr_value = get_value( index);
325  if( !ptr_value)
326  return 0;
327  T* ptr_T = static_cast<T*>( ptr_value->get_interface( typename T::IID()));
328  ptr_value->release();
329  return ptr_T;
330  }
331 };
332 
337 class IValue_matrix : public
338  mi::base::Interface_declare<0x9ee95da6,0x2cd6,0x4168,0x89,0xea,0x92,0x10,0x57,0xda,0xe6,0xdc,
339  neuraylib::IValue_compound>
340 {
341 public:
343  static const Kind s_kind = VK_MATRIX;
344 
346  virtual const IType_matrix* get_type() const = 0;
347 
349  virtual const IValue_vector* get_value( Size index) const = 0;
350 
352  virtual IValue_vector* get_value( Size index) = 0;
353 };
354 
356 class IValue_color : public
357  mi::base::Interface_declare<0x3bb9bf46,0x1cbb,0x4460,0xbe,0x27,0x10,0xf5,0x71,0x61,0x96,0xa2,
358  neuraylib::IValue_compound>
359 {
360 public:
362  static const Kind s_kind = VK_COLOR;
363 
365  virtual const IType_color* get_type() const = 0;
366 
368  virtual const IValue_float* get_value( Size index) const = 0;
369 
371  virtual IValue_float* get_value( Size index) = 0;
372 
379  virtual Sint32 set_value( Size index, IValue_float* value) = 0;
380 
382 };
383 
385 class IValue_array : public
386  mi::base::Interface_declare<0xa17c5f57,0xa647,0x41c4,0x86,0x2f,0x4c,0x0d,0xe1,0x30,0x08,0xfc,
387  neuraylib::IValue_compound>
388 {
389 public:
391  static const Kind s_kind = VK_ARRAY;
392 
394  virtual const IType_array* get_type() const = 0;
395 
402  virtual Sint32 set_size( Size size) = 0;
403 };
404 
406 class IValue_struct : public
407  mi::base::Interface_declare<0xcbe089ce,0x4aea,0x474d,0x94,0x5f,0x52,0x13,0xef,0x01,0xce,0x81,
408  neuraylib::IValue_compound>
409 {
410 public:
412  static const Kind s_kind = VK_STRUCT;
413 
415  virtual const IType_struct* get_type() const = 0;
416 
421  virtual const IValue* get_field( const char* name) const = 0;
422 
427  template <class T>
428  const T* get_field( const char* name) const
429  {
430  const IValue* ptr_value = get_field( name);
431  if( !ptr_value)
432  return 0;
433  T* ptr_T = static_cast<T*>( ptr_value->get_interface( typename T::IID()));
434  ptr_value->release();
435  return ptr_T;
436  }
437 
442  virtual IValue* get_field( const char* name) = 0;
443 
448  template <class T>
449  T* get_field( const char* name)
450  {
451  IValue* ptr_value = get_field( name);
452  if( !ptr_value)
453  return 0;
454  T* ptr_T = static_cast<T*>( ptr_value->get_interface( typename T::IID()));
455  ptr_value->release();
456  return ptr_T;
457  }
458 
468  virtual Sint32 set_field( const char* name, IValue* value) = 0;
469 };
470 
472 class IValue_resource : public
473  mi::base::Interface_declare<0x479bb10c,0xd444,0x426c,0x83,0xab,0x26,0xdf,0xf6,0x1d,0x6f,0xd7,
474  neuraylib::IValue>
475 {
476 public:
478  virtual const IType_resource* get_type() const = 0;
479 
483  virtual const char* get_value() const = 0;
484 
495  virtual Sint32 set_value( const char* value) = 0;
496 
501  virtual const char* get_file_path() const = 0;
502 };
503 
505 class IValue_texture : public
506  mi::base::Interface_declare<0xf2a03651,0x8883,0x4ba4,0xb9,0xa9,0xe6,0x87,0x34,0x3a,0xb3,0xb8,
507  neuraylib::IValue_resource>
508 {
509 public:
511  static const Kind s_kind = VK_TEXTURE;
512 
514  virtual const IType_texture* get_type() const = 0;
515 };
516 
518 class IValue_light_profile : public
519  mi::base::Interface_declare<0xd7c9ffbd,0xb5e4,0x4bf4,0x90,0xd0,0xe9,0x75,0x4d,0x6d,0x49,0x07,
520  neuraylib::IValue_resource>
521 {
522 public:
524  static const Kind s_kind = VK_LIGHT_PROFILE;
525 
527  virtual const IType_light_profile* get_type() const = 0;
528 };
529 
532  mi::base::Interface_declare<0x31a55244,0x415c,0x4b4d,0xa7,0x86,0x2f,0x21,0x9c,0xb8,0xb9,0xff,
533  neuraylib::IValue_resource>
534 {
535 public:
538 
540  virtual const IType_bsdf_measurement* get_type() const = 0;
541 };
542 
544 class IValue_invalid_df : public
545  mi::base::Interface_declare<0x1588b6fa,0xa143,0x4bac,0xa0,0x32,0x06,0xbd,0x9e,0x7f,0xb6,0xe5,
546  neuraylib::IValue>
547 {
548 public:
550  static const Kind s_kind = VK_INVALID_DF;
551 
553  const IType_reference* get_type() const = 0;
554 };
555 
559 class IValue_list : public
560  mi::base::Interface_declare<0x8027a5e5,0x4e25,0x410c,0xbb,0xce,0x84,0xb4,0x88,0x8b,0x03,0x46>
561 {
562 public:
564  virtual Size get_size() const = 0;
565 
567  virtual Size get_index( const char* name) const = 0;
568 
570  virtual const char* get_name( Size index) const = 0;
571 
573  virtual const IValue* get_value( Size index) const = 0;
574 
576  template <class T>
577  const T* get_value( Size index) const
578  {
579  const IValue* ptr_value = get_value( index);
580  if( !ptr_value)
581  return 0;
582  const T* ptr_T = static_cast<const T*>( ptr_value->get_interface( typename T::IID()));
583  ptr_value->release();
584  return ptr_T;
585  }
586 
588  virtual const IValue* get_value( const char* name) const = 0;
589 
591  template <class T>
592  const T* get_value( const char* name) const
593  {
594  const IValue* ptr_value = get_value( name);
595  if( !ptr_value)
596  return 0;
597  const T* ptr_T = static_cast<const T*>( ptr_value->get_interface( typename T::IID()));
598  ptr_value->release();
599  return ptr_T;
600  }
601 
608  virtual Sint32 set_value( Size index, const IValue* value) = 0;
609 
616  virtual Sint32 set_value( const char* name, const IValue* value) = 0;
617 
624  virtual Sint32 add_value( const char* name, const IValue* value) = 0;
625 };
626 
630 class IValue_factory : public
631  mi::base::Interface_declare<0x82595c0d,0x3687,0x4b45,0xa3,0x38,0x42,0x20,0x02,0xea,0x3f,0x9b>
632 {
633 public:
634 
636  virtual IType_factory* get_type_factory() const = 0;
637 
639  virtual IValue_bool* create_bool( bool value = false) const = 0;
640 
642  virtual IValue_int* create_int( Sint32 value = 0) const = 0;
643 
645  virtual IValue_enum* create_enum( const IType_enum* type, Size index = 0) const = 0;
646 
648  virtual IValue_float* create_float( Float32 value = 0.0f) const = 0;
649 
651  virtual IValue_double* create_double( Float64 value = 0.0) const = 0;
652 
656  virtual IValue_string* create_string( const char* value = "") const = 0;
657 
659  virtual IValue_vector* create_vector( const IType_vector* type) const = 0;
660 
662  virtual IValue_matrix* create_matrix( const IType_matrix* type) const = 0;
663 
665  virtual IValue_color* create_color(
666  Float32 red = 0.0f,
667  Float32 green = 0.0f,
668  Float32 blue = 0.0f) const = 0;
669 
671  virtual IValue_array* create_array( const IType_array* type) const = 0;
672 
674  virtual IValue_struct* create_struct( const IType_struct* type) const = 0;
675 
677  virtual IValue_texture* create_texture( const IType_texture* type, const char* value) const = 0;
678 
680  virtual IValue_light_profile* create_light_profile( const char* value) const = 0;
681 
683  virtual IValue_bsdf_measurement* create_bsdf_measurement( const char* value) const = 0;
684 
686  virtual IValue_invalid_df* create_invalid_df( const IType_reference* type) const = 0;
687 
689  virtual IValue* create( const IType* type) const = 0;
690 
692  template <class T>
693  T* create( const IType* type) const
694  {
695  IValue* ptr_value = create( type);
696  if( !ptr_value)
697  return 0;
698  T* ptr_T = static_cast<T*>( ptr_value->get_interface( typename T::IID()));
699  ptr_value->release();
700  return ptr_T;
701  }
702 
704  virtual IValue_list* create_value_list() const = 0;
705 
709  virtual IValue* clone( const IValue* value) const = 0;
710 
714  template <class T>
715  T* clone( const T* value) const
716  {
717  IValue* ptr_value = clone( static_cast<const IValue*>( value));
718  if( !ptr_value)
719  return 0;
720  T* ptr_T = static_cast<T*>( ptr_value->get_interface( typename T::IID()));
721  ptr_value->release();
722  return ptr_T;
723  }
724 
728  virtual IValue_list* clone( const IValue_list* value_list) const = 0;
729 
750  virtual Sint32 compare( const IValue* lhs, const IValue* rhs) const = 0;
751 
765  virtual Sint32 compare( const IValue_list* lhs, const IValue_list* rhs) const = 0;
766 
777  virtual const IString* dump( const IValue* value, const char* name, Size depth = 0) const = 0;
778 
788  virtual const IString* dump(
789  const IValue_list* list, const char* name, Size depth = 0) const = 0;
790 };
791 
807 template<class T>
809 {
812  if( value_int) {
813  value_int->set_value( v);
814  return 0;
815  }
816 
819  if( value_enum) {
820  if( value_enum->set_value( v) != 0)
821  return -2;
822  return 0;
823  }
824 
825  return -1;
826 }
827 
831 inline mi::Sint32 set_value( mi::neuraylib::IValue* value, const bool& v)
832 {
835  if( value_bool) {
836  value_bool->set_value( v);
837  return 0;
838  }
839 
840  return -1;
841 }
842 
847 {
850  if( value_float) {
851  value_float->set_value( v);
852  return 0;
853  }
854 
857  if( value_double) {
858  value_double->set_value( v);
859  return 0;
860  }
861 
862  return -1;
863 }
864 
869 {
872  if( value_float) {
873  value_float->set_value( static_cast<mi::Float32>( v));
874  return 0;
875  }
876 
879  if( value_double) {
880  value_double->set_value( v);
881  return 0;
882  }
883 
884  return -1;
885 }
886 
891 inline mi::Sint32 set_value( mi::neuraylib::IValue* value, const char* v)
892 {
895  if( value_enum) {
896  if( value_enum->set_name( v) != 0)
897  return -2;
898  return 0;
899  }
900 
903  if( value_string) {
904  value_string->set_value( v);
905  return 0;
906  }
907 
910  if( value_resource) {
911  if( value_resource->set_value( v) != 0)
912  return -2;
913  return 0;
914  }
915 
916  return -1;
917 }
918 
923 template<class T, Size DIM>
925 {
928  if( value_vector) {
929  if( value_vector->get_size() != DIM)
930  return -1;
931  for( Size i = 0; i < DIM; ++i) {
932  mi::base::Handle<mi::neuraylib::IValue> component( value_vector->get_value( i));
933  mi::Sint32 result = set_value( component.get(), v[i]);
934  if( result != 0)
935  return result;
936  }
937  return 0;
938  }
939 
940  return -1;
941 }
942 
952 template<class T, Size ROW, Size COL>
954 {
957  if( value_matrix) {
958  if( value_matrix->get_size() != ROW)
959  return -1;
960  for( Size i = 0; i < ROW; ++i) {
962  if( column->get_size() != COL)
963  return -1;
964  for( Size j = 0; j < COL; ++j) {
965  mi::base::Handle<mi::neuraylib::IValue> element( column->get_value( j));
966  mi::Sint32 result = set_value( element.get(), v[i][j]);
967  if( result != 0)
968  return result;
969  }
970  }
971  return 0;
972  }
973 
974  return -1;
975 }
976 
981 {
984  if( value_color) {
986  red ->set_value( v.r);
988  green->set_value( v.g);
990  blue ->set_value( v.b);
991  return 0;
992  }
993 
994  return -1;
995 }
996 
1002 {
1005  if( value_color) {
1007  red ->set_value( v[0]);
1009  green->set_value( v[1]);
1011  blue ->set_value( v[2]);
1012  return 0;
1013  }
1014 
1015  return -1;
1016 }
1017 
1028 template<class T>
1030 {
1033  if( value_compound) {
1034  mi::base::Handle<mi::neuraylib::IValue> component( value_compound->get_value( index));
1035  if( !component)
1036  return -3;
1037  return set_value( component.get(), v);
1038  }
1039 
1040  return -1;
1041 }
1042 
1053 template<class T>
1054 mi::Sint32 set_value( mi::neuraylib::IValue* value, const char* name, const T& v)
1055 {
1058  if( value_struct) {
1059  mi::base::Handle<mi::neuraylib::IValue> field( value_struct->get_field( name));
1060  if( !field)
1061  return -3;
1062  return set_value( field.get(), v);
1063  }
1064 
1065  return -1;
1066 }
1067 
1068 // Simplifies reading the value of #mi::neuraylib::IValue into the corresponding classes from the
1082 template<class T>
1084 {
1087  if( value_int) {
1088  v = value_int->get_value();
1089  return 0;
1090  }
1091 
1094  if( value_enum) {
1095  v = value_enum->get_value();
1096  return 0;
1097  }
1098 
1099  return -1;
1100 }
1101 
1105 inline mi::Sint32 get_value( const mi::neuraylib::IValue* value, bool& v)
1106 {
1109  if( value_bool) {
1110  v = value_bool->get_value();
1111  return 0;
1112  }
1113 
1114  return -1;
1115 }
1116 
1121 {
1124  if( value_float) {
1125  v = value_float->get_value();
1126  return 0;
1127  }
1128 
1131  if( value_double) {
1132  v = static_cast<mi::Float32>( value_double->get_value());
1133  return 0;
1134  }
1135 
1136  return -1;
1137 }
1138 
1143 {
1146  if( value_float) {
1147  v = value_float->get_value();
1148  return 0;
1149  }
1150 
1153  if( value_double) {
1154  v = value_double->get_value();
1155  return 0;
1156  }
1157 
1158  return -1;
1159 }
1160 
1165 inline mi::Sint32 get_value( const mi::neuraylib::IValue* value, const char*& v)
1166 {
1169  if( value_enum) {
1170  v = value_enum->get_name();
1171  return 0;
1172  }
1173 
1176  if( value_string) {
1177  v = value_string->get_value();
1178  return 0;
1179  }
1180 
1183  if( value_resource) {
1184  v = value_resource->get_value();
1185  return 0;
1186  }
1187 
1188  return -1;
1189 }
1190 
1195 template <class T, Size DIM>
1197 {
1200  if( value_vector) {
1201  if( value_vector->get_size() != DIM)
1202  return -1;
1203  for( Size i = 0; i < DIM; ++i) {
1204  mi::base::Handle<const mi::neuraylib::IValue> component( value_vector->get_value( i));
1205  mi::Sint32 result = get_value( component.get(), v[i]);
1206  if( result != 0)
1207  return result;
1208  }
1209  return 0;
1210  }
1211 
1212  return -1;
1213 }
1214 
1224 template <class T, Size ROW, Size COL>
1226 {
1229  if( value_matrix) {
1230  if( value_matrix->get_size() != ROW)
1231  return -1;
1232  for( Size i = 0; i < ROW; ++i) {
1234  value_matrix->get_value( i));
1235  if( column->get_size() != COL)
1236  return -1;
1237  for( Size j = 0; j < COL; ++j) {
1238  mi::base::Handle<const mi::neuraylib::IValue> element( column->get_value( j));
1239  mi::Sint32 result = get_value( element.get(), v[i][j]);
1240  if( result != 0)
1241  return result;
1242  }
1243  }
1244  return 0;
1245  }
1246 
1247  return -1;
1248 }
1249 
1254 {
1257  if( value_color) {
1259  v.r = red ->get_value();
1261  v.g = green->get_value();
1263  v.b = blue ->get_value();
1264  v.a = 1.0f;
1265  return 0;
1266  }
1267 
1268  return -1;
1269 }
1270 
1276 {
1279  if( value_color) {
1281  v[0] = red ->get_value();
1283  v[1] = green->get_value();
1285  v[2] = blue ->get_value();
1286  return 0;
1287  }
1288 
1289  return -1;
1290 }
1291 
1302 template<class T>
1304 {
1307  if( value_compound) {
1308  mi::base::Handle<const mi::neuraylib::IValue> component( value_compound->get_value( index));
1309  if( !component)
1310  return -3;
1311  return get_value( component.get(), v);
1312  }
1313 
1314  return -1;
1315 }
1316 
1327 template<class T>
1328 mi::Sint32 get_value( const mi::neuraylib::IValue* value, const char* name, T& v)
1329 {
1332  if( value_struct) {
1333  mi::base::Handle<const mi::neuraylib::IValue> field( value_struct->get_field( name));
1334  if( !field)
1335  return -3;
1336  return get_value( field.get(), v);
1337  }
1338 
1339  return -1;
1340 }
1341  // end group mi_neuray_mdl_types
1343 
1344 } // namespace neuraylib
1345 
1346 } // namespace mi
1347 
1348 #endif // MI_NEURAYLIB_IVALUE_H