git.fiddlerwoaroof.com
sys_time.cc
23c0bd4d
 /* Copyright (C) CJ Affiliate
  *
  * You may use, distribute and modify this code under  the
  * terms of the  GNU General Public License  version 2  or
  * later.
  *
  * You should have received a copy of the license with this
  * file. If not, you will find a copy in the "LICENSE" file
  * at https://github.com/cjdev/dual-control.
  */
 
2587e1ec
 #include <memory>
 #include <ctime>
 
 #include "sys_time.h"
 
23c0bd4d
 namespace
 {
 class impl : public sys_time_ifc
 {
 public:
     time_t time (time_t *timer) const override
     {
         return ::time (timer);
     }
 };
2587e1ec
 }
 
23c0bd4d
 const sys_time &sys_time::get()
 {
     static sys_time singleton (std::make_shared<impl>());
2587e1ec
     return singleton;
 }
23c0bd4d