Kea: dummy_io_cb.h Source File

| Kea 3.2.0-git

dummy_io_cb.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 DUMMY_IO_CB_H
8#define DUMMY_IO_CB_H
9
10#include <iostream>
11
12#include <exceptions/exceptions.h>
13
14#include <boost/asio/error.hpp>
15
16namespace isc {
17namespace asiolink {
18
29
30 class DummyIOCallback {
31public:
32
38 void operator()(boost::system::error_code) {
39 // If the function is called, there is a serious logic error in
40 // the program (this class should not be used as the callback
41 // class). As the asiolink module is too low-level for logging
42 // errors, throw an exception.
43 isc_throw(isc::Unexpected,
44 "DummyIOCallback::operator() must not be called");
45 }
46
52 void operator()(boost::system::error_code, size_t) {
53 // If the function is called, there is a serious logic error in
54 // the program (this class should not be used as the callback
55 // class). As the asiolink module is too low-level for logging
56 // errors, throw an exception.
57 isc_throw(isc::Unexpected,
58 "DummyIOCallback::operator() must not be called");
59 }
60};
61
62} // namespace asiolink
63} // namespace isc
64
65#endif // DUMMY_IO_CB_H
isc::Unexpected
A generic exception that is thrown when an unexpected error condition occurs.
Definition exceptions/exceptions.h:153
isc::asiolink::DummyIOCallback
Asynchronous I/O Completion Callback.
Definition dummy_io_cb.h:30
isc::asiolink::DummyIOCallback::operator()
void operator()(boost::system::error_code, size_t)
Asynchronous I/O callback method.
Definition dummy_io_cb.h:52
isc::asiolink::DummyIOCallback::operator()
void operator()(boost::system::error_code)
Asynchronous I/O callback method.
Definition dummy_io_cb.h:38
exceptions.h
isc_throw
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
Definition exceptions/exceptions.h:210
isc::asiolink
Definition addr_utilities.cc:170
isc
Defines the logger used by the top-level component of kea-lfc.
Definition check_exists_add.cc:18