Parcourir la source

some suggested changes on style/documentation

git-svn-id: svn://bind10.isc.org/svn/bind10/branches/trac347@3904 e5f2f494-b856-4b98-b285-d166d9295462
JINMEI Tatuya il y a 14 ans
Parent
commit
17e3202219

+ 1 - 1
src/bin/auth/asio_link.cc

@@ -698,7 +698,7 @@ IntervalTimerImpl::~IntervalTimerImpl()
 
 void
 IntervalTimerImpl::setupTimer(const IntervalTimer::Callback& cbfunc,
-                                    const uint32_t interval)
+                              const uint32_t interval)
 {
     // Interval should not be 0.
     if (interval == 0) {

+ 6 - 5
src/bin/auth/asio_link.h

@@ -459,19 +459,19 @@ private:
 /// it expires.
 ///
 /// The function calls the call back function set by \c setupTimer()
-/// and update the timer to expire on (now + interval).
+/// and updates the timer to expire in (now + interval) seconds.
 /// The type of call back function is \c void(void).
 ///
 /// This class is mainly designed to use for calling
 /// \c QueryCounters::submitStatistics() periodically.
 ///
-/// Note: Destruction of the instance of this class while call back
-/// is pending causes throwing an exception from IOService.
+/// Note: Destruction of an instance of this class while call back
+/// is pending causes throwing an exception from \c IOService.
 ///
 /// Sample code:
 /// \code
 ///  void function_to_call_back() {
-///      // this function will called periodically
+///      // this function will be called periodically
 ///  }
 ///  int interval_in_seconds = 1;
 ///  IOService io_service;
@@ -505,11 +505,12 @@ public:
     /// \param io_service A reference to an instance of IOService
     ///
     IntervalTimer(IOService& io_service);
+
     /// \brief The destructor.
     ///
     /// This destructor never throws an exception.
     ///
-    /// On the destruction of this class the timer will be cancelled
+    /// On the destruction of this class the timer will be canceled
     /// inside \c asio::deadline_timer.
     ///
     ~IntervalTimer();

+ 2 - 4
src/bin/auth/main.cc

@@ -25,7 +25,6 @@
 #include <cassert>
 #include <iostream>
 
-#include <boost/foreach.hpp>
 #include <boost/bind.hpp>
 
 #include <exceptions/exceptions.h>
@@ -102,13 +101,13 @@ usage() {
     cerr << "Usage: b10-auth [-a address] [-p port] [-4|-6] [-nv]" << endl;
     exit(1);
 }
-} // end of anonymous namespace
 
 void
 statisticsTimerCallback(AuthSrv* auth_server) {
     assert(auth_server != NULL);
     auth_server->submitStatistics();
 }
+} // end of anonymous namespace
 
 int
 main(int argc, char* argv[]) {
@@ -249,8 +248,7 @@ main(int argc, char* argv[]) {
         itimer = new asio_link::IntervalTimer(*io_service);
         // set up interval timer
         // register function to send statistics with interval
-        itimer->setupTimer(boost::bind(statisticsTimerCallback,
-                                       auth_server),
+        itimer->setupTimer(boost::bind(statisticsTimerCallback, auth_server),
                            STATS_SEND_INTERVAL_SEC);
         cout << "[b10-auth] Interval timer set to send stats." << endl;
 

+ 1 - 2
src/bin/auth/statistics.cc

@@ -59,8 +59,7 @@ QueryCountersImpl::~QueryCountersImpl()
 {}
 
 void
-QueryCountersImpl::inc(const QueryCounters::QueryCounterType type)
-{
+QueryCountersImpl::inc(const QueryCounters::QueryCounterType type) {
     try {
         ++counters_.at(type);
     } catch (std::out_of_range) {

+ 3 - 5
src/bin/auth/statistics.h

@@ -14,10 +14,8 @@
 
 // $Id$
 
-#ifndef __STATS_H
-#define __STATS_H 1
-
-#include <boost/function.hpp>
+#ifndef __STATISTICS_H
+#define __STATISTICS_H 1
 
 #include <cc/session.h>
 
@@ -135,7 +133,7 @@ public:
     const std::vector<uint64_t>& getCounters() const;
 };
 
-#endif // __STATS_H
+#endif // __STATISTICS_H
 
 // Local Variables:
 // mode: c++

+ 3 - 3
src/bin/auth/tests/asio_link_unittest.cc

@@ -329,7 +329,7 @@ protected:
                 // to TimerCallBack.
                 test_obj_->timer_called_ = false;
                 timer_.setupTimer(IntervalTimer::Callback(
-                                       TimerCallBack(test_obj_)), 1);
+                                      TimerCallBack(test_obj_)), 1);
             } else if (count_ == 2) {
                 // Second time of call back.
                 // If it reaches here, re-setupTimer() is failed (unexpected).
@@ -491,7 +491,7 @@ TEST_F(ASIOLinkTest, startIntervalTimer) {
 
 TEST_F(ASIOLinkTest, destructIntervalTimer) {
     // The call back function will not be called
-    // after the timer destucted.
+    // after the timer is destructed.
     setIOService(false, false);
     // There are two timers:
     //  itimer_counter (A)
@@ -546,7 +546,7 @@ TEST_F(ASIOLinkTest, overwriteIntervalTimer) {
     //  itimer_overwriter (B)
     //   (Calls TimerCallBackOverwriter)
     //     - first time of callback, it calls setupTimer() to change
-    //       call back function and interval  of itimer to
+    //       call back function and interval of itimer to
     //       TimerCallBack / 1 second
     //       after 3 + 1 seconds from the beginning of this test,
     //       TimerCallBack() will be called and io_service_ stops.