From c3c319a7f1be377d82900d57411b5ddd7ee14489 Mon Sep 17 00:00:00 2001 From: Matteo Cypriani Date: Sat, 19 Mar 2011 14:42:57 +0100 Subject: [PATCH] [Positioning] Timestamp::Timestamp(owl_timestamp) --- owlps-positioning/src/timestamp.cc | 12 ++++++++++++ owlps-positioning/src/timestamp.hh | 4 ++++ 2 files changed, 16 insertions(+) diff --git a/owlps-positioning/src/timestamp.cc b/owlps-positioning/src/timestamp.cc index 23ca834..498f91e 100644 --- a/owlps-positioning/src/timestamp.cc +++ b/owlps-positioning/src/timestamp.cc @@ -19,6 +19,12 @@ Timestamp::Timestamp(const struct timespec &source) } +Timestamp::Timestamp(const owl_timestamp &source) +{ + set(source) ; +} + + Timestamp::Timestamp(const uint_fast32_t source_s, const uint_fast32_t source_ns) { @@ -48,6 +54,12 @@ inline void Timestamp::set(const struct timespec &source) } +inline void Timestamp::set(const owl_timestamp &source) +{ + set(source.tv_sec, source.tv_nsec) ; +} + + inline void Timestamp::set(const uint_fast32_t source_s, const uint_fast32_t source_ns) { diff --git a/owlps-positioning/src/timestamp.hh b/owlps-positioning/src/timestamp.hh index 5158a74..d1a8e5b 100644 --- a/owlps-positioning/src/timestamp.hh +++ b/owlps-positioning/src/timestamp.hh @@ -1,6 +1,8 @@ #ifndef _OWLPS_POSITIONING_TIMESTAMP_HH_ #define _OWLPS_POSITIONING_TIMESTAMP_HH_ +#include + #include #include // is not C++ 98 compliant #include @@ -19,6 +21,7 @@ protected: /** @name Internal accessors */ //@{ void set(const struct timespec &source) ; + void set(const owl_timestamp &source) ; void set(const uint_fast32_t source_s, const uint_fast32_t source_ns) ; /// Initialises the Timestamp with a value in milliseconds (deprecated) void set(const uint64_t source_ms) ; @@ -43,6 +46,7 @@ protected: public: Timestamp(void) ; Timestamp(const struct timespec &source) ; + Timestamp(const owl_timestamp &source) ; Timestamp(const uint_fast32_t source_s, const uint_fast32_t source_ns) ; /// Constructs a Timsestamp from a value in milliseconds (deprecated) Timestamp(const uint64_t source) ;