return ::std::unique_ptr<T>(t);
}
+template<typename T> ::std::shared_ptr<T> make_shared(T* t)
+{
+ return ::std::shared_ptr<T>(t);
+}
+
template<typename T> gobject_ptr<T> make_gobject(T* t)
{
- return gobject_ptr<T>(t, [](auto ptr) { if(ptr) g_object_unref(ptr);});
+ return gobject_ptr<T>(t, [](T *ptr) { if(ptr) g_object_unref(ptr);});
}
}
public:
+ /*!
+ * \brief currentTime
+ * \return current monotonic (steady) time in seconds.
+ */
double currentTime();
+ double currentTime(double time);
+ /*!
+ * \brief epochTime
+ * \param time monotonic time usually from currentTime()
+ * \return number of seconds.milliseconds since unix epoch
+ */
double epochTime(double time);
+ /*!
+ * \brief epochTime
+ * \return current system time in seconds since unix epoch
+ */
double epochTime();
+ static double fromTimeval(const struct ::timeval& tv);
+ static struct ::timeval toTimeval(const double time);
+
public:
+ /*!
+ * \brief instance
+ * \return instance of Timestamp;
+ */
static Timestamp *instance();
private: