MDL SDK API nvidia_logo_transpbg.gif Up
imdl_execution_context.h
Go to the documentation of this file.
1/***************************************************************************************************
2 * Copyright 2026 NVIDIA Corporation. All rights reserved.
3 **************************************************************************************************/
6
7#ifndef MI_NEURAYLIB_IMDL_EXECUTION_CONTEXT_H
8#define MI_NEURAYLIB_IMDL_EXECUTION_CONTEXT_H
9
11#include <mi/base/enums.h>
12#include <mi/base/handle.h>
13#include <mi/neuraylib/version.h> // for MI_NEURAYLIB_DEPRECATED_ENUM_VALUE
14
15namespace mi {
16
17namespace neuraylib {
18
24class IMessage: public
25 base::Interface_declare<0x51965a01,0xcd3f,0x41fc,0xb1,0x8b,0x8,0x1c,0x7b,0x4b,0xba,0xb2>
26{
27public:
28
33 enum Kind : Uint32 {
34
37#ifdef MI_NEURAYLIB_DEPRECATED_16_0
38 MSG_COMILER_CORE = MSG_COMPILER_CORE,
39#endif
42#ifdef MI_NEURAYLIB_DEPRECATED_16_0
43 MSG_COMILER_BACKEND = MSG_COMPILER_BACKEND,
44#endif
55 MI_NEURAYLIB_DEPRECATED_ENUM_VALUE(MSG_FORCE_32_BIT, 0xffffffffU)
56 };
57
59 virtual Kind get_kind() const = 0;
60
63
65 virtual const char* get_string() const = 0;
66
68 virtual Sint32 get_code() const = 0;
69
73 virtual Size get_notes_count() const = 0;
74
76 virtual const IMessage* get_note( Size index) const = 0;
77};
78
160 base::Interface_declare<0x28eb1f99,0x138f,0x4fa2,0xb5,0x39,0x17,0xb4,0xae,0xfb,0x1b,0xca>
161{
162public:
163
165
166
168 virtual Size get_messages_count() const = 0;
169
171 virtual Size get_error_messages_count() const = 0;
172
174 virtual const IMessage* get_message( Size index) const = 0;
175
177 virtual const IMessage* get_error_message( Size index) const = 0;
178
180 virtual void clear_messages() = 0;
181
183 virtual void add_message(
184 IMessage::Kind kind,
185 base::Message_severity severity,
186 Sint32 code,
187 const char* message) = 0;
188
190
192
194 virtual Size get_option_count() const = 0;
195
197 virtual const char* get_option_name( Size index) const = 0;
198
200 virtual const char* get_option_type( const char* name) const = 0;
201
210 virtual Sint32 get_option( const char* name, const char*& value) const = 0;
211
220 virtual Sint32 get_option( const char* name, Sint32& value) const = 0;
221
230 virtual Sint32 get_option( const char* name, Float32& value) const = 0;
231
240 virtual Sint32 get_option( const char* name, bool& value) const = 0;
241
250 virtual Sint32 get_option( const char* name, const base::IInterface** value) const = 0;
251
260 template<typename T>
261 const T* get_option( const char* name, Sint32& return_code)
262 {
263 const base::IInterface* pointer = nullptr;
264 return_code = get_option( name, &pointer);
265 if( return_code != 0 || !pointer)
266 return 0;
267
269 const T* pointer_T = pointer->get_interface<T>();
270 if( !pointer_T) {
271 return_code = -2;
272 return 0;
273 }
274
275 return pointer_T;
276 }
277
286 virtual Sint32 set_option( const char* name, const char* value) = 0;
287
296 virtual Sint32 set_option( const char* name, Sint32 value) = 0;
297
306 virtual Sint32 set_option( const char* name, Float32 value) = 0;
307
317 virtual Sint32 set_option( const char* name, bool value) = 0;
318
328 virtual Sint32 set_option( const char* name, const base::IInterface* value) = 0;
329
331};
332
333 // end group mi_neuray_mdl_misc
335
336} // namespace neuraylib
337} // namespace mi
338
339#endif // MI_NEURAYLIB_IMDL_EXECUTION_CONTEXT_H
Handle class template for interfaces, automatizing the lifetime control via reference counting.
Definition: handle.h:112
The basic extensible interface.
Definition: iinterface.h:104
Mixin class template for deriving new interface declarations.
Definition: interface_declare.h:42
The execution context can be used to query status information like error and warning messages concern...
Definition: imdl_execution_context.h:161
virtual Sint32 get_option(const char *name, Sint32 &value) const =0
Returns an int option.
virtual Sint32 set_option(const char *name, const char *value)=0
Sets a string option.
virtual Sint32 get_option(const char *name, Float32 &value) const =0
Returns a float option.
virtual Sint32 set_option(const char *name, bool value)=0
Sets a bool option.
virtual Sint32 set_option(const char *name, Float32 value)=0
Sets a float option.
virtual Sint32 set_option(const char *name, const base::IInterface *value)=0
Sets an interface option.
virtual Size get_error_messages_count() const =0
Returns the number of error messages.
virtual Sint32 set_option(const char *name, Sint32 value)=0
Sets an int option.
virtual Sint32 get_option(const char *name, bool &value) const =0
Returns a bool option.
const T * get_option(const char *name, Sint32 &return_code)
Returns an interface option.
Definition: imdl_execution_context.h:261
virtual Sint32 get_option(const char *name, const char *&value) const =0
Returns a string option.
virtual void clear_messages()=0
Clears all messages.
virtual Size get_messages_count() const =0
Returns the number of messages.
virtual void add_message(IMessage::Kind kind, base::Message_severity severity, Sint32 code, const char *message)=0
Adds a message.
virtual const char * get_option_type(const char *name) const =0
Returns the option type name at index.
virtual Size get_option_count() const =0
Returns the number of supported options.
virtual const char * get_option_name(Size index) const =0
Returns the option name at index.
virtual const IMessage * get_message(Size index) const =0
Returns the message at index or nullptr, if no such index exists.
virtual Sint32 get_option(const char *name, const base::IInterface **value) const =0
Returns an interface option.
virtual const IMessage * get_error_message(Size index) const =0
Returns the error message at index or nullptr, if no such index exists.
Message interface.
Definition: imdl_execution_context.h:26
virtual const char * get_string() const =0
Returns the message string.
virtual Kind get_kind() const =0
Returns the kind of message.
virtual Size get_notes_count() const =0
Returns the number of notes associated with the message.
Kind
The possible kinds of messages.
Definition: imdl_execution_context.h:33
@ MSG_IMP_EXP
MDL import/exporter message (currently unused).
Definition: imdl_execution_context.h:50
@ MSG_COMPILER_ARCHIVE_TOOL
MDL Core archive tool message.
Definition: imdl_execution_context.h:48
@ MSG_INTEGRATION
MDL integration message.
Definition: imdl_execution_context.h:52
@ MSG_COMPILER_CORE
MDL Core compiler message.
Definition: imdl_execution_context.h:36
@ MSG_UNCATEGORIZED
Uncategorized message.
Definition: imdl_execution_context.h:54
@ MSG_COMPILER_DAG
MDL Core DAG generator message.
Definition: imdl_execution_context.h:46
@ MSG_COMPILER_BACKEND
MDL Core compiler backend message.
Definition: imdl_execution_context.h:41
virtual Sint32 get_code() const =0
Returns a unique identifier for the message.
virtual const IMessage * get_note(Size index) const =0
Returns the note at index or nullptr, if no such index exists.
virtual base::Message_severity get_severity() const =0
Returns the severity of the message.
Basic enums.
virtual const IInterface * get_interface(const Uuid &interface_id) const =0
Acquires a const interface from another.
Message_severity
Constants for possible message severities.
Definition: enums.h:33
int Sint32
32-bit signed integer.
Definition: types.h:46
float Float32
32-bit float.
Definition: types.h:51
Uint64 Size
Unsigned integral type that is large enough to hold the size of all types.
Definition: types.h:103
unsigned int Uint32
32-bit unsigned integer.
Definition: types.h:49
Smart-pointer handle class for interfaces, const and non-const version.
Mixin class template for deriving new interface declarations.
Common namespace for APIs of NVIDIA Advanced Rendering Center GmbH.
Definition: example_derivatives.dox:5
Major and minor version number and an optional qualifier.