Panda3D
interrogateDatabase.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 interrogateDatabase.I
10  * @author drose
11  * @date 2000-08-01
12  */
13 
14 /**
15  * Checks that all the latest data for all the libraries have been loaded.
16  * Loads them if not.
17  */
18 INLINE void InterrogateDatabase::
19 check_latest() {
20  if (!_requests.empty()) {
21  load_latest();
22  }
23 }
24 
25 /**
26  * Returns the TypeIndex associated with the first type found with the given
27  * name, or 0 if no type has this name.
28  */
29 INLINE TypeIndex InterrogateDatabase::
30 lookup_type_by_name(const std::string &name) {
31  check_latest();
32  return lookup(name, _types_by_name, LT_type_name,
33  &InterrogateDatabase::freshen_types_by_name);
34 }
35 
36 /**
37  * Returns the TypeIndex associated with the first type found with the given
38  * scoped name, or 0 if no type has this name.
39  */
40 INLINE TypeIndex InterrogateDatabase::
41 lookup_type_by_scoped_name(const std::string &name) {
42  check_latest();
43  return lookup(name, _types_by_scoped_name, LT_type_scoped_name,
44  &InterrogateDatabase::freshen_types_by_scoped_name);
45 }
46 
47 /**
48  * Returns the TypeIndex associated with the first type found with the given
49  * true name, or 0 if no type has this name.
50  */
51 INLINE TypeIndex InterrogateDatabase::
52 lookup_type_by_true_name(const std::string &name) {
53  check_latest();
54  return lookup(name, _types_by_true_name, LT_type_true_name,
55  &InterrogateDatabase::freshen_types_by_true_name);
56 }
57 
58 /**
59  * Returns the ManifestIndex associated with the first manifest found with the
60  * given name, or 0 if no manifest has this name.
61  */
62 INLINE ManifestIndex InterrogateDatabase::
63 lookup_manifest_by_name(const std::string &name) {
64  check_latest();
65  return lookup(name, _manifests_by_name, LT_manifest_name,
66  &InterrogateDatabase::freshen_manifests_by_name);
67 }
68 
69 /**
70  * Returns the ElementIndex associated with the first element found with the
71  * given name, or 0 if no element has this name.
72  */
73 INLINE ElementIndex InterrogateDatabase::
74 lookup_element_by_name(const std::string &name) {
75  check_latest();
76  return lookup(name, _elements_by_name, LT_element_name,
77  &InterrogateDatabase::freshen_elements_by_name);
78 }
79 
80 /**
81  * Returns the ElementIndex associated with the first element found with the
82  * given scoped name, or 0 if no element has this name.
83  */
84 INLINE ElementIndex InterrogateDatabase::
85 lookup_element_by_scoped_name(const std::string &name) {
86  check_latest();
87  return lookup(name, _elements_by_scoped_name, LT_element_scoped_name,
88  &InterrogateDatabase::freshen_elements_by_scoped_name);
89 }
ElementIndex lookup_element_by_scoped_name(const std::string &name)
Returns the ElementIndex associated with the first element found with the given scoped name,...
ManifestIndex lookup_manifest_by_name(const std::string &name)
Returns the ManifestIndex associated with the first manifest found with the given name,...
TypeIndex lookup_type_by_scoped_name(const std::string &name)
Returns the TypeIndex associated with the first type found with the given scoped name,...
ElementIndex lookup_element_by_name(const std::string &name)
Returns the ElementIndex associated with the first element found with the given name,...
TypeIndex lookup_type_by_name(const std::string &name)
Returns the TypeIndex associated with the first type found with the given name, or 0 if no type has t...
TypeIndex lookup_type_by_true_name(const std::string &name)
Returns the TypeIndex associated with the first type found with the given true name,...