NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
niftkSystemTimeServiceRAII.h
Go to the documentation of this file.
1 /*=============================================================================
2 
3  NifTK: A software platform for medical image computing.
4 
5  Copyright (c) University College London (UCL). All rights reserved.
6 
7  This software is distributed WITHOUT ANY WARRANTY; without even
8  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
9  PURPOSE.
10 
11  See LICENSE.txt in the top level directory for details.
12 
13 =============================================================================*/
14 
15 #ifndef niftkSystemTimeServiceRAII_h
16 #define niftkSystemTimeServiceRAII_h
17 
18 #include <niftkIGIServicesExports.h>
20 
21 #include <usServiceReference.h>
22 #include <usModuleContext.h>
23 
24 namespace niftk
25 {
26 
33 class NIFTKIGISERVICES_EXPORT SystemTimeServiceRAII : public SystemTimeServiceI
34 {
35 
36 public:
37 
42 
46  virtual ~SystemTimeServiceRAII();
47 
51  virtual TimeType GetSystemTimeInNanoseconds() const override;
52 
53 private:
54  SystemTimeServiceRAII(const SystemTimeServiceRAII&); // deliberately not implemented
55  SystemTimeServiceRAII& operator=(const SystemTimeServiceRAII&); // deliberately not implemented
56 
57  us::ModuleContext* m_ModuleContext;
58  std::vector<us::ServiceReference<SystemTimeServiceI> > m_Refs;
59  niftk::SystemTimeServiceI* m_Service;
60 };
61 
62 } // end namespace
63 
64 #endif
Interface for a service that can return the system time.
Definition: niftkSystemTimeServiceI.h:33
RAII object to retrieve the system time via a SystemTimeServiceI implementation.
Definition: niftkSystemTimeServiceRAII.h:33
unsigned long long TimeType
Definition: niftkSystemTimeServiceI.h:38
Definition: niftkExceptionObject.h:21