Panda3D

dcClass.I

00001 // Filename: dcClass.I
00002 // Created by:  drose (15Sep04)
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: DCClass::get_dc_file
00018 //       Access: Published
00019 //  Description: Returns the DCFile object that contains the class.
00020 ////////////////////////////////////////////////////////////////////
00021 INLINE DCFile *DCClass::
00022 get_dc_file() const {
00023   return _dc_file;
00024 }
00025 
00026 ////////////////////////////////////////////////////////////////////
00027 //     Function: DCClass::get_name
00028 //       Access: Published
00029 //  Description: Returns the name of this class.
00030 ////////////////////////////////////////////////////////////////////
00031 INLINE const string &DCClass::
00032 get_name() const {
00033   return _name;
00034 }
00035 
00036 ////////////////////////////////////////////////////////////////////
00037 //     Function: DCClass::get_number
00038 //       Access: Published
00039 //  Description: Returns a unique index number associated with this
00040 //               class.  This is defined implicitly when the .dc
00041 //               file(s) are read.
00042 ////////////////////////////////////////////////////////////////////
00043 INLINE int DCClass::
00044 get_number() const {
00045   return _number;
00046 }
00047 
00048 ////////////////////////////////////////////////////////////////////
00049 //     Function: DCClass::is_struct
00050 //       Access: Published
00051 //  Description: Returns true if the class has been identified with
00052 //               the "struct" keyword in the dc file, false if it was
00053 //               declared with "dclass".
00054 ////////////////////////////////////////////////////////////////////
00055 INLINE bool DCClass::
00056 is_struct() const {
00057   return _is_struct;
00058 }
00059 
00060 ////////////////////////////////////////////////////////////////////
00061 //     Function: DCClass::is_bogus_class
00062 //       Access: Published
00063 //  Description: Returns true if the class has been flagged as a bogus
00064 //               class.  This is set for classes that are generated by
00065 //               the parser as placeholder for missing classes, as
00066 //               when reading a partial file; it should not occur in a
00067 //               normal valid dc file.
00068 ////////////////////////////////////////////////////////////////////
00069 INLINE bool DCClass::
00070 is_bogus_class() const {
00071   return _bogus_class;
00072 }
00073 
00074 ////////////////////////////////////////////////////////////////////
00075 //     Function: DCClass::start_generate
00076 //       Access: Published
00077 //  Description: Starts the PStats timer going on the "generate" task,
00078 //               that is, marks the beginning of the process of
00079 //               generating a new object, for the purposes of timing
00080 //               this process.
00081 //
00082 //               This should balance with a corresponding call to
00083 //               stop_generate().
00084 ////////////////////////////////////////////////////////////////////
00085 INLINE void DCClass::
00086 start_generate() {
00087 #ifdef WITHIN_PANDA
00088   _class_generate_pcollector.start();
00089 #endif
00090 }
00091 
00092 ////////////////////////////////////////////////////////////////////
00093 //     Function: DCClass::stop_generate
00094 //       Access: Published
00095 //  Description: Stops the PStats timer on the "generate" task.
00096 //               This should balance with a preceding call to
00097 //               start_generate().
00098 ////////////////////////////////////////////////////////////////////
00099 INLINE void DCClass::
00100 stop_generate() {
00101 #ifdef WITHIN_PANDA
00102   _class_generate_pcollector.stop();
00103 #endif
00104 }
 All Classes Functions Variables Enumerations