Panda3D
 All Classes Functions Variables Enumerations
interrogateElement.I
1 // Filename: interrogateElement.I
2 // Created by: drose (11Aug00)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 
16 ////////////////////////////////////////////////////////////////////
17 // Element: InterrogateElement::Constructor
18 // Access: Public
19 // Description:
20 ////////////////////////////////////////////////////////////////////
21 INLINE InterrogateElement::
22 InterrogateElement(InterrogateModuleDef *def) :
24 {
25  _flags = 0;
26  _type = 0;
27  _getter = 0;
28  _setter = 0;
29 }
30 
31 ////////////////////////////////////////////////////////////////////
32 // Element: InterrogateElement::Copy Constructor
33 // Access: Public
34 // Description:
35 ////////////////////////////////////////////////////////////////////
36 INLINE InterrogateElement::
37 InterrogateElement(const InterrogateElement &copy) {
38  (*this) = copy;
39 }
40 
41 ////////////////////////////////////////////////////////////////////
42 // Element: InterrogateElement::Copy Assignment Operator
43 // Access: Public
44 // Description:
45 ////////////////////////////////////////////////////////////////////
46 INLINE void InterrogateElement::
47 operator = (const InterrogateElement &copy) {
48  InterrogateComponent::operator = (copy);
49  _flags = copy._flags;
50  _scoped_name = copy._scoped_name;
51  _comment = copy._comment;
52  _type = copy._type;
53  _getter = copy._getter;
54  _setter = copy._setter;
55 }
56 
57 ////////////////////////////////////////////////////////////////////
58 // Function: InterrogateElement::is_global
59 // Access: Public
60 // Description: Returns true if the element is marked as 'global'.
61 // This means only that it should appear in the global
62 // element list.
63 ////////////////////////////////////////////////////////////////////
64 INLINE bool InterrogateElement::
65 is_global() const {
66  return (_flags & F_global) != 0;
67 }
68 
69 ////////////////////////////////////////////////////////////////////
70 // Function: InterrogateElement::has_scoped_name
71 // Access: Public
72 // Description:
73 ////////////////////////////////////////////////////////////////////
74 INLINE bool InterrogateElement::
75 has_scoped_name() const {
76  return !_scoped_name.empty();
77 }
78 
79 ////////////////////////////////////////////////////////////////////
80 // Function: InterrogateElement::get_scoped_name
81 // Access: Public
82 // Description:
83 ////////////////////////////////////////////////////////////////////
84 INLINE const string &InterrogateElement::
85 get_scoped_name() const {
86  return _scoped_name;
87 }
88 
89 ////////////////////////////////////////////////////////////////////
90 // Function: InterrogateElement::has_comment
91 // Access: Public
92 // Description:
93 ////////////////////////////////////////////////////////////////////
94 INLINE bool InterrogateElement::
95 has_comment() const {
96  return !_comment.empty();
97 }
98 
99 ////////////////////////////////////////////////////////////////////
100 // Function: InterrogateElement::get_comment
101 // Access: Public
102 // Description:
103 ////////////////////////////////////////////////////////////////////
104 INLINE const string &InterrogateElement::
105 get_comment() const {
106  return _comment;
107 }
108 
109 ////////////////////////////////////////////////////////////////////
110 // Element: InterrogateElement::get_type
111 // Access: Public
112 // Description:
113 ////////////////////////////////////////////////////////////////////
114 INLINE TypeIndex InterrogateElement::
115 get_type() const {
116  return _type;
117 }
118 
119 ////////////////////////////////////////////////////////////////////
120 // Element: InterrogateElement::has_getter
121 // Access: Public
122 // Description:
123 ////////////////////////////////////////////////////////////////////
124 INLINE bool InterrogateElement::
125 has_getter() const {
126  return (_flags & F_has_getter) != 0;
127 }
128 
129 ////////////////////////////////////////////////////////////////////
130 // Element: InterrogateElement::get_getter
131 // Access: Public
132 // Description:
133 ////////////////////////////////////////////////////////////////////
134 INLINE FunctionIndex InterrogateElement::
135 get_getter() const {
136  return _getter;
137 }
138 
139 ////////////////////////////////////////////////////////////////////
140 // Element: InterrogateElement::has_setter
141 // Access: Public
142 // Description:
143 ////////////////////////////////////////////////////////////////////
144 INLINE bool InterrogateElement::
145 has_setter() const {
146  return (_flags & F_has_setter) != 0;
147 }
148 
149 ////////////////////////////////////////////////////////////////////
150 // Element: InterrogateElement::get_setter
151 // Access: Public
152 // Description:
153 ////////////////////////////////////////////////////////////////////
154 INLINE FunctionIndex InterrogateElement::
155 get_setter() const {
156  return _setter;
157 }
158 
159 
160 INLINE ostream &
161 operator << (ostream &out, const InterrogateElement &element) {
162  element.output(out);
163  return out;
164 }
165 
166 INLINE istream &
167 operator >> (istream &in, InterrogateElement &element) {
168  element.input(in);
169  return in;
170 }
The base class for things that are part of the interrogate database.
void input(istream &in)
Reads the data file as previously formatted by output().
bool is_global() const
Returns true if the element is marked as &#39;global&#39;.
An internal representation of a data element, like a data member or a global variable.
void output(ostream &out) const
Formats the InterrogateElement data for output to a data file.