activemq-cpp-3.9.5
Date.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
18#ifndef _DECAF_UTIL_DATE_H_
19#define _DECAF_UTIL_DATE_H_
20
21#include <decaf/util/Config.h>
23#include <string>
24
25namespace decaf {
26namespace util {
27
34 class DECAF_API Date : public lang::Comparable<Date> {
35 private:
36
40 long long time;
41
42 public:
43
49
54 Date(long long milliseconds);
55
60 Date(const Date& source);
61
70 Date& operator=(const Date& value);
71
72 virtual ~Date();
73
78 long long getTime() const;
79
85 void setTime(long long milliseconds);
86
93 bool after(const Date& when) const;
94
101 bool before(const Date& when) const;
102
124 std::string toString() const;
125
126 public: // Comparable
127
128 virtual int compareTo(const Date& value) const;
129
130 virtual bool equals(const Date& value) const;
131
132 virtual bool operator==(const Date& value) const;
133
134 virtual bool operator<(const Date& value) const;
135
136 };
137
138}}
139
140#endif /*_DECAF_UTIL_DATE_H_*/
This interface imposes a total ordering on the objects of each class that implements it.
Definition Comparable.h:33
Date & operator=(const Date &value)
Assigns the value of one Date object to another.
Date(long long milliseconds)
Constructs the date with a given time value.
bool before(const Date &when) const
Determines whether or not this date falls before the specified time.
Date()
Default constructor - sets time to the current System time, rounded to the nearest millisecond.
Date(const Date &source)
Copy constructor.
void setTime(long long milliseconds)
Sets the underlying time.
virtual bool operator==(const Date &value) const
bool after(const Date &when) const
Determines whether or not this date falls after the specified time.
std::string toString() const
Converts this Date object to a String of the form:
virtual int compareTo(const Date &value) const
virtual bool operator<(const Date &value) const
virtual bool equals(const Date &value) const
long long getTime() const
Gets the underlying time.
#define DECAF_API
Definition Config.h:29
Definition AbstractCollection.h:33
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
Definition AprPool.h:25