| Apache Ignite C++

timestamp.h
Go to the documentation of this file.
1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
23 #ifndef _IGNITE_TIMESTAMP
24 #define _IGNITE_TIMESTAMP
25
26 #include <stdint.h>
27
28 #include <ignite/common/common.h>
29
30 #include <ignite/date.h>
31
32 namespace ignite
33 {
37 class IGNITE_IMPORT_EXPORT Timestamp
38 {
39 public:
43 Timestamp();
44
50 Timestamp(const Timestamp& another);
51
57 Timestamp(int64_t ms);
58
66 Timestamp(int64_t seconds, int32_t fractionNs);
67
74 Timestamp& operator=(const Timestamp& another);
75
81 int64_t GetMilliseconds() const;
82
88 int64_t GetSeconds() const;
89
95 int32_t GetSecondFraction() const;
96
102 Date GetDate() const;
103
111 friend bool IGNITE_IMPORT_EXPORT operator==(const Timestamp& val1, const Timestamp& val2);
112
120 friend bool IGNITE_IMPORT_EXPORT operator!=(const Timestamp& val1, const Timestamp& val2);
121
129 friend bool IGNITE_IMPORT_EXPORT operator<(const Timestamp& val1, const Timestamp& val2);
130
138 friend bool IGNITE_IMPORT_EXPORT operator<=(const Timestamp& val1, const Timestamp& val2);
139
147 friend bool IGNITE_IMPORT_EXPORT operator>(const Timestamp& val1, const Timestamp& val2);
148
156 friend bool IGNITE_IMPORT_EXPORT operator>=(const Timestamp& val1, const Timestamp& val2);
157 private:
159 int64_t seconds;
160
162 int32_t fractionNs;
163 };
164 }
165
166 #endif //_IGNITE_TIMESTAMP
ignite
Apache Ignite API.
Definition: cache.h:48
ignite::operator<
bool operator<(const Date &val1, const Date &val2)
Definition: date.cpp:64
ignite::operator>=
bool operator>=(const Date &val1, const Date &val2)
Definition: date.cpp:79
date.h
ignite::operator<=
bool operator<=(const Date &val1, const Date &val2)
Definition: date.cpp:69
ignite::Timestamp
Timestamp type.
Definition: timestamp.h:37
ignite::Date
Date type.
Definition: date.h:35
ignite::operator>
bool operator>(const Date &val1, const Date &val2)
Definition: date.cpp:74
ignite::operator!=
bool operator!=(const Date &val1, const Date &val2)
Definition: date.cpp:59
ignite::operator==
bool operator==(const Date &val1, const Date &val2)
Definition: date.cpp:54