SOIL C++
C++ Unified Device Interface
Time.h
Go to the documentation of this file.
1#pragma once
2#include "constants.h"
3#include <boost/date_time/posix_time/posix_time.hpp>
4#include <locale>
5namespace SOIL
6{
12 class Time
13 {
14 private:
20 bool _null;
21
29 boost::posix_time::ptime timestamp;
30 public:
39 DLL std::string rfc3339(void) const;
40
46 DLL Time();
47
58 DLL Time(std::string value);
59
68 DLL Time(boost::posix_time::ptime value);
69
75 DLL ~Time();
76
92 inline bool is_null(void) const { return _null; }
93
100 inline void set_null(bool _null = true) { this->_null = _null; }
101
111 static DLL boost::posix_time::ptime utc_now(void);
112
118 friend DLL bool operator>=(const Time& t1, const Time& t2);
119
125 friend DLL bool operator<=(const Time& t1, const Time& t2);
126
143 DLL std::vector<unsigned char> serialize(void) const;
144 };
145
158 DLL bool operator>=(const Time& t1, const Time& t2);
159
160
173 DLL bool operator<=(const Time& t1, const Time& t2);
174}
SOIL Time.
Definition: Time.h:13
friend DLL bool operator<=(const Time &t1, const Time &t2)
Friend Operator <=.
bool is_null(void) const
Is Null?
Definition: Time.h:92
DLL ~Time()
Destructor.
Definition: Time.cpp:53
DLL Time()
Uninitialized Constructor.
Definition: Time.cpp:27
void set_null(bool _null=true)
Set null.
Definition: Time.h:100
DLL std::string rfc3339(void) const
RFC3339 representation.
Definition: Time.cpp:6
friend DLL bool operator>=(const Time &t1, const Time &t2)
Friend Operator >=.
DLL std::vector< unsigned char > serialize(void) const
Bytewise serialization.
Definition: Time.cpp:62
static DLL boost::posix_time::ptime utc_now(void)
Current Time.
Definition: Time.cpp:57
Type definitions.
Definition: Container.h:7
DLL bool operator<=(const Time &t1, const Time &t2)
LEQ Time Operator.
Definition: Time.cpp:128
DLL bool operator>=(const Time &t1, const Time &t2)
GEQ Time Operator.
Definition: Time.cpp:116