Fire Core  8.0.0.alpha
GIS framework per tutti gli usi
 Tutto Classi Namespace Funzioni Variabili Ridefinizioni di tipo (typedef) Tipi enumerati (enum) Valori del tipo enumerato Friend
DateTime.hpp
1 // Copyright 2015 GEOSYSTEMS SRL
2 // All Rights Reserved.
3 
4 #ifndef FIRE_DATA_DATETIME_HPP_INCLUDED
5 #define FIRE_DATA_DATETIME_HPP_INCLUDED
6 
7 #include <QtCore/QDateTime>
8 #include <boost/thread/mutex.hpp>
9 #include <fire/gear/threading/types.hpp>
10 
11 #include <string>
12 #include <exception>
13 
14 namespace fire {
15 namespace source {
16 namespace vector {
17 
18 namespace shared {
19 class DateTimeSh;
20 } // namespace shared
21 
25 class DateTime {
26  public:
28 
32  DateTime();
37  explicit DateTime(long long const & time);
38 
43  DateTime(const DateTime& source);
44 
48  ~DateTime();
49 
54  long long getTime() const;
55 
60  void setTime(double const & time);
61 
66  std::string format(std::string const & pattern = "yyyy-MM-dd hh:mm:ss") const;
67 
73  void parse(const std::string &txt, std::string const & pattern = "yyyy-MM-dd hh:mm:ss");
74 
75  private:
76  DateTime& operator=(const DateTime& rhs);
77 
78  QDateTime _dt;
79 
80  mutable boost::mutex _mtx;
81 };
82 
83 } // namespace vector
84 } // namespace source
85 } // namespace fire
86 
87 #endif
long long getTime() const
void setTime(double const &time)
Definition: DateTimeSh.hpp:21
std::string format(std::string const &pattern="yyyy-MM-dd hh:mm:ss") const
Definition: DateTime.hpp:25
void parse(const std::string &txt, std::string const &pattern="yyyy-MM-dd hh:mm:ss")