Panda3D
attribNodeRegistry.I
1 // Filename: attribNodeRegistry.I
2 // Created by: drose (07Jul07)
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 // Function: AttribNodeRegistry::get_global_ptr
18 // Access: Published, Static
19 // Description:
20 ////////////////////////////////////////////////////////////////////
21 INLINE AttribNodeRegistry *AttribNodeRegistry::
22 get_global_ptr() {
23  if (_global_ptr == (AttribNodeRegistry *)NULL) {
24  make_global_ptr();
25  }
26  return _global_ptr;
27 }
28 
29 ////////////////////////////////////////////////////////////////////
30 // Function: AttribNodeRegistry::Entry::Constructor
31 // Access: Public
32 // Description:
33 ////////////////////////////////////////////////////////////////////
34 INLINE AttribNodeRegistry::Entry::
35 Entry(const NodePath &node) :
36  _type(node.node()->get_type()),
37  _name(node.get_name()),
38  _node(node)
39 {
40 }
41 
42 ////////////////////////////////////////////////////////////////////
43 // Function: AttribNodeRegistry::Entry::Constructor
44 // Access: Public
45 // Description:
46 ////////////////////////////////////////////////////////////////////
47 INLINE AttribNodeRegistry::Entry::
48 Entry(TypeHandle type, const string &name) :
49  _type(type),
50  _name(name)
51 {
52 }
53 
54 ////////////////////////////////////////////////////////////////////
55 // Function: AttribNodeRegistry::Entry::operator <
56 // Access: Public
57 // Description:
58 ////////////////////////////////////////////////////////////////////
59 INLINE bool AttribNodeRegistry::Entry::
60 operator < (const Entry &other) const {
61  if (_type != other._type) {
62  return _type < other._type;
63  }
64  return _name < other._name;
65 }
This global object records NodePaths that are referenced by scene graph attribs, such as ClipPlaneAtt...
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
Definition: nodePath.h:165