Kea  1.9.9-git
dummy_io_cb.h
Go to the documentation of this file.
1 // Copyright (C) 2011-2015 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 
16 namespace isc {
17 namespace asiolink {
18 
29 
31 public:
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.
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.
58  "DummyIOCallback::operator() must not be called");
59  }
60 };
61 
62 } // namespace asiolink
63 } // namespace isc
64 
65 #endif // DUMMY_IO_CB_H
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
A generic exception that is thrown when an unexpected error condition occurs.
Defines the logger used by the top-level component of kea-dhcp-ddns.