Merge pull request #48 from CogentEmbedded/master
authorKevron Rees <tripzero.kev@gmail.com>
Mon, 6 Apr 2015 15:33:33 +0000 (08:33 -0700)
committerKevron Rees <tripzero.kev@gmail.com>
Mon, 6 Apr 2015 15:33:33 +0000 (08:33 -0700)
Fixes and improvements in CAN support

1  2 
lib/superptr.hpp
lib/timestamp.h
plugins/common/CMakeLists.txt

@@@ -86,14 -86,9 +86,14 @@@ template<typename T> ::std::unique_ptr<
    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);});
  }
  
  }
diff --cc lib/timestamp.h
@@@ -20,30 -13,17 +21,34 @@@ protected
  
  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:
Simple merge