PPI: bugfix for FIFOQueueingAlgorithm
tho [Wed, 11 Aug 2010 10:51:51 +0000 (10:51 +0000)]
Utils: added documentation for senf::str()

git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1671 270642c3-0616-0410-b53a-bc976706d245

senf/PPI/Connectors.cc
senf/PPI/Connectors.ct
senf/PPI/QueueingSocketSink.cc
senf/Scheduler/ClockService.hh
senf/Utils/String.hh

index eca5ecc..2a876b6 100644 (file)
@@ -208,6 +208,12 @@ prefix_ void senf::ppi::connector::Connector::v_disconnected()
 ///////////////////////////////////////////////////////////////////////////
 // senf::ppi::connector::PassiveConnector
 
+prefix_ senf::ppi::connector::PassiveConnector::~PassiveConnector()
+{
+    // Must be here and NOT in base so it is called before destructing the routes_ member
+    unregisterConnector();
+}
+
 ////////////////////////////////////////
 // private members
 
@@ -255,6 +261,12 @@ prefix_ void senf::ppi::connector::PassiveConnector::notifyUnthrottle()
 ///////////////////////////////////////////////////////////////////////////
 // senf::ppi::connector::ActiveConnector
 
+prefix_ senf::ppi::connector::ActiveConnector::~ActiveConnector()
+{
+    // Must be here and NOT in base so it is called before destructing the routes_ member
+    unregisterConnector();
+}
+
 ////////////////////////////////////////
 // private members
 
index 8868e9c..ee9d903 100644 (file)
 ///////////////////////////////////////////////////////////////////////////
 // senf::ppi::connector::PassiveConnector
 
-prefix_ senf::ppi::connector::PassiveConnector::~PassiveConnector()
-{
-    // Must be here and NOT in base so it is called before destructing the routes_ member
-    unregisterConnector();
-}
-
 template <class Handler>
 prefix_ void senf::ppi::connector::PassiveConnector::onRequest(Handler handler)
 {
@@ -48,12 +42,6 @@ prefix_ void senf::ppi::connector::PassiveConnector::onRequest(Handler handler)
 ///////////////////////////////////////////////////////////////////////////
 // senf::ppi::connector::ActiveConnector
 
-prefix_ senf::ppi::connector::ActiveConnector::~ActiveConnector()
-{
-    // Must be here and NOT in base so it is called before destructing the routes_ member
-    unregisterConnector();
-}
-
 template <class Handler>
 prefix_ void senf::ppi::connector::ActiveConnector::onThrottle(Handler handler)
 {
index c21eeb8..d01ee8b 100644 (file)
@@ -83,7 +83,7 @@ prefix_ senf::ppi::FIFOQueueingAlgorithm::FIFOQueueingAlgorithm()
 prefix_ senf::Packet senf::ppi::FIFOQueueingAlgorithm::v_dequeue()
 {
     if (queue_.size() > 0) {
-        Packet const & p = queue_.front();
+        Packet p (queue_.front());
         queue_.pop();
         return p;
     }
index 59b3de0..cc859af 100644 (file)
@@ -83,14 +83,14 @@ namespace senf {
 
         /** \brief Absolute time data type
 
-            <a href="www.boost.org/doc/libs/release/libs/date_time/index.html">Boost.DateTime</a>
+            <a href="http://www.boost.org/doc/libs/release/libs/date_time/index.html">Boost.DateTime</a>
             datatype used to represent absolute date/time values.
          */
         typedef boost::posix_time::ptime abstime_type;
 
         /** \brief Relative time data type
 
-            <a href="www.boost.org/doc/libs/release/libs/date_time/index.html">Boost.DateTime</a>
+            <a href="http://www.boost.org/doc/libs/release/libs/date_time/index.html">Boost.DateTime</a>
             datatype used to represent time intervals
          */
         typedef boost::posix_time::time_duration reltime_type;
@@ -101,7 +101,7 @@ namespace senf {
 
         static abstime_type abstime(clock_type clock); ///< Convert clock to absolute time
                                         /**< This member converts a clock value into an absolute
-                                             <a href="www.boost.org/doc/libs/release/libs/date_time/index.html">Boost.DateTime</a>
+                                             <a href="http://www.boost.org/doc/libs/release/libs/date_time/index.html">Boost.DateTime</a>
                                              value.
                                              \note You should not base timeout calculations on this
                                                  absolute time value. Clock time is guaranteed to be
@@ -110,7 +110,7 @@ namespace senf {
 
         static reltime_type reltime(clock_type clock); ///< Convert clock to relative time
                                         /**< This member converts a clock value into a relative
-                                             <a href="www.boost.org/doc/libs/release/libs/date_time/index.html">Boost.DateTime</a>
+                                             <a href="http://www.boost.org/doc/libs/release/libs/date_time/index.html">Boost.DateTime</a>
                                              time interval
                                              \note The resolution of reltime_type might be smaller
                                                  than the clock_type resolution */
index ed1e65b..5a0c8c0 100644 (file)
@@ -42,6 +42,22 @@ namespace senf {
     template <class ForwardReadableRange>
     std::string stringJoin(ForwardReadableRange const & range, std::string sep);
 
+    /** \brief Get string representation
+
+        Returns the result of streaming the argument into a standard library string-based
+        stream and then out as a std::string object. The conversion is done with
+        <tt>boost::lexical_cast</tt>. The call is equivalent to
+        <pre>
+            boost::lexical_cast<std::string>(t);
+        </pre>
+        \pre
+            <tt>t</tt> must be <i>OutputStreamable</i>,
+                meaning that an <tt>operator\<\<</tt> is defined\n
+            <tt>t</tt> must be <i>CopyConstructible</i>
+
+        \see <a href="http://www.boost.org/doc/libs/release/libs/conversion/lexical_cast.htm">
+            boost::lexical_cast</a>
+     */
     template <class T>
     std::string str(T const & t);