OpenDaVINCI  4.16.0
TimeFactory.h
Go to the documentation of this file.
1 
20 #ifndef OPENDAVINCI_CORE_WRAPPER_TIMEFACTORY_H_
21 #define OPENDAVINCI_CORE_WRAPPER_TIMEFACTORY_H_
22 
23 #include <memory>
24 
26 #include <memory>
30 
31 namespace odcore { namespace wrapper { class Mutex; } }
32 namespace odcore { namespace wrapper { class Time; } }
33 
34 #ifdef WIN32
36 #endif
37 #ifndef WIN32
39 #endif
40 
41 namespace odcore {
42  namespace wrapper {
43 
44  using namespace std;
45 
60  public:
61  virtual ~TimeFactory();
62  virtual std::shared_ptr<odcore::wrapper::Time> now();
63  static TimeFactory& getInstance();
64 
65  protected:
66  TimeFactory();
67  static void setSingleton(TimeFactory *tf);
70 
71  private:
72  static unique_ptr<Mutex> m_singletonMutex;
73  };
74 
76  public:
77  // Product type created by factory.
79 
80  // Configuration for factory.
82 
83  // Factory method to create a concrete product
85 
86  // Wrapper to preserve current functionality.
87  static worker_type getInstance() { return instance; }
88 
89  protected:
90  // Wrapper to preserve current functionality.
92  };
93 
94  }
95 } // odcore::wrapper
96 
97 #endif /*OPENDAVINCI_CORE_WRAPPER_TIMEFACTORY_H_*/
Definition: TimeFactory.h:75
Definition: POSIXTime.h:27
SystemLibraryProducts
Definition: SystemLibraryProducts.h:26
void configuration
Definition: ConfigurationTraits.h:38
static worker_type getInstance()
Definition: TimeFactory.h:87
#define OPENDAVINCI_API
Definition: opendavinci.h:67
static TimeFactory * instance
Definition: TimeFactory.h:68
SystemLibraryProducts product_type
Definition: TimeFactory.h:78
Definition: TimeFactory.h:59
ConfigurationTraits< product_type >::configuration configuration_value
Definition: TimeFactory.h:81
TimeFactoryWorker< configuration_value::value > worker_type
Definition: TimeFactory.h:84
static worker_type instance
Definition: TimeFactory.h:91
static TimeFactory * controlledInstance
Definition: TimeFactory.h:69