ewol/sources/ewol/renderer/EventTime.h

47 lines
1.6 KiB
C++

/**
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved
*
* @license BSD v3 (see license file)
*/
#ifndef __EWOL_EVENT_CALL_TIME_H__
#define __EWOL_EVENT_CALL_TIME_H__
#include <etk/types.h>
namespace ewol {
class EventTime {
private:
int64_t m_timeSystem; //!< Current system time (micro-second)
int64_t m_timeUpAppl; //!< Current application wake up-time (micro-second)
float m_timeDelta; //!< Time from the last cycle call of the system (main appl tick) (second)
float m_timeDeltaCall; //!< Time from the last call (when we can manage periodic call with specifying periode) (second)
public:
EventTime(int64_t _timeSystem,
int64_t _timeUpAppl,
float _timeDelta,
float _timeDeltaCall) :
m_timeSystem(_timeSystem),
m_timeUpAppl(_timeUpAppl),
m_timeDelta(_timeDelta),
m_timeDeltaCall(_timeDeltaCall)
{ };
public:
void SetTime(int64_t _timeSystem) { m_timeSystem=_timeSystem; };
inline int64_t GetTime(void) const { return m_timeSystem; };
void SetApplWakeUpTime(int64_t _timeUpAppl) { m_timeUpAppl=_timeUpAppl; };
inline int64_t GetApplWakeUpTime(void) const { return m_timeUpAppl; };
inline int64_t GetApplUpTime(void) const { return m_timeSystem-m_timeUpAppl; };
void SetDelta(float _timeDelta) { m_timeDelta=_timeDelta; };
inline float GetDelta(void) const { return m_timeDelta; };
void SetDeltaCall(float _timeDeltaCall) { m_timeDeltaCall=_timeDeltaCall; };
inline float GetDeltaCall(void) const { return m_timeDeltaCall; };
};
etk::CCout& operator <<(etk::CCout& _os, const ewol::EventTime& _obj);
};
#endif