Kea 2.7.5
interval_timer.h
Go to the documentation of this file.
1// Copyright (C) 2011-2024 Internet Systems Consortium, Inc. ("ISC")
2//
3// This Source Code Form is subject to the terms of the Mozilla Public
4// License, v. 2.0. If a copy of the MPL was not distributed with this
5// file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7#ifndef ASIOLINK_INTERVAL_TIMER_H
8#define ASIOLINK_INTERVAL_TIMER_H 1
9
10#include <boost/shared_ptr.hpp>
11#include <functional>
12
13#include <asiolink/io_service.h>
14
15namespace isc {
16namespace asiolink {
17
18class IntervalTimerImpl;
19
53public:
55 typedef std::function<void()> Callback;
56
60 enum Mode
61 {
64 };
65
71
72private:
73 IntervalTimer(const IntervalTimer& source);
74 IntervalTimer& operator=(const IntervalTimer& source);
75public:
83 IntervalTimer(const IOServicePtr& io_service);
84
93
113 void setup(const Callback& cbfunc, const long interval,
114 const Mode& mode = REPEATING);
115
124 void cancel();
125
132 long getInterval() const;
133
134private:
135 boost::shared_ptr<IntervalTimerImpl> impl_;
136};
137
138typedef boost::shared_ptr<isc::asiolink::IntervalTimer> IntervalTimerPtr;
139
140} // namespace asiolink
141} // namespace isc
142
143#endif // ASIOLINK_INTERVAL_TIMER_H
Defines the logger used by the top-level component of kea-lfc.