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
iserializer.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_ISERIALIZER_H
9
#define MI_NEURAYLIB_ISERIALIZER_H
10
11
#include <
mi/base/interface_declare.h
>
12
#include <
mi/neuraylib/version.h
>
13
14
namespace
mi {
15
16
namespace
neuraylib {
17
18
class
ISerializer;
19
class
IDeserializer;
20
34
struct
Tag_struct
45
{
47
Uint32
id
;
48
};
49
53
class
Tag
:
public
Tag_struct
54
{
55
public
:
59
Tag
() {
id
= 0; }
60
62
Tag
(
Tag_struct
tag_struct) {
id
= tag_struct.id; }
63
65
bool
is_valid
()
const
{
return
id
!= 0; }
66
71
typedef
bool (
Tag
::*
bool_conversion_support
)()
const
;
72
85
operator
bool_conversion_support
()
const
86
{
87
return
is_valid
() ? &
Tag::is_valid
: 0;
88
}
89
};
90
92
inline
bool
operator==
(
const
Tag
& lhs,
const
Tag
& rhs)
93
{
94
return
lhs.
id
== rhs.
id
;
95
}
96
98
inline
bool
operator!=
(
const
Tag
& lhs,
const
Tag
& rhs)
99
{
100
return
lhs.
id
!= rhs.
id
;
101
}
102
104
inline
bool
operator<
(
const
Tag
& lhs,
const
Tag
& rhs)
105
{
106
return
lhs.
id
< rhs.
id
;
107
}
108
110
inline
bool
operator>
(
const
Tag
& lhs,
const
Tag
& rhs)
111
{
112
return
lhs.
id
> rhs.
id
;
113
}
114
116
inline
bool
operator<=
(
const
Tag
& lhs,
const
Tag
& rhs)
117
{
118
return
lhs.
id
<= rhs.
id
;
119
}
120
122
inline
bool
operator>=
(
const
Tag
& lhs,
const
Tag
& rhs)
123
{
124
return
lhs.
id
>= rhs.
id
;
125
}
126
128
const
Tag
NULL_TAG
;
129
// end group mi_neuray_plugins / mi_neuray_dice
131
138
class
ISerializable
:
144
public
base::Interface_declare
<0x7a70f2fb,0x1b27,0x416f,0xaa,0x21,0x16,0xc7,0xb4,0xd4,0x1f,0xfc>
145
{
146
public
:
154
virtual
base::Uuid
get_class_id
()
const
= 0;
155
160
virtual
void
serialize
(
ISerializer
* serializer)
const
= 0;
161
166
virtual
void
deserialize
(
IDeserializer
* deserializer) = 0;
167
};
168
177
class
ISerializer
:
178
public
base::Interface_declare
<0xdcf5a659,0x2b06,0x436b,0x82,0x55,0x36,0x9d,0xbd,0xe7,0x42,0xb1>
179
{
180
public
:
185
virtual
bool
serialize
(
const
ISerializable
* serializable) = 0;
186
192
virtual
bool
write
(
const
bool
* value,
Size
count = 1) = 0;
193
199
virtual
bool
write
(
const
Uint8
* value,
Size
count = 1) = 0;
200
206
virtual
bool
write
(
const
Uint16
* value,
Size
count = 1) = 0;
207
213
virtual
bool
write
(
const
Uint32
* value,
Size
count = 1) = 0;
214
220
virtual
bool
write
(
const
Uint64
* value,
Size
count = 1) = 0;
221
227
virtual
bool
write
(
const
Sint8
* value,
Size
count = 1) = 0;
228
234
virtual
bool
write
(
const
Sint16
* value,
Size
count = 1) = 0;
235
241
virtual
bool
write
(
const
Sint32
* value,
Size
count = 1) = 0;
242
248
virtual
bool
write
(
const
Sint64
* value,
Size
count = 1) = 0;
249
255
virtual
bool
write
(
const
Float32
* value,
Size
count = 1) = 0;
256
262
virtual
bool
write
(
const
Float64
* value,
Size
count = 1) = 0;
263
269
virtual
void
reserve
(
Size
capacity) = 0;
270
279
virtual
void
flush
() = 0;
280
286
virtual
bool
write
(
const
Tag_struct
* value,
Size
count = 1) = 0;
287
};
288
// end group mi_neuray_plugins / mi_neuray_dice
290
291
}
// namespace neuraylib
292
293
#ifdef MI_NEURAYLIB_DEPRECATED_NAMESPACE_MI_TRANSITION
294
using
neuraylib::IDeserializer
;
295
using
neuraylib::ISerializable
;
296
using
neuraylib::ISerializer
;
297
using
neuraylib::Tag
;
298
using
neuraylib::Tag_struct
;
299
#endif // MI_NEURAYLIB_DEPRECATED_NAMESPACE_MI_TRANSITION
300
301
}
// namespace mi
302
303
#endif // MI_NEURAYLIB_ISERIALIZER_H
mi
neuraylib
iserializer.h
Generated on Fri Mar 4 2016 19:53:39. Build 250909.11169, Doxygen 1.8.4