7#ifndef MI_NEURAYLIB_IDENTIFIER_H
8#define MI_NEURAYLIB_IDENTIFIER_H
29 HND_SCENE_GRAPH_VERSION,
31 HND_SCENE_GRAPH_OBJECT_NODE,
32 HND_SCENE_GRAPH_LIGHT_NODE,
34 HND_SCENE_GRAPH_MATERIAL,
35 HND_SCENE_GRAPH_DECAL_NODE,
36 HND_SCENE_GRAPH_PROJECTOR_NODE,
37 HND_SCENE_GRAPH_SECTION_OBJECT_NODE
40template <
typename T>
struct Invalid_identifier { };
41template <>
struct Invalid_identifier<
Uint32>
43 static inline Uint32 value( ) {
return 0xffffffff; }
46template <>
struct Invalid_identifier<
Uint64>
48 static inline Uint64 value( ) {
return 0xffffffffffffffffull; }
54template <Identifier_name name,
typename Int_type = U
int32>
64template <Identifier_name name,
typename Int_type = U
int32>
78 operator Int_type()
const {
return this->
m_id; }
84 bool is_valid( )
const {
return this->
m_id != Invalid_identifier<Int_type>::value(); }
Handle class for type-safety.
Definition: identifier.h:66
unsigned long long Uint64
64-bit unsigned integer.
Definition: types.h:62
unsigned int Uint32
32-bit unsigned integer.
Definition: types.h:49
Identifier & operator++()
Pre-increment operator.
Definition: identifier.h:87
Identifier & operator--()
Pre-decrement operator.
Definition: identifier.h:93
bool operator>=(const Identifier &other) const
Greater-than-or-equal-to operator.
Definition: identifier.h:108
Int_type operator*() const
Dereferences the handle. Returns its integer value.
Definition: identifier.h:81
Int_type m_id
The handle ID.
Definition: identifier.h:58
bool operator>(const Identifier &other) const
Greater-than operator.
Definition: identifier.h:105
Identifier operator--(int)
Post-decrement operator.
Definition: identifier.h:96
bool operator<=(const Identifier &other) const
Less-than-or-equal-to operator.
Definition: identifier.h:102
Identifier operator++(int)
Post-increment operator.
Definition: identifier.h:90
bool operator<(const Identifier &other) const
Less-than operator.
Definition: identifier.h:99
Identifier()
Default constructor. Initializes handle with invalid value.
Definition: identifier.h:69
Identifier(Int_type h)
Constructor. Initializes handle with given integer value.
Definition: identifier.h:72
bool is_valid() const
Returns whether the handle is valid.
Definition: identifier.h:84
Identifier(Identifier_struct<name, Int_type> h)
Constructor from underlying storage type.
Definition: identifier.h:75
Identifier_name
Various handle types.
Definition: identifier.h:21
@ HND_CURVE_SEGMENT
Curve_segment_handle
Definition: identifier.h:26
@ HND_SURFACE
Surface_handle
Definition: identifier.h:24
@ HND_CURVE
Curve_handle
Definition: identifier.h:25
@ HND_TRIANGLE
Triangle_handle
Definition: identifier.h:22
@ HND_FIBER
Fiber_handle
Definition: identifier.h:28
@ HND_TEXTURE_SURFACE
Texture_surface_handle
Definition: identifier.h:27
@ HND_POLY
Polygon_handle
Definition: identifier.h:23
Common namespace for APIs of NVIDIA Advanced Rendering Center GmbH.
Definition: neuraylib.h:179
Handle class for type-safety.
Definition: identifier.h:56