forked from panda3d/panda3d
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypeManager.h
More file actions
156 lines (138 loc) · 5.75 KB
/
typeManager.h
File metadata and controls
156 lines (138 loc) · 5.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
/**
* PANDA 3D SOFTWARE
* Copyright (c) Carnegie Mellon University. All rights reserved.
*
* All use of this software is subject to the terms of the revised BSD
* license. You should have received a copy of this license along
* with this source code in a file named "LICENSE."
*
* @file typeManager.h
* @author drose
* @date 2000-08-14
*/
#ifndef TYPEMANAGER_H
#define TYPEMANAGER_H
#include "dtoolbase.h"
class CPPFunctionGroup;
class CPPInstance;
class CPPType;
class CPPSimpleType;
class CPPPointerType;
class CPPConstType;
class CPPExtensionType;
class CPPStructType;
class CPPEnumType;
class CPPFunctionType;
class CPPScope;
class CPPIdentifier;
class CPPNameComponent;
class CPPManifest;
/**
* This is just a collection of static methods that perform useful operations
* on CPPTypes for interrogate. The class is really just a namespace that
* groups these functions together.
*/
class TypeManager {
public:
static CPPType *resolve_type(CPPType *type, CPPScope *scope = nullptr);
static bool is_assignable(CPPType *type);
static bool is_reference(CPPType *type);
static bool is_rvalue_reference(CPPType *type);
static bool is_ref_to_anything(CPPType *type);
static bool is_const_ref_to_anything(CPPType *type);
static bool is_const_pointer_to_anything(CPPType *type);
static bool is_const_pointer_or_ref(CPPType *type);
static bool is_non_const_pointer_or_ref(CPPType *type);
static bool is_pointer(CPPType *type);
static bool is_const(CPPType *type);
static bool is_struct(CPPType *type);
static bool is_scoped_enum(CPPType *type);
static bool is_enum(CPPType *type);
static bool is_const_enum(CPPType *type);
static bool is_const_ref_to_enum(CPPType *type);
static bool is_nullptr(CPPType *type);
static bool is_simple(CPPType *type);
static bool is_const_simple(CPPType *type);
static bool is_const_ref_to_simple(CPPType *type);
static bool is_ref_to_simple(CPPType *type);
static bool is_simple_array(CPPType *type);
static bool is_pointer_to_simple(CPPType *type);
static bool is_pointable(CPPType *type);
static bool is_char(CPPType *type);
static bool is_unsigned_char(CPPType *type);
static bool is_signed_char(CPPType *type);
static bool is_char_pointer(CPPType *type);
static bool is_const_char_pointer(CPPType *type);
static bool is_unsigned_char_pointer(CPPType *type);
static bool is_const_unsigned_char_pointer(CPPType *type);
static bool is_basic_string_char(CPPType *type);
static bool is_const_basic_string_char(CPPType *type);
static bool is_const_ref_to_basic_string_char(CPPType *type);
static bool is_const_ptr_to_basic_string_char(CPPType *type);
static bool is_string(CPPType *type);
static bool is_wchar(CPPType *type);
static bool is_wchar_pointer(CPPType *type);
static bool is_basic_string_wchar(CPPType *type);
static bool is_const_basic_string_wchar(CPPType *type);
static bool is_const_ref_to_basic_string_wchar(CPPType *type);
static bool is_const_ptr_to_basic_string_wchar(CPPType *type);
static bool is_wstring(CPPType *type);
static bool is_vector_unsigned_char(CPPType *type);
static bool is_const_vector_unsigned_char(CPPType *type);
static bool is_pair(CPPType *type);
static bool is_bool(CPPType *type);
static bool is_integer(CPPType *type);
static bool is_unsigned_integer(CPPType *type);
static bool is_size(CPPType *type);
static bool is_ssize(CPPType *type);
static bool is_long(CPPType *type);
static bool is_short(CPPType *type);
static bool is_unsigned_short(CPPType *type);
static bool is_longlong(CPPType *type);
static bool is_unsigned_longlong(CPPType *type);
static bool is_double(CPPType *type);
static bool is_float(CPPType *type);
static bool is_void(CPPType *type);
static bool is_reference_count(CPPType *type);
static bool is_reference_count_pointer(CPPType *type);
static bool is_pointer_to_base(CPPType *type);
static bool is_const_pointer_to_base(CPPType *type);
static bool is_const_ref_to_pointer_to_base(CPPType *type);
static bool is_pointer_to_PyObject(CPPType *type);
static bool is_PyObject(CPPType *type);
static bool is_pointer_to_PyTypeObject(CPPType *type);
static bool is_PyTypeObject(CPPType *type);
static bool is_pointer_to_PyStringObject(CPPType *type);
static bool is_PyStringObject(CPPType *type);
static bool is_pointer_to_PyUnicodeObject(CPPType *type);
static bool is_PyUnicodeObject(CPPType *type);
static bool is_pointer_to_Py_buffer(CPPType *type);
static bool is_Py_buffer(CPPType *type);
static bool is_handle(CPPType *type);
static bool involves_unpublished(CPPType *type);
static bool involves_protected(CPPType *type);
static bool is_ostream(CPPType *type);
static bool is_pointer_to_ostream(CPPType *type);
static CPPType *unwrap_pointer(CPPType *type);
static CPPType *unwrap_reference(CPPType *type);
static CPPType *unwrap_const(CPPType *type);
static CPPType *unwrap_const_reference(CPPType *type);
static CPPType *unwrap(CPPType *type);
static CPPType *get_pointer_type(CPPStructType *pt_type);
static CPPType *get_template_parameter_type(CPPType *type, int i = 0);
static CPPType *wrap_pointer(CPPType *type);
static CPPType *wrap_const_pointer(CPPType *type);
static CPPType *wrap_const_reference(CPPType *type);
static CPPType *get_basic_string_char_type();
static CPPType *get_basic_string_wchar_type();
static CPPType *get_reference_count_type();
static CPPType *get_void_type();
static CPPType *get_int_type();
static std::string get_function_signature(CPPInstance *function,
int num_default_parameters = 0);
static std::string get_function_name(CPPInstance *function);
static bool has_protected_destructor(CPPType *type);
static bool is_exported(CPPType *type);
static bool is_local(CPPType *type);
};
#endif