Panda3D
dcClass.I
1 // Filename: dcClass.I
2 // Created by: drose (15Sep04)
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: DCClass::get_dc_file
18 // Access: Published
19 // Description: Returns the DCFile object that contains the class.
20 ////////////////////////////////////////////////////////////////////
21 INLINE DCFile *DCClass::
22 get_dc_file() const {
23  return _dc_file;
24 }
25 
26 ////////////////////////////////////////////////////////////////////
27 // Function: DCClass::get_name
28 // Access: Published
29 // Description: Returns the name of this class.
30 ////////////////////////////////////////////////////////////////////
31 INLINE const string &DCClass::
32 get_name() const {
33  return _name;
34 }
35 
36 ////////////////////////////////////////////////////////////////////
37 // Function: DCClass::get_number
38 // Access: Published
39 // Description: Returns a unique index number associated with this
40 // class. This is defined implicitly when the .dc
41 // file(s) are read.
42 ////////////////////////////////////////////////////////////////////
43 INLINE int DCClass::
44 get_number() const {
45  return _number;
46 }
47 
48 ////////////////////////////////////////////////////////////////////
49 // Function: DCClass::is_struct
50 // Access: Published
51 // Description: Returns true if the class has been identified with
52 // the "struct" keyword in the dc file, false if it was
53 // declared with "dclass".
54 ////////////////////////////////////////////////////////////////////
55 INLINE bool DCClass::
56 is_struct() const {
57  return _is_struct;
58 }
59 
60 ////////////////////////////////////////////////////////////////////
61 // Function: DCClass::is_bogus_class
62 // Access: Published
63 // Description: Returns true if the class has been flagged as a bogus
64 // class. This is set for classes that are generated by
65 // the parser as placeholder for missing classes, as
66 // when reading a partial file; it should not occur in a
67 // normal valid dc file.
68 ////////////////////////////////////////////////////////////////////
69 INLINE bool DCClass::
70 is_bogus_class() const {
71  return _bogus_class;
72 }
73 
74 ////////////////////////////////////////////////////////////////////
75 // Function: DCClass::start_generate
76 // Access: Published
77 // Description: Starts the PStats timer going on the "generate" task,
78 // that is, marks the beginning of the process of
79 // generating a new object, for the purposes of timing
80 // this process.
81 //
82 // This should balance with a corresponding call to
83 // stop_generate().
84 ////////////////////////////////////////////////////////////////////
85 INLINE void DCClass::
87 #ifdef WITHIN_PANDA
88  _class_generate_pcollector.start();
89 #endif
90 }
91 
92 ////////////////////////////////////////////////////////////////////
93 // Function: DCClass::stop_generate
94 // Access: Published
95 // Description: Stops the PStats timer on the "generate" task.
96 // This should balance with a preceding call to
97 // start_generate().
98 ////////////////////////////////////////////////////////////////////
99 INLINE void DCClass::
101 #ifdef WITHIN_PANDA
102  _class_generate_pcollector.stop();
103 #endif
104 }
DCFile * get_dc_file() const
Returns the DCFile object that contains the class.
Definition: dcClass.I:22
void stop_generate()
Stops the PStats timer on the "generate" task.
Definition: dcClass.I:100
bool is_struct() const
Returns true if the class has been identified with the "struct" keyword in the dc file...
Definition: dcClass.I:56
int get_number() const
Returns a unique index number associated with this class.
Definition: dcClass.I:44
void start_generate()
Starts the PStats timer going on the "generate" task, that is, marks the beginning of the process of ...
Definition: dcClass.I:86
Represents the complete list of Distributed Class descriptions as read from a .dc file...
Definition: dcFile.h:34
const string & get_name() const
Returns the name of this class.
Definition: dcClass.I:32
bool is_bogus_class() const
Returns true if the class has been flagged as a bogus class.
Definition: dcClass.I:70