Panda3D
|
00001 // Filename: interrogateDatabase.I 00002 // Created by: drose (01Aug00) 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 // Function: InterrogateDatabase::check_latest 00018 // Access: Public 00019 // Description: Checks that all the latest data for all the libraries 00020 // have been loaded. Loads them if not. 00021 //////////////////////////////////////////////////////////////////// 00022 INLINE void InterrogateDatabase:: 00023 check_latest() { 00024 if (!_requests.empty()) { 00025 load_latest(); 00026 } 00027 } 00028 00029 //////////////////////////////////////////////////////////////////// 00030 // Function: InterrogateDatabase::lookup_type_by_name 00031 // Access: Public 00032 // Description: Returns the TypeIndex associated with the first type 00033 // found with the given name, or 0 if no type has this 00034 // name. 00035 //////////////////////////////////////////////////////////////////// 00036 INLINE TypeIndex InterrogateDatabase:: 00037 lookup_type_by_name(const string &name) { 00038 check_latest(); 00039 return lookup(name, _types_by_name, LT_type_name, 00040 &InterrogateDatabase::freshen_types_by_name); 00041 } 00042 00043 //////////////////////////////////////////////////////////////////// 00044 // Function: InterrogateDatabase::lookup_type_by_scoped_name 00045 // Access: Public 00046 // Description: Returns the TypeIndex associated with the first type 00047 // found with the given scoped name, or 0 if no type has 00048 // this name. 00049 //////////////////////////////////////////////////////////////////// 00050 INLINE TypeIndex InterrogateDatabase:: 00051 lookup_type_by_scoped_name(const string &name) { 00052 check_latest(); 00053 return lookup(name, _types_by_scoped_name, LT_type_scoped_name, 00054 &InterrogateDatabase::freshen_types_by_scoped_name); 00055 } 00056 00057 //////////////////////////////////////////////////////////////////// 00058 // Function: InterrogateDatabase::lookup_type_by_true_name 00059 // Access: Public 00060 // Description: Returns the TypeIndex associated with the first type 00061 // found with the given true name, or 0 if no type has 00062 // this name. 00063 //////////////////////////////////////////////////////////////////// 00064 INLINE TypeIndex InterrogateDatabase:: 00065 lookup_type_by_true_name(const string &name) { 00066 check_latest(); 00067 return lookup(name, _types_by_true_name, LT_type_true_name, 00068 &InterrogateDatabase::freshen_types_by_true_name); 00069 } 00070 00071 //////////////////////////////////////////////////////////////////// 00072 // Function: InterrogateDatabase::lookup_manifest_by_name 00073 // Access: Public 00074 // Description: Returns the ManifestIndex associated with the first 00075 // manifest found with the given name, or 0 if no 00076 // manifest has this name. 00077 //////////////////////////////////////////////////////////////////// 00078 INLINE ManifestIndex InterrogateDatabase:: 00079 lookup_manifest_by_name(const string &name) { 00080 check_latest(); 00081 return lookup(name, _manifests_by_name, LT_manifest_name, 00082 &InterrogateDatabase::freshen_manifests_by_name); 00083 } 00084 00085 //////////////////////////////////////////////////////////////////// 00086 // Function: InterrogateDatabase::lookup_element_by_name 00087 // Access: Public 00088 // Description: Returns the ElementIndex associated with the first 00089 // element found with the given name, or 0 if no element 00090 // has this name. 00091 //////////////////////////////////////////////////////////////////// 00092 INLINE ElementIndex InterrogateDatabase:: 00093 lookup_element_by_name(const string &name) { 00094 check_latest(); 00095 return lookup(name, _elements_by_name, LT_element_name, 00096 &InterrogateDatabase::freshen_elements_by_name); 00097 } 00098 00099 //////////////////////////////////////////////////////////////////// 00100 // Function: InterrogateDatabase::lookup_element_by_scoped_name 00101 // Access: Public 00102 // Description: Returns the ElementIndex associated with the first 00103 // element found with the given scoped name, or 0 if no 00104 // element has this name. 00105 //////////////////////////////////////////////////////////////////// 00106 INLINE ElementIndex InterrogateDatabase:: 00107 lookup_element_by_scoped_name(const string &name) { 00108 check_latest(); 00109 return lookup(name, _elements_by_scoped_name, LT_element_scoped_name, 00110 &InterrogateDatabase::freshen_elements_by_scoped_name); 00111 }