From fadd3a44a84e061412accd35c1c97db820190df8 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Thu, 24 Jun 2010 18:55:08 -0700 Subject: uhd: created benchmark rx example app Made mods to time spec to support math operators. --- host/include/uhd/types/time_spec.hpp | 24 +++++++++++++++++++++++- host/include/uhd/usrp/dboard_id.hpp | 2 +- 2 files changed, 24 insertions(+), 2 deletions(-) (limited to 'host/include') diff --git a/host/include/uhd/types/time_spec.hpp b/host/include/uhd/types/time_spec.hpp index 25d9e41d0..7353c6e25 100644 --- a/host/include/uhd/types/time_spec.hpp +++ b/host/include/uhd/types/time_spec.hpp @@ -20,6 +20,7 @@ #include #include +#include namespace uhd{ @@ -38,7 +39,10 @@ namespace uhd{ * This gives the fractional seconds enough precision to unambiguously * specify a clock-tick/sample-count up to rates of several petahertz. */ - struct UHD_API time_spec_t{ + struct UHD_API time_spec_t: + boost::addable, + boost::subtractable, + boost::equality_comparable{ //! whole/integer seconds count in seconds boost::uint32_t secs; @@ -69,8 +73,26 @@ namespace uhd{ */ time_spec_t(boost::uint32_t secs = 0, double nsecs = 0); + /*! + * Create a time_spec_t from whole and fractional seconds. + * Translation from clock-domain specific units. + * \param secs the whole/integer seconds count in seconds + * \param ticks the fractional seconds tick count + * \param tick_rate the number of ticks per second + */ + time_spec_t(boost::uint32_t secs, boost::uint32_t ticks, double tick_rate); + + //! Implement addable interface + time_spec_t &operator+=(const time_spec_t &); + + //! Implement subtractable interface + time_spec_t &operator-=(const time_spec_t &); + }; + //! Implement equality_comparable interface + UHD_API bool operator==(const time_spec_t &, const time_spec_t &); + } //namespace uhd #endif /* INCLUDED_UHD_TYPES_TIME_SPEC_HPP */ diff --git a/host/include/uhd/usrp/dboard_id.hpp b/host/include/uhd/usrp/dboard_id.hpp index 8b6eaf6bd..4c45e4334 100644 --- a/host/include/uhd/usrp/dboard_id.hpp +++ b/host/include/uhd/usrp/dboard_id.hpp @@ -25,7 +25,7 @@ namespace uhd{ namespace usrp{ - class UHD_API dboard_id_t : boost::equality_comparable1{ + class UHD_API dboard_id_t : boost::equality_comparable{ public: /*! * Create a dboard id from an integer. -- cgit v1.2.3