UGDK
0.4.1
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
type.h
Go to the documentation of this file.
1
2
#ifndef UGDK_SCRIPT_VIRTUALTYPE_H_
3
#define UGDK_SCRIPT_VIRTUALTYPE_H_
4
5
#include <vector>
6
7
#include <
ugdk/script/defs.h
>
8
9
namespace
ugdk {
10
11
namespace
script {
12
13
class
VirtualType
{
14
15
public
:
16
17
VirtualType
() : types_(10, (struct
swig_type_info
*)NULL) {}
18
~VirtualType
() {}
19
20
struct
swig_type_info
*
FromLang
(
LangID
id
)
const
{
21
return
types_[id];
22
}
23
24
void
RegisterFromLang
(
struct
swig_type_info
* info,
LangID
id
) {
25
if
(!types_[
id
]) types_[id] = info;
26
}
27
28
private
:
29
30
typedef
std::vector<struct swig_type_info*> TypeFromLang;
31
32
TypeFromLang types_;
33
34
};
35
36
37
template
<
class
T>
38
class
TypeRegistry
{
39
40
public
:
41
42
static
VirtualType
&
type
() {
43
return
type_;
44
}
45
46
private
:
47
48
TypeRegistry
() {}
49
50
static
VirtualType type_;
51
52
};
53
54
template
<
class
T>
55
VirtualType TypeRegistry<T>::type_;
56
57
}
/* namespace script */
58
59
}
/* namespace ugdk */
60
61
template
<
class
T>
62
static
void
RegisterType(T* tp) {
63
(void)tp;
64
}
65
66
template
<
typename
T>
67
T*
GetNull
() {
return
NULL; }
68
69
#endif
/* UGDK_SCRIPT_VIRTUALTYPE_H_ */
src
ugdk
script
type.h
Generated on Sat Oct 13 2012 02:25:11 for UGDK by
1.8.2