2012-12-12 10:46:18 -06:00
|
|
|
#ifndef QPID_MESSAGING_DURATION_H
|
|
|
|
#define QPID_MESSAGING_DURATION_H
|
2012-01-06 08:55:05 -06:00
|
|
|
|
|
|
|
/*
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one
|
|
|
|
* or more contributor license agreements. See the NOTICE file
|
|
|
|
* distributed with this work for additional information
|
|
|
|
* regarding copyright ownership. The ASF licenses this file
|
|
|
|
* to you under the Apache License, Version 2.0 (the
|
|
|
|
* "License"); you may not use this file except in compliance
|
|
|
|
* with the License. You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing,
|
|
|
|
* software distributed under the License is distributed on an
|
|
|
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
|
|
* KIND, either express or implied. See the License for the
|
|
|
|
* specific language governing permissions and limitations
|
|
|
|
* under the License.
|
|
|
|
*
|
|
|
|
*/
|
2012-12-12 10:46:18 -06:00
|
|
|
|
|
|
|
#include "qpid/messaging/ImportExport.h"
|
|
|
|
|
|
|
|
#include "qpid/sys/IntegerTypes.h"
|
2012-01-06 08:55:05 -06:00
|
|
|
|
|
|
|
namespace qpid {
|
|
|
|
namespace messaging {
|
|
|
|
|
2012-12-12 10:46:18 -06:00
|
|
|
/** \ingroup messaging
|
|
|
|
* A duration is a time in milliseconds.
|
2012-01-06 08:55:05 -06:00
|
|
|
*/
|
2012-12-12 10:46:18 -06:00
|
|
|
class Duration
|
2012-01-06 08:55:05 -06:00
|
|
|
{
|
|
|
|
public:
|
2012-12-12 10:46:18 -06:00
|
|
|
QPID_MESSAGING_EXTERN explicit Duration(uint64_t milliseconds);
|
|
|
|
QPID_MESSAGING_EXTERN uint64_t getMilliseconds() const;
|
|
|
|
QPID_MESSAGING_EXTERN static const Duration FOREVER;
|
|
|
|
QPID_MESSAGING_EXTERN static const Duration IMMEDIATE;
|
|
|
|
QPID_MESSAGING_EXTERN static const Duration SECOND;
|
|
|
|
QPID_MESSAGING_EXTERN static const Duration MINUTE;
|
2012-01-06 08:55:05 -06:00
|
|
|
private:
|
2012-12-12 10:46:18 -06:00
|
|
|
uint64_t milliseconds;
|
2012-01-06 08:55:05 -06:00
|
|
|
};
|
2012-12-12 10:46:18 -06:00
|
|
|
|
|
|
|
QPID_MESSAGING_EXTERN Duration operator*(const Duration& duration,
|
|
|
|
uint64_t multiplier);
|
|
|
|
QPID_MESSAGING_EXTERN Duration operator*(uint64_t multiplier,
|
|
|
|
const Duration& duration);
|
|
|
|
|
2012-01-06 08:55:05 -06:00
|
|
|
}} // namespace qpid::messaging
|
|
|
|
|
2012-12-12 10:46:18 -06:00
|
|
|
#endif /*!QPID_MESSAGING_DURATION_H*/
|