summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/sys
diff options
context:
space:
mode:
authorKim van der Riet <kpvdr@apache.org>2007-11-05 22:39:27 +0000
committerKim van der Riet <kpvdr@apache.org>2007-11-05 22:39:27 +0000
commita11b6076410330386739f00030046e74063421e9 (patch)
tree1302556017fcccd4fa82b0efc8109125b23aa7c0 /cpp/src/qpid/sys
parentb07b0a633be48c74122f5a0cb04eafc57fb6a96b (diff)
downloadqpid-python-a11b6076410330386739f00030046e74063421e9.tar.gz
Added reset function to class AbsTime, thus allowing same instance of TimerTask to be reset and used again for the same duration as initially set
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@592170 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/sys')
-rw-r--r--cpp/src/qpid/sys/Time.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/cpp/src/qpid/sys/Time.h b/cpp/src/qpid/sys/Time.h
index cff5b70d8e..9c9b3de5c2 100644
--- a/cpp/src/qpid/sys/Time.h
+++ b/cpp/src/qpid/sys/Time.h
@@ -42,6 +42,7 @@ class AbsTime {
inline AbsTime(const AbsTime& time0, const Duration& duration);
// Default asignment operation fine
// Default copy constructor fine
+ inline void reset(const AbsTime& time0, const Duration& duration);
static AbsTime now();
inline static AbsTime FarFuture();
@@ -68,6 +69,11 @@ AbsTime::AbsTime(const AbsTime& t, const Duration& d) :
time_ns(d == Duration::max() ? max() : t.time_ns+d.nanosecs)
{}
+void AbsTime::reset(const AbsTime& t, const Duration& d)
+{
+ time_ns = d == Duration::max() ? max() : t.time_ns+d.nanosecs;
+}
+
AbsTime AbsTime::FarFuture() { AbsTime ff; ff.time_ns = max(); return ff;}
inline AbsTime now() { return AbsTime::now(); }