00001 // Filename: interrogateElement.I 00002 // Created by: drose (11Aug00) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 00016 //////////////////////////////////////////////////////////////////// 00017 // Element: InterrogateElement::Constructor 00018 // Access: Public 00019 // Description: 00020 //////////////////////////////////////////////////////////////////// 00021 INLINE InterrogateElement:: 00022 InterrogateElement(InterrogateModuleDef *def) : 00023 InterrogateComponent(def) 00024 { 00025 _flags = 0; 00026 _type = 0; 00027 _getter = 0; 00028 _setter = 0; 00029 } 00030 00031 //////////////////////////////////////////////////////////////////// 00032 // Element: InterrogateElement::Copy Constructor 00033 // Access: Public 00034 // Description: 00035 //////////////////////////////////////////////////////////////////// 00036 INLINE InterrogateElement:: 00037 InterrogateElement(const InterrogateElement ©) { 00038 (*this) = copy; 00039 } 00040 00041 //////////////////////////////////////////////////////////////////// 00042 // Element: InterrogateElement::Copy Assignment Operator 00043 // Access: Public 00044 // Description: 00045 //////////////////////////////////////////////////////////////////// 00046 INLINE void InterrogateElement:: 00047 operator = (const InterrogateElement ©) { 00048 InterrogateComponent::operator = (copy); 00049 _flags = copy._flags; 00050 _scoped_name = copy._scoped_name; 00051 _type = copy._type; 00052 _getter = copy._getter; 00053 _setter = copy._setter; 00054 } 00055 00056 //////////////////////////////////////////////////////////////////// 00057 // Function: InterrogateElement::is_global 00058 // Access: Public 00059 // Description: Returns true if the element is marked as 'global'. 00060 // This means only that it should appear in the global 00061 // element list. 00062 //////////////////////////////////////////////////////////////////// 00063 INLINE bool InterrogateElement:: 00064 is_global() const { 00065 return (_flags & F_global) != 0; 00066 } 00067 00068 //////////////////////////////////////////////////////////////////// 00069 // Function: InterrogateElement::has_scoped_name 00070 // Access: Public 00071 // Description: 00072 //////////////////////////////////////////////////////////////////// 00073 INLINE bool InterrogateElement:: 00074 has_scoped_name() const { 00075 return !_scoped_name.empty(); 00076 } 00077 00078 //////////////////////////////////////////////////////////////////// 00079 // Function: InterrogateElement::get_scoped_name 00080 // Access: Public 00081 // Description: 00082 //////////////////////////////////////////////////////////////////// 00083 INLINE const string &InterrogateElement:: 00084 get_scoped_name() const { 00085 return _scoped_name; 00086 } 00087 00088 //////////////////////////////////////////////////////////////////// 00089 // Element: InterrogateElement::get_type 00090 // Access: Public 00091 // Description: 00092 //////////////////////////////////////////////////////////////////// 00093 INLINE TypeIndex InterrogateElement:: 00094 get_type() const { 00095 return _type; 00096 } 00097 00098 //////////////////////////////////////////////////////////////////// 00099 // Element: InterrogateElement::has_getter 00100 // Access: Public 00101 // Description: 00102 //////////////////////////////////////////////////////////////////// 00103 INLINE bool InterrogateElement:: 00104 has_getter() const { 00105 return (_flags & F_has_getter) != 0; 00106 } 00107 00108 //////////////////////////////////////////////////////////////////// 00109 // Element: InterrogateElement::get_getter 00110 // Access: Public 00111 // Description: 00112 //////////////////////////////////////////////////////////////////// 00113 INLINE FunctionIndex InterrogateElement:: 00114 get_getter() const { 00115 return _getter; 00116 } 00117 00118 //////////////////////////////////////////////////////////////////// 00119 // Element: InterrogateElement::has_setter 00120 // Access: Public 00121 // Description: 00122 //////////////////////////////////////////////////////////////////// 00123 INLINE bool InterrogateElement:: 00124 has_setter() const { 00125 return (_flags & F_has_setter) != 0; 00126 } 00127 00128 //////////////////////////////////////////////////////////////////// 00129 // Element: InterrogateElement::get_setter 00130 // Access: Public 00131 // Description: 00132 //////////////////////////////////////////////////////////////////// 00133 INLINE FunctionIndex InterrogateElement:: 00134 get_setter() const { 00135 return _setter; 00136 } 00137 00138 00139 INLINE ostream & 00140 operator << (ostream &out, const InterrogateElement &element) { 00141 element.output(out); 00142 return out; 00143 } 00144 00145 INLINE istream & 00146 operator >> (istream &in, InterrogateElement &element) { 00147 element.input(in); 00148 return in; 00149 }