Qpid C++ Messaging API  0.20
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Duration.h
Go to the documentation of this file.
1 #ifndef QPID_MESSAGING_DURATION_H
2 #define QPID_MESSAGING_DURATION_H
3 
4 /*
5  *
6  * Licensed to the Apache Software Foundation (ASF) under one
7  * or more contributor license agreements. See the NOTICE file
8  * distributed with this work for additional information
9  * regarding copyright ownership. The ASF licenses this file
10  * to you under the Apache License, Version 2.0 (the
11  * "License"); you may not use this file except in compliance
12  * with the License. You may obtain a copy of the License at
13  *
14  * http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing,
17  * software distributed under the License is distributed on an
18  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
19  * KIND, either express or implied. See the License for the
20  * specific language governing permissions and limitations
21  * under the License.
22  *
23  */
24 
26 
27 #include "qpid/sys/IntegerTypes.h"
28 
29 namespace qpid {
30 namespace messaging {
31 
36 {
37  public:
38  QPID_MESSAGING_EXTERN explicit Duration(uint64_t milliseconds);
39  QPID_MESSAGING_EXTERN uint64_t getMilliseconds() const;
40  QPID_MESSAGING_EXTERN static const Duration FOREVER;
41  QPID_MESSAGING_EXTERN static const Duration IMMEDIATE;
42  QPID_MESSAGING_EXTERN static const Duration SECOND;
43  QPID_MESSAGING_EXTERN static const Duration MINUTE;
44  private:
45  uint64_t milliseconds;
46 };
47 
49  uint64_t multiplier);
50 QPID_MESSAGING_EXTERN Duration operator*(uint64_t multiplier,
51  const Duration& duration);
52 QPID_MESSAGING_EXTERN bool operator==(const Duration& a, const Duration& b);
53 QPID_MESSAGING_EXTERN bool operator!=(const Duration& a, const Duration& b);
54 
55 }} // namespace qpid::messaging
56 
57 #endif