From: Lars Op den Kamp Date: Mon, 13 Feb 2012 02:02:55 +0000 (+0100) Subject: platform: added an Init() method in CTimeout, so it can be reset X-Git-Tag: upstream/2.2.0~1^2~35^2~83 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=143e675b705eaceb1bb514e63301c02dbcf70600;p=deb_libcec.git platform: added an Init() method in CTimeout, so it can be reset --- diff --git a/src/lib/platform/util/timeutils.h b/src/lib/platform/util/timeutils.h index 367c80b..985712a 100644 --- a/src/lib/platform/util/timeutils.h +++ b/src/lib/platform/util/timeutils.h @@ -107,8 +107,11 @@ namespace PLATFORM class CTimeout { public: - CTimeout(uint32_t iTime) : - m_iTarget(GetTimeMs() + iTime) {} + CTimeout(void) : m_iTarget(0) {} + CTimeout(uint32_t iTimeout) { Init(iTimeout); } + + bool IsSet(void) const { return m_iTarget > 0; } + void Init(uint32_t iTimeout) { m_iTarget = GetTimeMs() + iTimeout; } uint64_t TimeLeft(void) const {