Panda3D
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  */
17 INLINE InterrogateElement::
18 InterrogateElement(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  */
37 INLINE InterrogateElement::
38 InterrogateElement(const InterrogateElement &copy) {
39  (*this) = copy;
40 }
41 
42 /**
43  *
44  */
45 INLINE void InterrogateElement::
46 operator = (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  */
67 INLINE bool InterrogateElement::
68 is_global() const {
69  return (_flags & F_global) != 0;
70 }
71 
72 /**
73  *
74  */
75 INLINE bool InterrogateElement::
76 has_scoped_name() const {
77  return !_scoped_name.empty();
78 }
79 
80 /**
81  *
82  */
83 INLINE const std::string &InterrogateElement::
84 get_scoped_name() const {
85  return _scoped_name;
86 }
87 
88 /**
89  *
90  */
91 INLINE bool InterrogateElement::
92 has_comment() const {
93  return !_comment.empty();
94 }
95 
96 /**
97  *
98  */
99 INLINE const std::string &InterrogateElement::
100 get_comment() const {
101  return _comment;
102 }
103 
104 /**
105  *
106  */
107 INLINE TypeIndex InterrogateElement::
108 get_type() const {
109  return _type;
110 }
111 
112 /**
113  *
114  */
115 INLINE bool InterrogateElement::
116 has_getter() const {
117  return (_flags & F_has_getter) != 0;
118 }
119 
120 /**
121  *
122  */
123 INLINE FunctionIndex InterrogateElement::
124 get_getter() const {
125  return _getter;
126 }
127 
128 /**
129  *
130  */
131 INLINE bool InterrogateElement::
132 has_setter() const {
133  return (_flags & F_has_setter) != 0;
134 }
135 
136 /**
137  *
138  */
139 INLINE FunctionIndex InterrogateElement::
140 get_setter() const {
141  return _setter;
142 }
143 
144 /**
145  *
146  */
147 INLINE bool InterrogateElement::
148 has_has_function() const {
149  return (_flags & F_has_has_function) != 0;
150 }
151 
152 /**
153  *
154  */
155 INLINE FunctionIndex InterrogateElement::
156 get_has_function() const {
157  return _has_function;
158 }
159 
160 /**
161  *
162  */
163 INLINE bool InterrogateElement::
164 has_clear_function() const {
165  return (_flags & F_has_clear_function) != 0;
166 }
167 
168 /**
169  *
170  */
171 INLINE FunctionIndex InterrogateElement::
172 get_clear_function() const {
173  return _clear_function;
174 }
175 
176 /**
177  *
178  */
179 INLINE bool InterrogateElement::
180 has_del_function() const {
181  return (_flags & F_has_del_function) != 0;
182 }
183 
184 /**
185  *
186  */
187 INLINE FunctionIndex InterrogateElement::
188 get_del_function() const {
189  return _del_function;
190 }
191 
192 /**
193  *
194  */
195 INLINE bool InterrogateElement::
196 has_insert_function() const {
197  return (_flags & F_has_insert_function) != 0;
198 }
199 
200 /**
201  *
202  */
203 INLINE FunctionIndex InterrogateElement::
204 get_insert_function() const {
205  return _insert_function;
206 }
207 
208 /**
209  *
210  */
211 INLINE bool InterrogateElement::
212 has_getkey_function() const {
213  return (_flags & F_has_getkey_function) != 0;
214 }
215 
216 /**
217  *
218  */
219 INLINE FunctionIndex InterrogateElement::
220 get_getkey_function() const {
221  return _getkey_function;
222 }
223 
224 /**
225  *
226  */
227 INLINE bool InterrogateElement::
228 is_sequence() const {
229  return (_flags & F_sequence) != 0;
230 }
231 
232 /**
233  *
234  */
235 INLINE FunctionIndex InterrogateElement::
236 get_length_function() const {
237  return _length_function;
238 }
239 
240 /**
241  *
242  */
243 INLINE bool InterrogateElement::
244 is_mapping() const {
245  return (_flags & F_mapping) != 0;
246 }
247 
248 
249 INLINE std::ostream &
250 operator << (std::ostream &out, const InterrogateElement &element) {
251  element.output(out);
252  return out;
253 }
254 
255 INLINE std::istream &
256 operator >> (std::istream &in, InterrogateElement &element) {
257  element.input(in);
258  return in;
259 }
void input(std::istream &in)
Reads the data file as previously formatted by output().
bool is_global() const
Returns true if the element is marked as 'global'.
void output(std::ostream &out) const
Formats the InterrogateElement data for output to a data file.
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.