00001 // Filename: pStatThread.h 00002 // Created by: drose (11Jul00) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved 00008 // 00009 // All use of this software is subject to the terms of the Panda 3d 00010 // Software license. You should have received a copy of this license 00011 // along with this source code; you will also find a current copy of 00012 // the license at http://www.panda3d.org/license.txt . 00013 // 00014 // To contact the maintainers of this program write to 00015 // panda3d@yahoogroups.com . 00016 // 00017 //////////////////////////////////////////////////////////////////// 00018 00019 #ifndef PSTATTHREAD_H 00020 #define PSTATTHREAD_H 00021 00022 #include <pandabase.h> 00023 00024 #include "pStatClient.h" 00025 00026 //////////////////////////////////////////////////////////////////// 00027 // Class : PStatThread 00028 // Description : A lightweight class that represents a single thread 00029 // of execution to PStats. It doesn't have any real 00030 // connection to any actual threads, but it's used to 00031 // differentiate tasks which run in different threads, 00032 // so we can measure them properly. It is presently the 00033 // user's responsibility to correctly differentiate the 00034 // various threads. 00035 //////////////////////////////////////////////////////////////////// 00036 class EXPCL_PANDA PStatThread { 00037 private: 00038 INLINE PStatThread(); 00039 INLINE PStatThread(PStatClient *client, int index); 00040 00041 public: 00042 INLINE PStatThread(const string &name, PStatClient *client = NULL); 00043 00044 INLINE PStatThread(const PStatThread ©); 00045 INLINE void operator = (const PStatThread ©); 00046 00047 INLINE void new_frame(); 00048 00049 private: 00050 PStatClient *_client; 00051 int _index; 00052 00053 friend class PStatClient; 00054 friend class PStatCollector; 00055 }; 00056 00057 #include "pStatThread.I" 00058 00059 #endif 00060