Panda3D
Loading...
Searching...
No Matches
interrogateElement.I
Go to the documentation of this file.
1/**
2 * PANDA 3D SOFTWARE
3 * Copyright (c) Carnegie Mellon University. All rights reserved.
4 *
5 * All use of this software is subject to the terms of the revised BSD
6 * license. You should have received a copy of this license along
7 * with this source code in a file named "LICENSE."
8 *
9 * @file interrogateElement.I
10 * @author drose
11 * @date 2000-08-11
12 */
13
14/**
15 *
16 */
17INLINE InterrogateElement::
18InterrogateElement(InterrogateModuleDef *def) :
20{
21 _flags = 0;
22 _type = 0;
23 _getter = 0;
24 _setter = 0;
25 _has_function = 0;
26 _clear_function = 0;
27 _del_function = 0;
28 _insert_function = 0;
29 _getkey_function = 0;
30 _length_function = 0;
31 _make_property = nullptr;
32}
33
34/**
35 *
36 */
37INLINE InterrogateElement::
38InterrogateElement(const InterrogateElement &copy) {
39 (*this) = copy;
40}
41
42/**
43 *
44 */
45INLINE void InterrogateElement::
46operator = (const InterrogateElement &copy) {
47 InterrogateComponent::operator = (copy);
48 _flags = copy._flags;
49 _scoped_name = copy._scoped_name;
50 _comment = copy._comment;
51 _type = copy._type;
52 _getter = copy._getter;
53 _setter = copy._setter;
54 _has_function = copy._has_function;
55 _clear_function = copy._clear_function;
56 _del_function = copy._del_function;
57 _insert_function = copy._insert_function;
58 _getkey_function = copy._getkey_function;
59 _length_function = copy._length_function;
60 _make_property = copy._make_property;
61}
62
63/**
64 * Returns true if the element is marked as 'global'. This means only that it
65 * should appear in the global element list.
66 */
68is_global() const {
69 return (_flags & F_global) != 0;
70}
71
72/**
73 *
74 */
75INLINE bool InterrogateElement::
76has_scoped_name() const {
77 return !_scoped_name.empty();
78}
79
80/**
81 *
82 */
83INLINE const std::string &InterrogateElement::
84get_scoped_name() const {
85 return _scoped_name;
86}
87
88/**
89 *
90 */
91INLINE bool InterrogateElement::
92has_comment() const {
93 return !_comment.empty();
94}
95
96/**
97 *
98 */
99INLINE const std::string &InterrogateElement::
100get_comment() const {
101 return _comment;
102}
103
104/**
105 *
106 */
107INLINE TypeIndex InterrogateElement::
108get_type() const {
109 return _type;
110}
111
112/**
113 *
114 */
115INLINE bool InterrogateElement::
116has_getter() const {
117 return (_flags & F_has_getter) != 0;
118}
119
120/**
121 *
122 */
123INLINE FunctionIndex InterrogateElement::
124get_getter() const {
125 return _getter;
126}
127
128/**
129 *
130 */
131INLINE bool InterrogateElement::
132has_setter() const {
133 return (_flags & F_has_setter) != 0;
134}
135
136/**
137 *
138 */
139INLINE FunctionIndex InterrogateElement::
140get_setter() const {
141 return _setter;
142}
143
144/**
145 *
146 */
147INLINE bool InterrogateElement::
148has_has_function() const {
149 return (_flags & F_has_has_function) != 0;
150}
151
152/**
153 *
154 */
155INLINE FunctionIndex InterrogateElement::
156get_has_function() const {
157 return _has_function;
158}
159
160/**
161 *
162 */
163INLINE bool InterrogateElement::
164has_clear_function() const {
165 return (_flags & F_has_clear_function) != 0;
166}
167
168/**
169 *
170 */
171INLINE FunctionIndex InterrogateElement::
172get_clear_function() const {
173 return _clear_function;
174}
175
176/**
177 *
178 */
179INLINE bool InterrogateElement::
180has_del_function() const {
181 return (_flags & F_has_del_function) != 0;
182}
183
184/**
185 *
186 */
187INLINE FunctionIndex InterrogateElement::
188get_del_function() const {
189 return _del_function;
190}
191
192/**
193 *
194 */
195INLINE bool InterrogateElement::
196has_insert_function() const {
197 return (_flags & F_has_insert_function) != 0;
198}
199
200/**
201 *
202 */
203INLINE FunctionIndex InterrogateElement::
204get_insert_function() const {
205 return _insert_function;
206}
207
208/**
209 *
210 */
211INLINE bool InterrogateElement::
212has_getkey_function() const {
213 return (_flags & F_has_getkey_function) != 0;
214}
215
216/**
217 *
218 */
219INLINE FunctionIndex InterrogateElement::
220get_getkey_function() const {
221 return _getkey_function;
222}
223
224/**
225 *
226 */
227INLINE bool InterrogateElement::
228is_sequence() const {
229 return (_flags & F_sequence) != 0;
230}
231
232/**
233 *
234 */
235INLINE FunctionIndex InterrogateElement::
236get_length_function() const {
237 return _length_function;
238}
239
240/**
241 *
242 */
243INLINE bool InterrogateElement::
244is_mapping() const {
245 return (_flags & F_mapping) != 0;
246}
247
248
249INLINE std::ostream &
250operator << (std::ostream &out, const InterrogateElement &element) {
251 element.output(out);
252 return out;
253}
254
255INLINE std::istream &
256operator >> (std::istream &in, InterrogateElement &element) {
257 element.input(in);
258 return in;
259}
The base class for things that are part of the interrogate database.
An internal representation of a data element, like a data member or a global variable.
void output(std::ostream &out) const
Formats the InterrogateElement data for output to a data file.
bool is_global() const
Returns true if the element is marked as 'global'.
void input(std::istream &in)
Reads the data file as previously formatted by output().