CrystalSpace

Public API Reference

csutil/profile.h

Go to the documentation of this file.
00001 /*
00002     Copyright (C) 2005 by Jorrit Tyberghein
00003 
00004     This library is free software; you can redistribute it and/or
00005     modify it under the terms of the GNU Library General Public
00006     License as published by the Free Software Foundation; either
00007     version 2 of the License, or (at your option) any later version.
00008 
00009     This library is distributed in the hope that it will be useful,
00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012     Library General Public License for more details.
00013 
00014     You should have received a copy of the GNU Library General Public
00015     License along with this library; if not, write to the Free
00016     Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00017 */
00018 
00019 #ifdef CS_COMPILER_GCC
00020   #warning Profiler support from csutil/profile.h has been deprecated. \
00021 Check ivaria/profile.h for new interface.
00022 #endif
00023 #ifdef CS_COMPILER_MSVC
00024   #pragma message ("Profiler support from csutil/profile.h has been deprecated. \
00025 Check ivaria/profile.h for new interface.")
00026 #endif
00027 
00028 #ifndef __CS_UTIL_PROFILE_H__
00029 #define __CS_UTIL_PROFILE_H__
00030 
00034 #include "csextern.h"
00035 #include "csutil/array.h"
00036 #include "csutil/csstring.h"
00037 #include "csutil/scf_implementation.h"
00038 #include "ivaria/profile.h"
00039 
00040 #include "csutil/win32/msvc_deprecated_warn_off.h"
00041 
00045 struct CS_DEPRECATED_TYPE_MSG("Old profiling discontinued; check docs for new API")
00046 csProfileInfo
00047 {
00048   const char* token;
00049   const char* file;
00050   int line;
00051   uint32* ptr_count;
00052   uint32* ptr_time;
00053   uint32* ptr_timemin;
00054   uint32* ptr_timemax;
00055 };
00056 
00060 class CS_DEPRECATED_TYPE_MSG("Old profiling discontinued; check docs for new API")
00061 csProfiler : public scfImplementation0<csProfiler>
00062 {
00063 public:
00064   csArray<csProfileInfo> profile_info;
00065   csArray<CS::Debug::ProfileZone*> profile_zones;
00066   csArray<CS::Debug::ProfileCounter*> profile_counters;
00067 
00068 public:
00069   csProfiler () : scfImplementationType (this) {}
00070   virtual ~csProfiler () {}
00071 
00072   // Dummies to keep class compiling
00073   void Reset () {}
00074   CS::Debug::ProfileZone* GetProfileZone (const char* zonename)
00075   { return 0; }
00076   CS::Debug::ProfileCounter* GetProfileCounter (const char* countername)
00077   { return 0; }
00078   const csArray<CS::Debug::ProfileZone*>& GetProfileZones ()
00079   { return profile_zones; }
00080   const csArray<CS::Debug::ProfileCounter*>& GetProfileCounters ()
00081   { return profile_counters; }
00082 };
00083 
00084 namespace CS
00085 {
00086   namespace Macros
00087   {
00088     CS_DEPRECATED_TYPE_MSG("Old profiling discontinued; check docs for new API")
00089     inline void CS_PROFTIME() {}
00090     CS_DEPRECATED_TYPE_MSG("Old profiling discontinued; check docs for new API")
00091     inline void CS_PROFRESET() {}
00092     CS_DEPRECATED_TYPE_MSG("Old profiling discontinued; check docs for new API")
00093     inline void CS_PROFDUMP() {}
00094     CS_DEPRECATED_TYPE_MSG("Old profiling discontinued; check docs for new API")
00095     inline void CS_PROFSTART() {}
00096     CS_DEPRECATED_TYPE_MSG("Old profiling discontinued; check docs for new API")
00097     inline void CS_PROFSTOP() {}
00098   } // namespace Macros
00099 } // namespace CS
00100 
00104 #define CS_PROFTIME(v) CS::Macros::CS_PROFTIME(); v = 0
00108 #define CS_PROFRESET(a) CS::Macros::CS_PROFRESET()
00112 #define CS_PROFDUMP(a) CS::Macros::CS_PROFDUMP()
00116 #define CS_PROFSTART(a,b) CS::Macros::CS_PROFSTART()
00120 #define CS_PROFSTOP(a) CS::Macros::CS_PROFSTOP()
00121 
00122 #include "csutil/win32/msvc_deprecated_warn_on.h"
00123 
00124 #endif //__CS_UTIL_PROFILE_H__
00125 

Generated for Crystal Space 1.2.1 by doxygen 1.5.3