]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[1366] Update doc of dummy_io_cb.h
authorJeremy C. Reed <jreed@isc.org>
Thu, 30 Jan 2014 06:17:28 +0000 (11:47 +0530)
committerMukund Sivaraman <muks@isc.org>
Thu, 30 Jan 2014 06:17:28 +0000 (11:47 +0530)
src/lib/asiolink/dummy_io_cb.h

index c4644c5048d4dbff1d0db3b08d94166d39fff626..79d087d221e158601b3a9e754b9e93007d989230 100644 (file)
@@ -15,6 +15,7 @@
 #ifndef DUMMY_IO_CB_H
 #define DUMMY_IO_CB_H
 
+#include <cassert>
 #include <iostream>
 
 #include <asio/error.hpp>
@@ -39,20 +40,30 @@ public:
 
     /// \brief Asynchronous I/O callback method
     ///
-    /// TODO: explain why this method should never be called.
-    /// This should be unused.
+    /// Should never be called, as this class is a convenience class provided
+    /// for instances where a socket is required but it is known that no
+    /// asynchronous operations will be carried out.
     void operator()(asio::error_code)
     {
-        // TODO: log an error if this method ever gets called.
+        // If the function is called, there is a serious logic error in the
+        // program (this class should not be used as the callback class).  As
+        // the asiolink module is too low-level for logging errors, use assert()
+        // to bug-check the program.
+        assert(false);
     }
 
     /// \brief Asynchronous I/O callback method
     ///
-    /// TODO: explain why this method should never be called.
-    /// This should be unused.
+    /// Should never be called, as this class is a convenience class provided
+    /// for instances where a socket is required but it is known that no
+    /// asynchronous operations will be carried out.
     void operator()(asio::error_code, size_t)
     {
-        // TODO: log an error if this method ever gets called.
+        // If the function is called, there is a serious logic error in the
+        // program (this class should not be used as the callback class).  As
+        // the asiolink module is too low-level for logging errors, use assert()
+        // to bug-check the program.
+        assert(false);
     }
 };