diff options
Diffstat (limited to 'host/include')
-rw-r--r-- | host/include/uhd/types/time_spec.hpp | 24 | ||||
-rw-r--r-- | host/include/uhd/usrp/dboard_id.hpp | 2 |
2 files changed, 24 insertions, 2 deletions
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 <uhd/config.hpp> #include <boost/cstdint.hpp> +#include <boost/operators.hpp> 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<time_spec_t>, + boost::subtractable<time_spec_t>, + boost::equality_comparable<time_spec_t>{ //! 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<dboard_id_t>{ + class UHD_API dboard_id_t : boost::equality_comparable<dboard_id_t>{ public: /*! * Create a dboard id from an integer. |