GridGain C++
timestamp.h
Go to the documentation of this file.
1 /*
2  * Copyright 2019 GridGain Systems, Inc. and Contributors.
3  *
4  * Licensed under the GridGain Community Edition License (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * https://www.gridgain.com/products/software/community-edition/gridgain-community-edition-license
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
22 #ifndef _IGNITE_TIMESTAMP
23 #define _IGNITE_TIMESTAMP
24 
25 #include <stdint.h>
26 
27 #include <ignite/common/common.h>
28 
29 #include <ignite/date.h>
30 
31 namespace ignite
32 {
36  class IGNITE_IMPORT_EXPORT Timestamp
37  {
38  public:
42  Timestamp();
43 
49  Timestamp(const Timestamp& another);
50 
56  Timestamp(int64_t ms);
57 
65  Timestamp(int64_t seconds, int32_t fractionNs);
66 
73  Timestamp& operator=(const Timestamp& another);
74 
80  int64_t GetMilliseconds() const;
81 
87  int64_t GetSeconds() const;
88 
94  int32_t GetSecondFraction() const;
95 
101  Date GetDate() const;
102 
110  friend bool IGNITE_IMPORT_EXPORT operator==(const Timestamp& val1, const Timestamp& val2);
111 
119  friend bool IGNITE_IMPORT_EXPORT operator!=(const Timestamp& val1, const Timestamp& val2);
120 
128  friend bool IGNITE_IMPORT_EXPORT operator<(const Timestamp& val1, const Timestamp& val2);
129 
137  friend bool IGNITE_IMPORT_EXPORT operator<=(const Timestamp& val1, const Timestamp& val2);
138 
146  friend bool IGNITE_IMPORT_EXPORT operator>(const Timestamp& val1, const Timestamp& val2);
147 
155  friend bool IGNITE_IMPORT_EXPORT operator>=(const Timestamp& val1, const Timestamp& val2);
156  private:
158  int64_t seconds;
159 
161  int32_t fractionNs;
162  };
163 }
164 
165 #endif //_IGNITE_TIMESTAMP
ignite
Ignite API.
Definition: cache.h:47
ignite::operator<
bool operator<(const Date &val1, const Date &val2)
Definition: date.cpp:63
ignite::operator>=
bool operator>=(const Date &val1, const Date &val2)
Definition: date.cpp:78
date.h
ignite::operator<=
bool operator<=(const Date &val1, const Date &val2)
Definition: date.cpp:68
ignite::Timestamp
Timestamp type.
Definition: timestamp.h:36
ignite::Date
Date type.
Definition: date.h:34
ignite::operator>
bool operator>(const Date &val1, const Date &val2)
Definition: date.cpp:73
ignite::operator!=
bool operator!=(const Date &val1, const Date &val2)
Definition: date.cpp:58
ignite::operator==
bool operator==(const Date &val1, const Date &val2)
Definition: date.cpp:53