]> source.dussan.org Git - tigervnc.git/commitdiff
Fix up Timer comments
authorPierre Ossman <ossman@cendio.se>
Fri, 18 Nov 2022 10:20:57 +0000 (11:20 +0100)
committerPierre Ossman <ossman@cendio.se>
Wed, 19 Jun 2024 14:39:07 +0000 (16:39 +0200)
They were badly formatted, way longer than the normal 72 columns.

common/rfb/Timer.h

index ddfce1b23ac1f07ced9c14642a080bd4294feaa7..3059a9b3a3fe41247846b4028171322b2668de0a 100644 (file)
@@ -27,25 +27,29 @@ namespace rfb {
 
   /* Timer
 
-     Cross-platform timeout handling.  The caller creates instances of Timer and passes a
-     Callback implementation to each.  The Callback will then be called with a pointer to
-     the Timer instance that timed-out when the timeout occurs.
-
-     The static methods of Timer are used by the main loop of the application both to
-     dispatch elapsed Timer callbacks and to determine how long to wait in select() for
-     the next timeout to occur.
-
-     For classes that can be derived it's best to use MethodTimer which can call a specific
-     method on the class, thus avoiding conflicts when subclassing.
+     Cross-platform timeout handling.  The caller creates instances of
+     Timer and passes a Callback implementation to each.  The Callback
+     will then be called with a pointer to the Timer instance that
+     timed-out when the timeout occurs.
+
+     The static methods of Timer are used by the main loop of the
+     application both to dispatch elapsed Timer callbacks and to
+     determine how long to wait in select() for the next timeout to
+     occur.
+
+     For classes that can be derived it's best to use MethodTimer which
+     can call a specific method on the class, thus avoiding conflicts
+     when subclassing.
   */
 
   struct Timer {
 
     struct Callback {
       // handleTimeout
-      //   Passed a pointer to the Timer that has timed out.  If the handler returns true
-      //   then the Timer is reset and left running, causing another timeout after the
-      //   appropriate interval.
+      //   Passed a pointer to the Timer that has timed out.  If the
+      //   handler returns true then the Timer is reset and left
+      //   running, causing another timeout after the appropriate
+      //   interval.
       //   If the handler returns false then the Timer is cancelled.
       virtual bool handleTimeout(Timer* t) = 0;
 
@@ -53,44 +57,46 @@ namespace rfb {
     };
 
     // checkTimeouts()
-    //   Dispatches any elapsed Timers, and returns the number of milliseconds until the
-    //   next Timer will timeout.
+    //   Dispatches any elapsed Timers, and returns the number of
+    //   milliseconds until the next Timer will timeout.
     static int checkTimeouts();
 
     // getNextTimeout()
-    //   Returns the number of milliseconds until the next timeout, without dispatching
-    //   any elapsed Timers.
+    //   Returns the number of milliseconds until the next timeout,
+    //   without dispatching any elapsed Timers.
     static int getNextTimeout();
 
     // Create a Timer with the specified callback handler
     Timer(Callback* cb_) {cb = cb_;}
     ~Timer() {stop();}
 
-    // startTimer
-    //   Starts the timer, causing a timeout after the specified number of milliseconds.
-    //   If the timer is already active then it will be implicitly cancelled and re-started.
+    // start()
+    //   Starts the timer, causing a timeout after the specified number
+    //   of milliseconds. If the timer is already active then it will
+    //   be implicitly cancelled and re-started.
     void start(int timeoutMs_);
 
-    // stopTimer
+    // stop()
     //   Cancels the timer.
     void stop();
 
-    // isStarted
+    // isStarted()
     //   Determines whether the timer is started.
     bool isStarted();
 
-    // getTimeoutMs
+    // getTimeoutMs()
     //   Determines the previously used timeout value, if any.
     //   Usually used with isStarted() to get the _current_ timeout.
     int getTimeoutMs();
 
-    // getRemainingMs
+    // getRemainingMs()
     //   Determines how many milliseconds are left before the Timer
     //   will timeout. Only valid for an active timer.
     int getRemainingMs();
 
-    // isBefore
-    //   Determine whether the Timer will timeout before the specified time.
+    // isBefore()
+    //   Determine whether the Timer will timeout before the specified
+    //   time.
     bool isBefore(timeval other);
 
   protected:
@@ -99,7 +105,8 @@ namespace rfb {
     Callback* cb;
 
     static void insertTimer(Timer* t);
-    // The list of currently active Timers, ordered by time left until timeout.
+    // The list of currently active Timers, ordered by time left until
+    // timeout.
     static std::list<Timer*> pending;
   };