Safir SDK Core
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
TimeProvider.h
Go to the documentation of this file.
1 /******************************************************************************
2 *
3 * Copyright Saab AB, 2006-2013 (http://safir.sourceforge.net)
4 *
5 * Created by: Erik Adolfsson / sterad
6 *
7 *******************************************************************************
8 *
9 * This file is part of Safir SDK Core.
10 *
11 * Safir SDK Core is free software: you can redistribute it and/or modify
12 * it under the terms of version 3 of the GNU General Public License as
13 * published by the Free Software Foundation.
14 *
15 * Safir SDK Core is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with Safir SDK Core. If not, see <http://www.gnu.org/licenses/>.
22 *
23 ******************************************************************************/
24 #ifndef __DOUF_TIME_H
25 #define __DOUF_TIME_H
26 
27 #include <Safir/Utilities/Internal/VisibilityHelpers.h>
28 
29 #ifdef douf_time_cpp_EXPORTS
30 # define DOUF_TIME_CPP_API SAFIR_HELPER_DLL_EXPORT
31 #else
32 # define DOUF_TIME_CPP_API SAFIR_HELPER_DLL_IMPORT
33 # define SAFIR_LIBRARY_NAME "douf_time_cpp"
34 # include <Safir/Utilities/Internal/AutoLink.h>
35 #endif
36 #define DOUF_TIME_CPP_LOCAL SAFIR_HELPER_DLL_LOCAL
37 
39 
40 //disable warnings in boost
41 #if defined _MSC_VER
42  #pragma warning (push)
43  #pragma warning (disable : 4127)
44 #endif
45 
46 #include <boost/date_time/posix_time/posix_time.hpp>
47 
48 //and enable the warnings again
49 #if defined _MSC_VER
50  #pragma warning (pop)
51 #endif
52 
53 namespace Safir
54 {
55 namespace Time
56 {
57 
62  {
63  public:
64 
70  static Safir::Dob::Typesystem::Si64::Second GetUtcTime();
71 
78  static boost::posix_time::ptime ToLocalTime(const Safir::Dob::Typesystem::Si64::Second utcTime);
79 
86  static Safir::Dob::Typesystem::Si64::Second ToUtcTime(const boost::posix_time::ptime & localTime);
87 
94  static boost::posix_time::ptime ToPtime(const Safir::Dob::Typesystem::Si64::Second utcTime);
95 
102  static Safir::Dob::Typesystem::Si64::Second ToDouble(const boost::posix_time::ptime & utcTime);
103  };
104 
105 }; // namespace Time
106 }; // namespace Safir
107 
108 #endif //__DOUF_TIME_H
Float64 Second
64 bit representation of Second.
Definition: Defs.h:198
The Time class contains functions to operate on time.
Definition: TimeProvider.h:61
#define DOUF_TIME_CPP_API
Definition: TimeProvider.h:32