/* * qDefs.h * * Created on: May 4, 2012 * Author: l_maliakal_d */ #ifndef QDEFS_H #define QDEFS_H #include using namespace std; class qDefs { public: /** Empty Constructor */ qDefs(){}; /** unit of time */ enum timeUnit{ HOURS, /** hr */ MINUTES, /** min */ SECONDS, /** s */ MILLISECONDS, /** ms */ MICROSECONDS, /** us */ NANOSECONDS /** ns */ }; /** returns the value in ns to send to server. * @param unit unit of time * @param value time * returns time value in ns */ static float getNSTime(timeUnit unit, float value){ float valueNS=value; switch(unit){ case HOURS: valueNS*=60; case MINUTES: valueNS*=60; case SECONDS: valueNS*=1000; case MILLISECONDS: valueNS*=1000; case MICROSECONDS: valueNS*=1000; case NANOSECONDS: default:; } return valueNS; }; }; #endif /* QDEFS_H */