Material Definition Language API
Up
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Groups
Pages
ineuray.h
Go to the documentation of this file.
1
/***************************************************************************************************
2
* Copyright 2019 NVIDIA Corporation. All rights reserved.
3
**************************************************************************************************/
6
7
#ifndef MI_NEURAYLIB_INEURAY_H
8
#define MI_NEURAYLIB_INEURAY_H
9
10
#include <
mi/base/interface_declare.h
>
11
12
// X11/Xlib.h defines Status to int
13
#if defined(_XLIB_H_) || defined(_X11_XLIB_H_)
14
#undef Status
15
#endif // _XLIB_H_ || _X11_XLIB_H_
16
17
namespace
mi {
18
19
namespace
neuraylib {
20
40
class
INeuray :
public
43
mi::base::Interface_declare
<0x4036e966,0xfcc0,0x4f5a,0xb8,0x64,0x3a,0xcd,0x94,0x5,0xf2,0xce>
44
{
45
public
:
49
virtual
Uint32
get_interface_version
()
const
= 0;
50
55
virtual
const
char
*
get_version
()
const
= 0;
56
57
// Startup and shutdown
58
87
virtual
Sint32
start
(
bool
blocking =
true
) = 0;
88
92
enum
Status
93
{
95
PRE_STARTING
= 0,
97
STARTING
= 1,
99
STARTED
= 2,
101
SHUTTINGDOWN
= 3,
103
SHUTDOWN
= 4,
105
FAILURE
= 5,
106
// Undocumented, for alignment only.
107
FORCE_32_BIT = 0xffffffffU
108
};
109
132
virtual
Sint32
shutdown
(
bool
blocking =
true
) = 0;
133
137
virtual
Status
get_status
()
const
= 0;
138
149
virtual
base::IInterface
*
get_api_component
(
const
base::Uuid
& uuid)
const
= 0;
150
163
template
<
class
T>
164
T*
get_api_component
()
const
165
{
166
base::IInterface
* ptr_iinterface =
get_api_component
(
typename
T::IID());
167
if
( !ptr_iinterface)
168
return
0;
169
T* ptr_T =
static_cast<
T*
>
( ptr_iinterface->
get_interface
(
typename
T::IID()));
170
ptr_iinterface->
release
();
171
return
ptr_T;
172
}
173
187
virtual
Sint32
register_api_component
(
188
const
base::Uuid
& uuid,
base::IInterface
* api_component) = 0;
189
204
template
<
class
T>
205
Sint32
register_api_component
( T* api_component)
206
{
207
return
register_api_component
(
typename
T::IID(), api_component);
208
}
209
218
virtual
Sint32
unregister_api_component
(
const
base::Uuid
& uuid) = 0;
219
231
template
<
class
T>
232
Sint32
unregister_api_component
()
233
{
234
return
unregister_api_component
(
typename
T::IID());
235
}
236
};
237
238
mi_static_assert
(
sizeof
(
INeuray::Status
) ==
sizeof
(
Uint32
));
239
// end group mi_neuray_ineuray
241
242
}
// namespace neuraylib
243
244
}
// namespace mi
245
246
// X11/Xlib.h defines Status to int
247
#if defined(_XLIB_H_) || defined(_X11_XLIB_H_)
248
#define Status int
249
#endif // _XLIB_H_ || _X11_XLIB_H_
250
251
#endif // MI_NEURAYLIB_INEURAY_H
20 February 2019, 22:00, revision 315630, Doxygen 1.8.4
© 1986, 2019 NVIDIA Corporation.
All rights reserved.