Kea
3.1.1
io_service_mgr.cc
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
#include <config.h>
8
9
#include <
asiolink/io_service_mgr.h
>
10
11
namespace
isc
{
12
namespace
asiolink
{
13
14
IOServiceMgr&
IOServiceMgr::instance
() {
15
static
IOServiceMgr
instance
;
16
return
(
instance
);
17
}
18
19
void
20
IOServiceMgr::registerIOService
(
IOServicePtr
io_service) {
21
if
(!io_service) {
22
return
;
23
}
24
auto
it = std::find(io_services_.begin(), io_services_.end(), io_service);
25
if
(it == io_services_.end()) {
26
io_services_.push_back(io_service);
27
}
28
}
29
30
void
31
IOServiceMgr::unregisterIOService
(
IOServicePtr
io_service) {
32
auto
it = std::find(io_services_.begin(), io_services_.end(), io_service);
33
if
(it != io_services_.end()) {
34
io_services_.erase(it);
35
}
36
}
37
38
size_t
39
IOServiceMgr::pollIOServices
() {
40
size_t
cnt = 0;
41
for
(
auto
& io_service : io_services_) {
42
cnt += io_service->poll();
43
}
44
45
return
(cnt);
46
}
47
48
}
// namespace asiolink
49
}
// namespace isc
isc::asiolink::IOServiceMgr::instance
static IOServiceMgr & instance()
Access the IOServiceMgr singleton instance.
Definition
io_service_mgr.cc:14
isc::asiolink::IOServiceMgr::pollIOServices
size_t pollIOServices()
Poll IOService objects.
Definition
io_service_mgr.cc:39
isc::asiolink::IOServiceMgr::registerIOService
void registerIOService(IOServicePtr io_service)
Register IOService.
Definition
io_service_mgr.cc:20
isc::asiolink::IOServiceMgr::unregisterIOService
void unregisterIOService(IOServicePtr io_service)
Unregister IOService.
Definition
io_service_mgr.cc:31
io_service_mgr.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
Defines the logger used by the top-level component of kea-lfc.
Definition
agent_parser.cc:148
src
lib
asiolink
io_service_mgr.cc
Generated on Fri Aug 29 2025 13:13:11 for Kea by
1.13.2