{
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
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())
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 {
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())
// 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);
}
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();
/** \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
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_
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////////////////////////////////////////
(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)