Minor fixes
g0dil [Wed, 10 Dec 2008 00:08:06 +0000 (00:08 +0000)]
git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1011 270642c3-0616-0410-b53a-bc976706d245

PPI/SocketSource.hh
Utils/Logger/AreaRegistry.cc
Utils/Logger/AreaRegistry.ih
Utils/Logger/Target.cc
Utils/Logger/Target.cti
Utils/Logger/Target.ih
Utils/Range.cti
Utils/Range.hh
project.el

index 49c863f..44368fb 100644 (file)
@@ -91,11 +91,12 @@ namespace module {
         {
         public:
             typedef unspecified_type Handle;                       // type of handle requested
+            typedef unspecified_type PacketType                    // type of packet returned
 
             SomeReader();                                          // EITHER default constructible
             SomeReader(SomeReader const & other);                  // OR copy constructible
 
-            Packet operator()(Handle handle);                      // extraction function
+            PacketType operator()(Handle handle);                  // extraction function
         };
         \endcode
         Whenever the FileHandle object is ready for reading, the \a Reader's \c operator() is called
index 5dc0d9d..7a6a988 100644 (file)
@@ -89,7 +89,7 @@ prefix_ void senf::log::detail::AreaBase::removeRoutingCache(Target & target,
 
 prefix_ void senf::log::detail::AreaBase::write(time_type timestamp,
                                                 StreamBase const & stream, unsigned level,
-                                                std::string msg)
+                                                std::string const & msg)
     const
 {
     if (stream.index >= routingCache_.size())
index 58709bf..53b3d10 100644 (file)
@@ -58,7 +58,7 @@ namespace detail {
         void updateRoutingCache(Target & target, StreamBase const & stream, unsigned limit) const; 
         void removeRoutingCache(Target & target, StreamBase const & stream) const; 
         void write(time_type timestamp, StreamBase const & stream, unsigned level,
-              std::string msg) const;
+                   std::string const & msg) const;
 
     private:
         struct RouteEntry {
index eafaabf..d63201f 100644 (file)
@@ -206,7 +206,7 @@ prefix_ void senf::log::Target::write(time_type timestamp,
 
 prefix_ void senf::log::detail::TargetRegistry::write(StreamBase const & stream,
                                                       AreaBase const & area, unsigned level,
-                                                      std::string msg)
+                                                      std::string const & msg)
 {
     if (fallbackRouting_) {
         if (level >= stream.defaultRuntimeLimit())
index bad63ab..5d906ee 100644 (file)
@@ -88,7 +88,7 @@ prefix_ void senf::log::Target::unroute(action_t action)
 // namespace senf::log::detail members
 
 template <class Stream, class Area, class Level>
-prefix_ void senf::log::detail::write(std::string msg)
+prefix_ void senf::log::detail::write(std::string const & msg)
 {
     TargetRegistry::instance().write(Stream::instance(), Area::instance(), Level::value, msg);
 }
index c96eb32..a083871 100644 (file)
@@ -45,7 +45,7 @@ namespace detail {
         using senf::singleton<TargetRegistry>::instance;
 
         void write(StreamBase const & stream, AreaBase const & area, unsigned level, 
-                   std::string msg);
+                   std::string const & msg);
 
         void routed();
         bool fallbackRouting();
@@ -67,7 +67,7 @@ namespace detail {
 
     /** \brief Internal: Write log message */
     template <class Stream, class Area, class Level>
-    void write(std::string msg);
+    void write(std::string const & msg);
 
 #ifndef DOXYGEN
 
index 0444e42..38744c3 100644 (file)
@@ -41,6 +41,17 @@ senf::make_transform_range(Range const & range, Fn const & fn)
         boost::make_transform_iterator(boost::end(range), fn) );
 }
 
+template <class Range, class Fn>
+prefix_ boost::iterator_range< 
+        boost::transform_iterator< Fn,
+                                   typename boost::range_iterator<Range>::type > >
+senf::make_transform_range(Range & range, Fn const & fn)
+{
+    return boost::make_iterator_range(
+        boost::make_transform_iterator(boost::begin(range), fn),
+        boost::make_transform_iterator(boost::end(range), fn) );
+}
+
 ///////////////////////////////cti.e///////////////////////////////////////
 #undef prefix_
 
index f9da322..6f9ef84 100644 (file)
@@ -46,6 +46,12 @@ namespace senf {
                                    typename boost::range_const_iterator<Range>::type > >
     make_transform_range(Range const & range, Fn const & fn);
 
+    template <class Range, class Fn>
+    boost::iterator_range< 
+        boost::transform_iterator< Fn,
+                                   typename boost::range_iterator<Range>::type > >
+    make_transform_range(Range & range, Fn const & fn);
+
 }
 
 ///////////////////////////////hh.e////////////////////////////////////////
index 703309f..f34d538 100644 (file)
@@ -3,7 +3,9 @@
 (defun check-namespace-indent (arg)
   (save-excursion
     (back-to-indentation)
-    (if (looking-at "namespace") [0] '+)))
+    (if (and (looking-at "namespace")
+            (not (looking-at ".*}")))
+       [0] '+)))
 
  (defconst senf-c-style
   '((c-basic-offset              . 4)