HDK
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
GLTF_CodecRegistry.h
Go to the documentation of this file.
1
#ifndef __GLTF_CodecRegistry_h__
2
#define __GLTF_CodecRegistry_h__
3
4
#include "
GLTFZ_API.h
"
5
6
#include <
UT/UT_Array.h
>
7
#include <
UT/UT_StringHolder.h
>
8
#include <
UT/UT_UniquePtr.h
>
9
10
#define GLTF_REGISTER_CODEC(cls, name) \
11
struct cls##_CodecEntryInstantiator \
12
{ \
13
cls##_CodecEntryInstantiator() \
14
{ \
15
UT_UniquePtr<GLTF_CodecRegistry::EntryBase> cls##_CodecEntry( \
16
new GLTF_CodecRegistry::Entry<cls>(name)); \
17
GLTFgetCodecRegistry()->registerEntry(std::move(cls##_CodecEntry)); \
18
} \
19
}; \
20
static cls##_CodecEntryInstantiator the##cls##CodecEntry;
21
22
class
GLTFZ_API
GLTF_CodecRegistry
23
{
24
public
:
25
26
class
EntryBase
27
{
28
public
:
29
EntryBase
(
const
char
*
name
)
30
: myCodecName(name) {}
31
virtual
~EntryBase
() {}
32
virtual
bool
isExtensionSupported(
const
char
* ext_name)
const
= 0;
33
34
private
:
35
36
UT_StringHolder
myCodecName;
37
};
38
39
template
<
typename
T>
40
class
Entry
:
public
EntryBase
41
{
42
public
:
43
Entry
(
const
char
*
name
)
44
:
EntryBase
(name)
45
{
46
47
}
48
~
Entry
()
override
=
default
;
49
50
bool
isExtensionSupported
(
const
char
* ext_name)
const override
51
{
52
return
T::isExtensionSupported(ext_name);
53
}
54
};
55
56
public
:
57
58
GLTF_CodecRegistry
() =
default
;
59
~
GLTF_CodecRegistry
() =
default
;
60
GLTF_CodecRegistry
(
const
GLTF_CodecRegistry
& other) =
delete
;
61
GLTF_CodecRegistry
&
operator=
(
const
GLTF_CodecRegistry
& other) =
delete
;
62
GLTF_CodecRegistry
(
GLTF_CodecRegistry
&& other) =
default
;
63
64
void
registerEntry(
UT_UniquePtr<EntryBase>
&& entry);
65
bool
isExtensionSupported(
const
char
* ext_name)
const
;
66
67
private
:
68
69
UT_Array<UT_UniquePtr<EntryBase>
> myCodecs;
70
71
};
72
73
GLTFZ_API
extern
GLTF_CodecRegistry
*
GLTFgetCodecRegistry
();
74
75
#endif // __GLTF_CodecRegistry_h__
GLTF_CodecRegistry::EntryBase::~EntryBase
virtual ~EntryBase()
Definition:
GLTF_CodecRegistry.h:31
GLTFgetCodecRegistry
GLTFZ_API GLTF_CodecRegistry * GLTFgetCodecRegistry()
GLTF_CodecRegistry::EntryBase
Definition:
GLTF_CodecRegistry.h:26
GLTF_CodecRegistry::EntryBase::EntryBase
EntryBase(const char *name)
Definition:
GLTF_CodecRegistry.h:29
GLTF_CodecRegistry::Entry::Entry
Entry(const char *name)
Definition:
GLTF_CodecRegistry.h:43
UT_Array.h
UT_Array
Definition:
BV_KDOPTree.h:18
GLTF_CodecRegistry::Entry
Definition:
GLTF_CodecRegistry.h:40
UT_UniquePtr
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
Definition:
UT_UniquePtr.h:39
UT_StringHolder
Definition:
UT_StringHolder.h:1074
GLTF_CodecRegistry
Definition:
GLTF_CodecRegistry.h:22
GLTF_CodecRegistry::Entry::isExtensionSupported
bool isExtensionSupported(const char *ext_name) const override
Definition:
GLTF_CodecRegistry.h:50
name
GLuint const GLchar * name
Definition:
glcorearb.h:786
UT_UniquePtr.h
UT_StringHolder.h
nanovdb::operator=
LeafData & operator=(const LeafData &)=delete
GLTFZ_API.h
GLTFZ_API
#define GLTFZ_API
Definition:
GLTFZ_API.h:37
GLTFZ
GLTF_CodecRegistry.h
Generated on Mon Aug 24 2026 02:26:05 for HDK by
1.8.6