From: g0dil Date: Wed, 10 Dec 2008 00:08:06 +0000 (+0000) Subject: Minor fixes X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=4225875220d88a3a1c2b89a7ddae7ac864daa98d;p=senf.git Minor fixes git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1011 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/PPI/SocketSource.hh b/PPI/SocketSource.hh index 49c863f..44368fb 100644 --- a/PPI/SocketSource.hh +++ b/PPI/SocketSource.hh @@ -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 diff --git a/Utils/Logger/AreaRegistry.cc b/Utils/Logger/AreaRegistry.cc index 5dc0d9d..7a6a988 100644 --- a/Utils/Logger/AreaRegistry.cc +++ b/Utils/Logger/AreaRegistry.cc @@ -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()) diff --git a/Utils/Logger/AreaRegistry.ih b/Utils/Logger/AreaRegistry.ih index 58709bf..53b3d10 100644 --- a/Utils/Logger/AreaRegistry.ih +++ b/Utils/Logger/AreaRegistry.ih @@ -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 { diff --git a/Utils/Logger/Target.cc b/Utils/Logger/Target.cc index eafaabf..d63201f 100644 --- a/Utils/Logger/Target.cc +++ b/Utils/Logger/Target.cc @@ -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()) diff --git a/Utils/Logger/Target.cti b/Utils/Logger/Target.cti index bad63ab..5d906ee 100644 --- a/Utils/Logger/Target.cti +++ b/Utils/Logger/Target.cti @@ -88,7 +88,7 @@ prefix_ void senf::log::Target::unroute(action_t action) // namespace senf::log::detail members template -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); } diff --git a/Utils/Logger/Target.ih b/Utils/Logger/Target.ih index c96eb32..a083871 100644 --- a/Utils/Logger/Target.ih +++ b/Utils/Logger/Target.ih @@ -45,7 +45,7 @@ namespace detail { using senf::singleton::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 - void write(std::string msg); + void write(std::string const & msg); #ifndef DOXYGEN diff --git a/Utils/Range.cti b/Utils/Range.cti index 0444e42..38744c3 100644 --- a/Utils/Range.cti +++ b/Utils/Range.cti @@ -41,6 +41,17 @@ senf::make_transform_range(Range const & range, Fn const & fn) boost::make_transform_iterator(boost::end(range), fn) ); } +template +prefix_ boost::iterator_range< + boost::transform_iterator< Fn, + typename boost::range_iterator::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_ diff --git a/Utils/Range.hh b/Utils/Range.hh index f9da322..6f9ef84 100644 --- a/Utils/Range.hh +++ b/Utils/Range.hh @@ -46,6 +46,12 @@ namespace senf { typename boost::range_const_iterator::type > > make_transform_range(Range const & range, Fn const & fn); + template + boost::iterator_range< + boost::transform_iterator< Fn, + typename boost::range_iterator::type > > + make_transform_range(Range & range, Fn const & fn); + } ///////////////////////////////hh.e//////////////////////////////////////// diff --git a/project.el b/project.el index 703309f..f34d538 100644 --- a/project.el +++ b/project.el @@ -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)