Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

dtool/src/interrogatedb/interrogateType.I

Go to the documentation of this file.
00001 // Filename: interrogateType.I
00002 // Created by:  drose (31Jul00)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) 2001, Disney Enterprises, Inc.  All rights reserved
00008 //
00009 // All use of this software is subject to the terms of the Panda 3d
00010 // Software license.  You should have received a copy of this license
00011 // along with this source code; you will also find a current copy of
00012 // the license at http://www.panda3d.org/license.txt .
00013 //
00014 // To contact the maintainers of this program write to
00015 // panda3d@yahoogroups.com .
00016 //
00017 ////////////////////////////////////////////////////////////////////
00018 
00019 
00020 ////////////////////////////////////////////////////////////////////
00021 //     Function: InterrogateType::Constructor
00022 //       Access: Public
00023 //  Description:
00024 ////////////////////////////////////////////////////////////////////
00025 INLINE InterrogateType::
00026 InterrogateType(InterrogateModuleDef *def) :
00027   InterrogateComponent(def)
00028 {
00029   _flags = 0;
00030   _outer_class = 0;
00031   _atomic_token = AT_not_atomic;
00032   _wrapped_type = 0;
00033   _destructor = 0;
00034 
00035   _cpptype = (CPPType *)NULL;
00036   _cppscope = (CPPScope *)NULL;
00037 }
00038 
00039 ////////////////////////////////////////////////////////////////////
00040 //     Function: InterrogateType::Copy Constructor
00041 //       Access: Public
00042 //  Description:
00043 ////////////////////////////////////////////////////////////////////
00044 INLINE InterrogateType::
00045 InterrogateType(const InterrogateType &copy) {
00046   (*this) = copy;
00047 }
00048 
00049 ////////////////////////////////////////////////////////////////////
00050 //     Function: InterrogateType::is_global
00051 //       Access: Public
00052 //  Description: Returns true if the type is marked as 'global'.  This
00053 //               means only that it should appear in the global type
00054 //               list.
00055 ////////////////////////////////////////////////////////////////////
00056 INLINE bool InterrogateType::
00057 is_global() const {
00058   return (_flags & F_global) != 0;
00059 }
00060 
00061 ////////////////////////////////////////////////////////////////////
00062 //     Function: InterrogateType::has_scoped_name
00063 //       Access: Public
00064 //  Description:
00065 ////////////////////////////////////////////////////////////////////
00066 INLINE bool InterrogateType::
00067 has_scoped_name() const {
00068   return !_scoped_name.empty();
00069 }
00070 
00071 ////////////////////////////////////////////////////////////////////
00072 //     Function: InterrogateType::get_scoped_name
00073 //       Access: Public
00074 //  Description:
00075 ////////////////////////////////////////////////////////////////////
00076 INLINE const string &InterrogateType::
00077 get_scoped_name() const {
00078   return _scoped_name;
00079 }
00080 
00081 ////////////////////////////////////////////////////////////////////
00082 //     Function: InterrogateType::has_true_name
00083 //       Access: Public
00084 //  Description:
00085 ////////////////////////////////////////////////////////////////////
00086 INLINE bool InterrogateType::
00087 has_true_name() const {
00088   return !_true_name.empty();
00089 }
00090 
00091 ////////////////////////////////////////////////////////////////////
00092 //     Function: InterrogateType::get_true_name
00093 //       Access: Public
00094 //  Description:
00095 ////////////////////////////////////////////////////////////////////
00096 INLINE const string &InterrogateType::
00097 get_true_name() const {
00098   return _true_name;
00099 }
00100 
00101 ////////////////////////////////////////////////////////////////////
00102 //     Function: InterrogateType::has_comment
00103 //       Access: Public
00104 //  Description:
00105 ////////////////////////////////////////////////////////////////////
00106 INLINE bool InterrogateType::
00107 has_comment() const {
00108   return !_comment.empty();
00109 }
00110 
00111 ////////////////////////////////////////////////////////////////////
00112 //     Function: InterrogateType::get_comment
00113 //       Access: Public
00114 //  Description:
00115 ////////////////////////////////////////////////////////////////////
00116 INLINE const string &InterrogateType::
00117 get_comment() const {
00118   return _comment;
00119 }
00120 
00121 ////////////////////////////////////////////////////////////////////
00122 //     Function: InterrogateType::is_nested
00123 //       Access: Public
00124 //  Description: Returns true if this type is nested within some class
00125 //               definition.
00126 ////////////////////////////////////////////////////////////////////
00127 INLINE bool InterrogateType::
00128 is_nested() const {
00129   return (_flags & F_nested) != 0;
00130 }
00131 
00132 ////////////////////////////////////////////////////////////////////
00133 //     Function: InterrogateType::get_outer_class
00134 //       Access: Public
00135 //  Description: If is_nested() returns true, this is the class within
00136 //               which this type is defined.
00137 ////////////////////////////////////////////////////////////////////
00138 INLINE TypeIndex InterrogateType::
00139 get_outer_class() const {
00140   return _outer_class;
00141 }
00142 
00143 ////////////////////////////////////////////////////////////////////
00144 //     Function: InterrogateType::is_atomic
00145 //       Access: Public
00146 //  Description:
00147 ////////////////////////////////////////////////////////////////////
00148 INLINE bool InterrogateType::
00149 is_atomic() const {
00150   return (_flags & F_atomic) != 0;
00151 }
00152 
00153 ////////////////////////////////////////////////////////////////////
00154 //     Function: InterrogateType::get_atomic_token
00155 //       Access: Public
00156 //  Description:
00157 ////////////////////////////////////////////////////////////////////
00158 INLINE AtomicToken InterrogateType::
00159 get_atomic_token() const {
00160   return _atomic_token;
00161 }
00162 
00163 ////////////////////////////////////////////////////////////////////
00164 //     Function: InterrogateType::is_unsigned
00165 //       Access: Public
00166 //  Description:
00167 ////////////////////////////////////////////////////////////////////
00168 INLINE bool InterrogateType::
00169 is_unsigned() const {
00170   return (_flags & F_unsigned) != 0;
00171 }
00172 
00173 ////////////////////////////////////////////////////////////////////
00174 //     Function: InterrogateType::is_signed
00175 //       Access: Public
00176 //  Description:
00177 ////////////////////////////////////////////////////////////////////
00178 INLINE bool InterrogateType::
00179 is_signed() const {
00180   return (_flags & F_signed) != 0;
00181 }
00182 
00183 ////////////////////////////////////////////////////////////////////
00184 //     Function: InterrogateType::is_long
00185 //       Access: Public
00186 //  Description:
00187 ////////////////////////////////////////////////////////////////////
00188 INLINE bool InterrogateType::
00189 is_long() const {
00190   return (_flags & F_long) != 0;
00191 }
00192 
00193 ////////////////////////////////////////////////////////////////////
00194 //     Function: InterrogateType::is_longlong
00195 //       Access: Public
00196 //  Description:
00197 ////////////////////////////////////////////////////////////////////
00198 INLINE bool InterrogateType::
00199 is_longlong() const {
00200   return (_flags & F_longlong) != 0;
00201 }
00202 
00203 ////////////////////////////////////////////////////////////////////
00204 //     Function: InterrogateType::is_short
00205 //       Access: Public
00206 //  Description:
00207 ////////////////////////////////////////////////////////////////////
00208 INLINE bool InterrogateType::
00209 is_short() const {
00210   return (_flags & F_short) != 0;
00211 }
00212 
00213 ////////////////////////////////////////////////////////////////////
00214 //     Function: InterrogateType::is_wrapped
00215 //       Access: Public
00216 //  Description:
00217 ////////////////////////////////////////////////////////////////////
00218 INLINE bool InterrogateType::
00219 is_wrapped() const {
00220   return (_flags & F_wrapped) != 0;
00221 }
00222 
00223 ////////////////////////////////////////////////////////////////////
00224 //     Function: InterrogateType::is_pointer
00225 //       Access: Public
00226 //  Description:
00227 ////////////////////////////////////////////////////////////////////
00228 INLINE bool InterrogateType::
00229 is_pointer() const {
00230   return (_flags & F_pointer) != 0;
00231 }
00232 
00233 ////////////////////////////////////////////////////////////////////
00234 //     Function: InterrogateType::is_const
00235 //       Access: Public
00236 //  Description:
00237 ////////////////////////////////////////////////////////////////////
00238 INLINE bool InterrogateType::
00239 is_const() const {
00240   return (_flags & F_const) != 0;
00241 }
00242 
00243 ////////////////////////////////////////////////////////////////////
00244 //     Function: InterrogateType::get_wrapped_type
00245 //       Access: Public
00246 //  Description:
00247 ////////////////////////////////////////////////////////////////////
00248 INLINE TypeIndex InterrogateType::
00249 get_wrapped_type() const {
00250   return _wrapped_type;
00251 }
00252 
00253 ////////////////////////////////////////////////////////////////////
00254 //     Function: InterrogateType::is_enum
00255 //       Access: Public
00256 //  Description:
00257 ////////////////////////////////////////////////////////////////////
00258 INLINE bool InterrogateType::
00259 is_enum() const {
00260   return (_flags & F_enum) != 0;
00261 }
00262 
00263 ////////////////////////////////////////////////////////////////////
00264 //     Function: InterrogateType::number_of_enum_values
00265 //       Access: Public
00266 //  Description:
00267 ////////////////////////////////////////////////////////////////////
00268 INLINE int InterrogateType::
00269 number_of_enum_values() const {
00270   return _enum_values.size();
00271 }
00272 
00273 ////////////////////////////////////////////////////////////////////
00274 //     Function: InterrogateType::get_enum_value_name
00275 //       Access: Public
00276 //  Description:
00277 ////////////////////////////////////////////////////////////////////
00278 INLINE const string &InterrogateType::
00279 get_enum_value_name(int n) const {
00280   if (n >= 0 && n < (int)_enum_values.size()) {
00281     return _enum_values[n]._name;
00282   }
00283   return _empty_string;
00284 }
00285 
00286 ////////////////////////////////////////////////////////////////////
00287 //     Function: InterrogateType::get_enum_value_scoped_name
00288 //       Access: Public
00289 //  Description:
00290 ////////////////////////////////////////////////////////////////////
00291 INLINE const string &InterrogateType::
00292 get_enum_value_scoped_name(int n) const {
00293   if (n >= 0 && n < (int)_enum_values.size()) {
00294     return _enum_values[n]._scoped_name;
00295   }
00296   return _empty_string;
00297 }
00298 
00299 ////////////////////////////////////////////////////////////////////
00300 //     Function: InterrogateType::get_enum_value
00301 //       Access: Public
00302 //  Description:
00303 ////////////////////////////////////////////////////////////////////
00304 INLINE int InterrogateType::
00305 get_enum_value(int n) const {
00306   if (n >= 0 && n < (int)_enum_values.size()) {
00307     return _enum_values[n]._value;
00308   }
00309   return 0;
00310 }
00311 
00312 ////////////////////////////////////////////////////////////////////
00313 //     Function: InterrogateType::is_struct
00314 //       Access: Public
00315 //  Description:
00316 ////////////////////////////////////////////////////////////////////
00317 INLINE bool InterrogateType::
00318 is_struct() const {
00319   return (_flags & F_struct) != 0;
00320 }
00321 
00322 ////////////////////////////////////////////////////////////////////
00323 //     Function: InterrogateType::is_class
00324 //       Access: Public
00325 //  Description:
00326 ////////////////////////////////////////////////////////////////////
00327 INLINE bool InterrogateType::
00328 is_class() const {
00329   return (_flags & F_class) != 0;
00330 }
00331 
00332 ////////////////////////////////////////////////////////////////////
00333 //     Function: InterrogateType::is_union
00334 //       Access: Public
00335 //  Description:
00336 ////////////////////////////////////////////////////////////////////
00337 INLINE bool InterrogateType::
00338 is_union() const {
00339   return (_flags & F_union) != 0;
00340 }
00341 
00342 ////////////////////////////////////////////////////////////////////
00343 //     Function: InterrogateType::is_fully_defined
00344 //       Access: Public
00345 //  Description:
00346 ////////////////////////////////////////////////////////////////////
00347 INLINE bool InterrogateType::
00348 is_fully_defined() const {
00349   return (_flags & F_fully_defined) != 0;
00350 }
00351 
00352 ////////////////////////////////////////////////////////////////////
00353 //     Function: InterrogateType::is_unpublished
00354 //       Access: Public
00355 //  Description: Returns true if the type is an unpublished type.
00356 //               This either means the type is a nested type, and it
00357 //               is protected or private within its scope, or that its
00358 //               definition is simply not marked as 'published'.
00359 ////////////////////////////////////////////////////////////////////
00360 INLINE bool InterrogateType::
00361 is_unpublished() const {
00362   return (_flags & F_unpublished) != 0;
00363 }
00364 
00365 ////////////////////////////////////////////////////////////////////
00366 //     Function: InterrogateType::number_of_constructors
00367 //       Access: Public
00368 //  Description:
00369 ////////////////////////////////////////////////////////////////////
00370 INLINE int InterrogateType::
00371 number_of_constructors() const {
00372   return _constructors.size();
00373 }
00374 
00375 ////////////////////////////////////////////////////////////////////
00376 //     Function: InterrogateType::get_constructor
00377 //       Access: Public
00378 //  Description:
00379 ////////////////////////////////////////////////////////////////////
00380 INLINE FunctionIndex InterrogateType::
00381 get_constructor(int n) const {
00382   if (n >= 0 && n < (int)_constructors.size()) {
00383     return _constructors[n];
00384   } else {
00385     return 0;
00386   }
00387 }
00388 
00389 ////////////////////////////////////////////////////////////////////
00390 //     Function: InterrogateType::has_destructor
00391 //       Access: Public
00392 //  Description:
00393 ////////////////////////////////////////////////////////////////////
00394 INLINE bool InterrogateType::
00395 has_destructor() const {
00396   return (_destructor != 0);
00397 }
00398 
00399 ////////////////////////////////////////////////////////////////////
00400 //     Function: InterrogateType::destructor_is_inherited
00401 //       Access: Public
00402 //  Description:
00403 ////////////////////////////////////////////////////////////////////
00404 INLINE bool InterrogateType::
00405 destructor_is_inherited() const {
00406   return (_flags & F_inherited_destructor) != 0;
00407 }
00408 
00409 ////////////////////////////////////////////////////////////////////
00410 //     Function: InterrogateType::get_destructor
00411 //       Access: Public
00412 //  Description:
00413 ////////////////////////////////////////////////////////////////////
00414 INLINE FunctionIndex InterrogateType::
00415 get_destructor() const {
00416   return _destructor;
00417 }
00418 
00419 ////////////////////////////////////////////////////////////////////
00420 //     Function: InterrogateType::number_of_elements
00421 //       Access: Public
00422 //  Description:
00423 ////////////////////////////////////////////////////////////////////
00424 INLINE int InterrogateType::
00425 number_of_elements() const {
00426   return _elements.size();
00427 }
00428 
00429 ////////////////////////////////////////////////////////////////////
00430 //     Function: InterrogateType::get_element
00431 //       Access: Public
00432 //  Description:
00433 ////////////////////////////////////////////////////////////////////
00434 INLINE ElementIndex InterrogateType::
00435 get_element(int n) const {
00436   if (n >= 0 && n < (int)_elements.size()) {
00437     return _elements[n];
00438   } else {
00439     return 0;
00440   }
00441 }
00442 
00443 ////////////////////////////////////////////////////////////////////
00444 //     Function: InterrogateType::number_of_methods
00445 //       Access: Public
00446 //  Description:
00447 ////////////////////////////////////////////////////////////////////
00448 INLINE int InterrogateType::
00449 number_of_methods() const {
00450   return _methods.size();
00451 }
00452 
00453 ////////////////////////////////////////////////////////////////////
00454 //     Function: InterrogateType::get_method
00455 //       Access: Public
00456 //  Description:
00457 ////////////////////////////////////////////////////////////////////
00458 INLINE FunctionIndex InterrogateType::
00459 get_method(int n) const {
00460   if (n >= 0 && n < (int)_methods.size()) {
00461     return _methods[n];
00462   } else {
00463     return 0;
00464   }
00465 }
00466 
00467 ////////////////////////////////////////////////////////////////////
00468 //     Function: InterrogateType::number_of_casts
00469 //       Access: Public
00470 //  Description:
00471 ////////////////////////////////////////////////////////////////////
00472 INLINE int InterrogateType::
00473 number_of_casts() const {
00474   return _casts.size();
00475 }
00476 
00477 ////////////////////////////////////////////////////////////////////
00478 //     Function: InterrogateType::get_cast
00479 //       Access: Public
00480 //  Description:
00481 ////////////////////////////////////////////////////////////////////
00482 INLINE FunctionIndex InterrogateType::
00483 get_cast(int n) const {
00484   if (n >= 0 && n < (int)_casts.size()) {
00485     return _casts[n];
00486   } else {
00487     return 0;
00488   }
00489 }
00490 
00491 ////////////////////////////////////////////////////////////////////
00492 //     Function: InterrogateType::number_of_derivations
00493 //       Access: Public
00494 //  Description:
00495 ////////////////////////////////////////////////////////////////////
00496 INLINE int InterrogateType::
00497 number_of_derivations() const {
00498   return _derivations.size();
00499 }
00500 
00501 ////////////////////////////////////////////////////////////////////
00502 //     Function: InterrogateType::get_derivation
00503 //       Access: Public
00504 //  Description:
00505 ////////////////////////////////////////////////////////////////////
00506 INLINE TypeIndex InterrogateType::
00507 get_derivation(int n) const {
00508   if (n >= 0 && n < (int)_derivations.size()) {
00509     return _derivations[n]._base;
00510   } else {
00511     return 0;
00512   }
00513 }
00514 
00515 ////////////////////////////////////////////////////////////////////
00516 //     Function: InterrogateType::derivation_has_upcast
00517 //       Access: Public
00518 //  Description:
00519 ////////////////////////////////////////////////////////////////////
00520 INLINE bool InterrogateType::
00521 derivation_has_upcast(int n) const {
00522   if (n >= 0 && n < (int)_derivations.size()) {
00523     return (_derivations[n]._flags & DF_upcast) != 0;
00524   } else {
00525     return false;
00526   }
00527 }
00528 
00529 ////////////////////////////////////////////////////////////////////
00530 //     Function: InterrogateType::derivation_get_upcast
00531 //       Access: Public
00532 //  Description:
00533 ////////////////////////////////////////////////////////////////////
00534 INLINE TypeIndex InterrogateType::
00535 derivation_get_upcast(int n) const {
00536   if (n >= 0 && n < (int)_derivations.size()) {
00537     return _derivations[n]._upcast;
00538   } else {
00539     return 0;
00540   }
00541 }
00542 
00543 ////////////////////////////////////////////////////////////////////
00544 //     Function: InterrogateType::derivation_downcast_is_impossible
00545 //       Access: Public
00546 //  Description:
00547 ////////////////////////////////////////////////////////////////////
00548 INLINE bool InterrogateType::
00549 derivation_downcast_is_impossible(int n) const {
00550   if (n >= 0 && n < (int)_derivations.size()) {
00551     return (_derivations[n]._flags & DF_downcast_impossible) != 0;
00552   } else {
00553     return false;
00554   }
00555 }
00556 
00557 ////////////////////////////////////////////////////////////////////
00558 //     Function: InterrogateType::derivation_has_downcast
00559 //       Access: Public
00560 //  Description:
00561 ////////////////////////////////////////////////////////////////////
00562 INLINE bool InterrogateType::
00563 derivation_has_downcast(int n) const {
00564   if (n >= 0 && n < (int)_derivations.size()) {
00565     return (_derivations[n]._flags & DF_downcast) != 0;
00566   } else {
00567     return false;
00568   }
00569 }
00570 
00571 ////////////////////////////////////////////////////////////////////
00572 //     Function: InterrogateType::derivation_get_downcast
00573 //       Access: Public
00574 //  Description:
00575 ////////////////////////////////////////////////////////////////////
00576 INLINE TypeIndex InterrogateType::
00577 derivation_get_downcast(int n) const {
00578   if (n >= 0 && n < (int)_derivations.size()) {
00579     return _derivations[n]._downcast;
00580   } else {
00581     return 0;
00582   }
00583 }
00584 
00585 ////////////////////////////////////////////////////////////////////
00586 //     Function: InterrogateType::number_of_nested_types
00587 //       Access: Public
00588 //  Description:
00589 ////////////////////////////////////////////////////////////////////
00590 INLINE int InterrogateType::
00591 number_of_nested_types() const {
00592   return _nested_types.size();
00593 }
00594 
00595 ////////////////////////////////////////////////////////////////////
00596 //     Function: InterrogateType::get_nested_type
00597 //       Access: Public
00598 //  Description:
00599 ////////////////////////////////////////////////////////////////////
00600 INLINE TypeIndex InterrogateType::
00601 get_nested_type(int n) const {
00602   if (n >= 0 && n < (int)_nested_types.size()) {
00603     return _nested_types[n];
00604   } else {
00605     return 0;
00606   }
00607 }
00608 
00609 INLINE ostream &
00610 operator << (ostream &out, const InterrogateType &type) {
00611   type.output(out);
00612   return out;
00613 }
00614 
00615 INLINE istream &
00616 operator >> (istream &in, InterrogateType &type) {
00617   type.input(in);
00618   return in;
00619 }
00620 
00621 INLINE ostream &
00622 operator << (ostream &out, const InterrogateType::Derivation &d) {
00623   d.output(out);
00624   return out;
00625 }
00626 
00627 INLINE istream &
00628 operator >> (istream &in, InterrogateType::Derivation &d) {
00629   d.input(in);
00630   return in;
00631 }
00632 
00633 INLINE ostream &
00634 operator << (ostream &out, const InterrogateType::EnumValue &ev) {
00635   ev.output(out);
00636   return out;
00637 }
00638 
00639 INLINE istream &
00640 operator >> (istream &in, InterrogateType::EnumValue &ev) {
00641   ev.input(in);
00642   return in;
00643 }
00644 

Generated on Thu May 1 22:13:07 2003 for DTool by doxygen1.3