#include <unix_timer_impl.h>
Public Member Functions | |
const std::string & | getClassName () const |
Returns name of class of our object. | |
const std::string & | getObjectName () const |
Returns name of our object. | |
void | getSpecificParameter (const std::string &ParameterName, void *ParameterValue) |
Method for obtaining some specific parameters, such as texture specific params, and so on. | |
double | getTime () |
double | getTime () |
bool | isLocked () const |
returns state of object. | |
template<> | |
Timer * | mSingleton |
template<> | |
Timer * | mSingleton |
template<> | |
Profiler * | mSingleton |
template<> | |
LogManager * | mSingleton |
template<> | |
debugger::Debugger * | mSingleton |
template<> | |
debugger::CommandParser * | mSingleton |
template<> | |
Application * | mSingleton |
Timer () | |
Timer () | |
~Timer () | |
~Timer () | |
Static Public Member Functions | |
static Timer & | getSingleton () |
Override standard Singleton retrieval. | |
static Timer & | getSingleton () |
Override standard Singleton retrieval. | |
static Timer * | getSingletonPtr () |
static Timer * | getSingletonPtr () |
Protected Member Functions | |
void | addSpecificParameter (const std::string &ParameterName, void *ParameterValue, size_t Size) |
void | lock () |
void | unlock () |
Static Protected Attributes | |
static T * | mSingleton |
Private Member Functions | |
__int64 | getCounter () |
Private Attributes | |
struct timeval | mCurrentTime |
__int64 | mFrequency |
bool | mIsStarted |
unsigned long | mProcAffinity |
__int64 | mStartTime |
unsigned long | mSysAffinity |
void * | mThread |
This class represent timer in Windows OS.
Definition at line 46 of file unix_timer_impl.h.
gpucalc::Timer::Timer | ( | ) |
Definition at line 61 of file unix_timer_impl.cpp.
00061 : Singleton<Timer>(_UnixTimerName) 00062 { 00063 }
gpucalc::Timer::~Timer | ( | ) |
gpucalc::Timer::Timer | ( | ) |
gpucalc::Timer::~Timer | ( | ) |
void gpucalc::Object::addSpecificParameter | ( | const std::string & | ParameterName, | |
void * | ParameterValue, | |||
size_t | Size | |||
) | [inline, protected, inherited] |
Definition at line 254 of file object.h.
00255 { 00256 SpecificParametersMap::iterator i = mSpecificParameters.find(ParameterName); 00257 if (i != mSpecificParameters.end()) 00258 { 00259 mSpecificParameters.erase(i); 00260 } 00261 mSpecificParameters[ParameterName] = Any(ParameterValue, Size); 00262 }
const std::string& gpucalc::Object::getClassName | ( | ) | const [inline, inherited] |
Returns name of class of our object.
Definition at line 92 of file object.h.
00093 { 00094 return mClassName; 00095 }
__int64 gpucalc::Timer::getCounter | ( | ) | [private] |
Definition at line 81 of file win32_timer_impl.cpp.
00082 { 00083 SetProcessAffinityMask(mThread, 1); 00084 LARGE_INTEGER c; 00085 QueryPerformanceCounter(&c); //gets current timestamp value 00086 SetProcessAffinityMask(mThread, mProcAffinity); 00087 return c.QuadPart; 00088 }
const std::string& gpucalc::Object::getObjectName | ( | ) | const [inline, inherited] |
Returns name of our object.
Definition at line 101 of file object.h.
00102 { 00103 return mObjectName; 00104 }
static Timer& gpucalc::Timer::getSingleton | ( | ) | [static] |
Override standard Singleton retrieval.
Why do we do this? Well, it's because the Singleton implementation is in a .h file, which means it gets compiled into anybody who includes it. This is needed for the Singleton template to work, but we actually only want it compiled into the implementation of the class based on the Singleton, not all of them. If we don't change this, we get link errors when trying to use the Singleton-based class from an outside dll.
This method just delegates to the template version anyway, but the implementation stays in this single compilation unit, preventing link errors.
Reimplemented from gpucalc::Singleton< T >.
Timer & gpucalc::Timer::getSingleton | ( | ) | [static] |
Override standard Singleton retrieval.
Why do we do this? Well, it's because the Singleton implementation is in a .h file, which means it gets compiled into anybody who includes it. This is needed for the Singleton template to work, but we actually only want it compiled into the implementation of the class based on the Singleton, not all of them. If we don't change this, we get link errors when trying to use the Singleton-based class from an outside dll.
This method just delegates to the template version anyway, but the implementation stays in this single compilation unit, preventing link errors.
Reimplemented from gpucalc::Singleton< T >.
Definition at line 54 of file unix_timer_impl.cpp.
00055 { 00056 assert(mSingleton); 00057 return(* mSingleton); 00058 }
static Timer* gpucalc::Timer::getSingletonPtr | ( | ) | [static] |
Override standard Singleton retrieval.
Why do we do this? Well, it's because the Singleton implementation is in a .h file, which means it gets compiled into anybody who includes it. This is needed for the Singleton template to work, but we actually only want it compiled into the implementation of the class based on the Singleton, not all of them. If we don't change this, we get link errors when trying to use the Singleton-based class from an outside dll.
This method just delegates to the template version anyway, but the implementation stays in this single compilation unit, preventing link errors.
Reimplemented from gpucalc::Singleton< T >.
Timer * gpucalc::Timer::getSingletonPtr | ( | ) | [static] |
Override standard Singleton retrieval.
Why do we do this? Well, it's because the Singleton implementation is in a .h file, which means it gets compiled into anybody who includes it. This is needed for the Singleton template to work, but we actually only want it compiled into the implementation of the class based on the Singleton, not all of them. If we don't change this, we get link errors when trying to use the Singleton-based class from an outside dll.
This method just delegates to the template version anyway, but the implementation stays in this single compilation unit, preventing link errors.
Reimplemented from gpucalc::Singleton< T >.
Definition at line 48 of file unix_timer_impl.cpp.
00049 { 00050 return mSingleton; 00051 }
void gpucalc::Object::getSpecificParameter | ( | const std::string & | ParameterName, | |
void * | ParameterValue | |||
) | [inline, inherited] |
Method for obtaining some specific parameters, such as texture specific params, and so on.
ParameterName | - name of parameter, usually it similar to specific method of some object (for example, GLTextureID) | |
ParameterValue | - contain value of named parameter, it must be allocated and have sufficient size. |
Definition at line 128 of file object.h.
00129 { 00130 SpecificParametersMap::iterator i = mSpecificParameters.find(ParameterName); 00131 if (i != mSpecificParameters.end()) 00132 { 00133 i->second.copyValue(ParameterValue); 00134 } 00135 else 00136 { 00137 Except<ERR_ITEM_NOT_FOUND>(this, "Parameter \"" + ParameterName + "\" does not exists.", "Object::getSpecificParameter()", __FILE__, __LINE__); 00138 } 00139 }
double gpucalc::Timer::getTime | ( | ) |
double gpucalc::Timer::getTime | ( | ) |
Definition at line 71 of file unix_timer_impl.cpp.
00072 { 00073 gettimeofday(&mCurrentTime, NULL); 00074 return mCurrentTime.tv_sec + (double)mCurrentTime.tv_usec / 1000000.0; 00075 }
bool gpucalc::Object::isLocked | ( | ) | const [inline, inherited] |
void gpucalc::Object::lock | ( | ) | [inline, protected, inherited] |
Timer * gpucalc::Singleton< Timer >::mSingleton | ( | ) | [inline, inherited] |
Definition at line 42 of file win32_timer_impl.cpp.
Timer * gpucalc::Singleton< Timer >::mSingleton | ( | ) | [inline, inherited] |
Definition at line 45 of file unix_timer_impl.cpp.
Profiler * gpucalc::Singleton< Profiler >::mSingleton | ( | ) | [inline, inherited] |
Definition at line 39 of file profiler.cpp.
LogManager * gpucalc::Singleton< LogManager >::mSingleton | ( | ) | [inline, inherited] |
Definition at line 38 of file log_manager.cpp.
debugger::Debugger * gpucalc::Singleton< debugger::Debugger >::mSingleton | ( | ) | [inline, inherited] |
Definition at line 42 of file debugger.cpp.
debugger::CommandParser * gpucalc::Singleton< debugger::CommandParser >::mSingleton | ( | ) | [inline, inherited] |
Definition at line 41 of file command_parser.cpp.
Application * gpucalc::Singleton< Application >::mSingleton | ( | ) | [inline, inherited] |
Definition at line 44 of file application.cpp.
void gpucalc::Object::unlock | ( | ) | [inline, protected, inherited] |
struct timeval gpucalc::Timer::mCurrentTime [read, private] |
Definition at line 70 of file unix_timer_impl.h.
__int64 gpucalc::Timer::mFrequency [private] |
Definition at line 72 of file win32_timer_impl.h.
bool gpucalc::Timer::mIsStarted [private] |
Definition at line 70 of file win32_timer_impl.h.
unsigned long gpucalc::Timer::mProcAffinity [private] |
Definition at line 74 of file win32_timer_impl.h.
T* gpucalc::Singleton< T >::mSingleton [static, protected, inherited] |
Definition at line 108 of file singleton.h.
__int64 gpucalc::Timer::mStartTime [private] |
Definition at line 71 of file win32_timer_impl.h.
unsigned long gpucalc::Timer::mSysAffinity [private] |
Definition at line 75 of file win32_timer_impl.h.
void* gpucalc::Timer::mThread [private] |
Definition at line 76 of file win32_timer_impl.h.