NVIDIA Iray API
Home
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
ifactory.h
Go to the documentation of this file.
1
//*****************************************************************************
2
// Copyright 1986, 2016 NVIDIA Corporation. All rights reserved.
3
//*****************************************************************************
6
//*****************************************************************************
7
8
#ifndef MI_NEURAYLIB_IFACTORY_H
9
#define MI_NEURAYLIB_IFACTORY_H
10
11
#include <
mi/base/interface_declare.h
>
12
#include <
mi/neuraylib/type_traits.h
>
13
#include <
mi/neuraylib/version.h
>
14
15
namespace
mi {
16
17
class
ICall_decl;
18
class
IData;
19
class
IEnum_decl;
20
class
IString;
21
class
IStructure_decl;
22
23
namespace
neuraylib {
24
29
class
IFactory :
public
35
mi::base::Interface_declare
<0x8afad838,0xe597,0x4a81,0x92,0x34,0x51,0xfe,0xa4,0xff,0x04,0x31>
36
{
37
public
:
60
virtual
base::IInterface*
create
(
61
const
char
* type_name,
62
Uint32
argc = 0,
63
const
base::IInterface* argv[] = 0) = 0;
64
104
template
<
class
T>
105
T*
create
(
106
const
char
* type_name,
107
Uint32
argc = 0,
108
const
base::IInterface
* argv[] = 0)
109
{
110
base::IInterface
* ptr_iinterface =
create
( type_name, argc, argv);
111
if
( !ptr_iinterface)
112
return
0;
113
T* ptr_T =
static_cast<
T*
>
( ptr_iinterface->
get_interface
(
typename
T::IID()));
114
ptr_iinterface->
release
();
115
return
ptr_T;
116
}
117
152
template
<
class
T>
153
T*
create
()
154
{
155
return
create<T>( Type_traits<T>::get_type_name());
156
}
157
162
enum
Assign_result
163
{
166
NULL_POINTER
= 1,
167
173
STRUCTURAL_MISMATCH
= 2,
174
178
NO_CONVERSION
= 4,
179
181
TARGET_KEY_MISSING
= 8,
182
184
SOURCE_KEY_MISSING
= 16,
185
190
DIFFERENT_COLLECTIONS
= 32,
191
196
NON_IDATA_VALUES
= 64,
197
202
INCOMPATIBLE_POINTER_TYPES
= 128,
203
206
DEEP_ASSIGNMENT_TO_CONST_POINTER
= 256,
207
213
INCOMPATIBLE_REF_TYPES
= 512,
214
218
INCOMPATIBLE_PRIVACY_LEVELS
= 1024,
219
221
INCOMPATIBLE_ENUM_TYPES
= 2048,
222
224
INCOMPATIBLE_OPTIONS
= 4096,
225
226
// Undocumented, for alignment only
227
FORCE_32_BIT_RESULT = 0xffffffffU
228
};
229
234
enum
Assign_clone_options
235
{
241
DEEP_ASSIGNMENT_OR_CLONE
= 1,
242
245
FIX_SET_OF_TARGET_KEYS
= 4,
246
247
// Undocumented, for alignment only
248
FORCE_32_BIT_OPTIONS = 0xffffffffU
249
};
250
272
virtual
Uint32
assign_from_to
(
const
IData
* source,
IData
* target,
Uint32
options = 0) = 0;
273
281
virtual
IData
*
clone
(
const
IData
* source,
Uint32
options = 0) = 0;
282
297
template
<
class
T>
298
T*
clone
(
const
IData
* source,
Uint32
options = 0)
299
{
300
mi::base::IInterface
* ptr_iinterface =
clone
( source, options);
301
if
( !ptr_iinterface)
302
return
0;
303
T* ptr_T =
static_cast<
T*
>
( ptr_iinterface->
get_interface
(
typename
T::IID()));
304
ptr_iinterface->
release
();
305
return
ptr_T;
306
}
307
347
virtual
Sint32
compare
(
const
IData
* lhs,
const
IData
* rhs) = 0;
348
359
virtual
const
IString
*
dump
(
const
IData
* data,
const
char
* name = 0,
Size
depth = 0) = 0;
360
366
virtual
const
IStructure_decl
*
get_structure_decl
(
const
char
* structure_name)
const
= 0;
367
373
virtual
const
ICall_decl
*
get_call_decl
(
const
char
* call_name)
const
= 0;
374
380
virtual
const
IEnum_decl
*
get_enum_decl
(
const
char
* enum_name)
const
= 0;
381
};
382
383
mi_static_assert
(
sizeof
(
IFactory::Assign_result
) ==
sizeof
(
Uint32
));
384
mi_static_assert
(
sizeof
(
IFactory::Assign_clone_options
) ==
sizeof
(
Uint32
));
385
// end group mi_neuray_types
387
388
}
// namespace neuraylib
389
390
}
// namespace mi
391
392
#endif // MI_NEURAYLIB_IFACTORY_H
mi
neuraylib
ifactory.h
Generated on Fri Mar 4 2016 19:53:39. Build 250909.11169, Doxygen 1.8.4