document timefunc api
[libi2ncommon] / src / timefunc.cpp
index 88e6c33..0883055 100644 (file)
@@ -1019,6 +1019,18 @@ namespace clock {
 
     namespace {
 
+        /**
+         * @brief         <b>For internal use only</b>. Translates clock
+         *                specification flags to kernel clock types.
+         *
+         * @param id      Master clock id: \c mono, \c real, \c boot, or \c
+         *                cpu.
+         * @param var     Variant of clock if appropriate: \c raw, \c exact, \c
+         *                process, or \c thread. Use \c dflt for the base
+         *                variant.
+         *
+         * @return        The clock id for using with kernel APIs.
+         */
         static inline clockid_t
         clockid_of_flags (const enum type::id      id,
                           const enum type::variant var) NOEXCEPT
@@ -1055,9 +1067,7 @@ namespace clock {
                 }
 
                 case type::boot: {
-                    if (var & type::exact) {
-                        cid = CLOCK_BOOTTIME;
-                    }
+                    cid = CLOCK_BOOTTIME;
                     break;
                 }
 
@@ -1133,6 +1143,14 @@ namespace clock {
         return *this;
     }
 
+    /*
+     * @note    This operator is an up-assignment from a type containing less
+     *          information than the structure assigned from. Since the
+     *          operator can only be two valued we must normalize the remaining
+     *          fields to the default clock. When assigning from non-default
+     *          clocks, use the appropriate constructor and pass it the desired
+     *          id and variant so as to assign the result.
+     */
     Time &
     Time::operator= (struct timespec ts) NOEXCEPT
     {