Kea: io_service_signal.h Source File

| Kea 3.0.0

io_service_signal.h
Go to the documentation of this file.
1// Copyright (C) 2020-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 IO_SERVICE_SIGNAL_H
8#define IO_SERVICE_SIGNAL_H
9
10#include <asiolink/io_service.h>
11
12#include <boost/shared_ptr.hpp>
13
14namespace isc {
15namespace asiolink {
16
18 typedef std::function<void(int signum)> IOSignalHandler;
19
20class IOSignalSetImpl;
21
26 class IOSignalSet {
27public:
32 IOSignalSet(const asiolink::IOServicePtr& io_service, IOSignalHandler handler);
33
35 ~IOSignalSet();
36
41 void add(int signum);
42
47 void remove(int signum);
48
49private:
51 boost::shared_ptr<IOSignalSetImpl> impl_;
52};
53
55 typedef boost::shared_ptr<IOSignalSet> IOSignalSetPtr;
56
57} // namespace asiolink
58} // namespace isc
59
60#endif // IO_SERVICE_SIGNAL_H
isc::asiolink::IOSignalSetImpl
Implementation class of IOSignalSet.
Definition io_service_signal.cc:24
isc::asiolink::IOSignalSet::~IOSignalSet
~IOSignalSet()
Destructor.
Definition io_service_signal.cc:131
isc::asiolink::IOSignalSet::add
void add(int signum)
Add a signal to the list of signals to handle.
Definition io_service_signal.cc:136
isc::asiolink::IOSignalSet::remove
void remove(int signum)
Remove a signal from the list of signals to handle.
Definition io_service_signal.cc:141
isc::asiolink::IOSignalSet::IOSignalSet
IOSignalSet(const asiolink::IOServicePtr &io_service, IOSignalHandler handler)
Constructor.
Definition io_service_signal.cc:125
io_service.h
isc::asiolink
Definition addr_utilities.cc:170
isc::asiolink::IOServicePtr
boost::shared_ptr< IOService > IOServicePtr
Defines a smart pointer to an IOService instance.
Definition io_service.h:28
isc::asiolink::IOSignalHandler
std::function< void(int signum)> IOSignalHandler
Defines a handler function for an IOSignal.
Definition io_service_signal.h:18
isc::asiolink::IOSignalSetPtr
boost::shared_ptr< IOSignalSet > IOSignalSetPtr
Defines a pointer to an IOSignalSet.
Definition io_service_signal.h:55
isc
Defines the logger used by the top-level component of kea-lfc.
Definition agent_parser.cc:148