Kea 3.1.3
interval_timer.h
Go to the documentation of this file.
1// Copyright (C) 2011-2025 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/asio/deadline_timer.hpp>
11#include <boost/shared_ptr.hpp>
12#include <functional>
13
14#include <asiolink/io_service.h>
15
16namespace isc {
17namespace asiolink {
18
20
53class IntervalTimer {
54public:
56 typedef std::function<void()> Callback;
57
61 enum Mode
62 {
65 };
66
72
73private:
74 IntervalTimer(const IntervalTimer& source);
75 IntervalTimer& operator=(const IntervalTimer& source);
76public:
84 IntervalTimer(const IOServicePtr& io_service);
85
94
114 void setup(const Callback& cbfunc, const long interval,
115 const Mode& mode = REPEATING);
116
125 void cancel();
126
133 long getInterval() const;
134
135private:
136 boost::shared_ptr<IntervalTimerImpl> impl_;
137};
138
139typedef boost::shared_ptr<isc::asiolink::IntervalTimer> IntervalTimerPtr;
140
141} // namespace asiolink
142} // namespace isc
143
144#endif // ASIOLINK_INTERVAL_TIMER_H
Defines the logger used by the top-level component of kea-lfc.