Packets: extended description of bad_cast exception in Packet.as()
tho [Thu, 10 Mar 2011 12:45:21 +0000 (12:45 +0000)]
PPI: added descriptive name parameter to IdleEvent
some minor cleanups

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

73 files changed:
senf/PPI/ActiveFeeder.test.cc
senf/PPI/AnnotationRouter.ct
senf/PPI/CloneSource.cc
senf/PPI/CloneSource.hh
senf/PPI/DebugModules.hh
senf/PPI/Events.cci
senf/PPI/IdleEvent.cc
senf/PPI/IdleEvent.cci
senf/PPI/IdleEvent.hh
senf/PPI/Module.cci
senf/PPI/QueueingSocketSink.test.cc
senf/PPI/RateAnalyzer.cc
senf/PPI/RateFilter.cc
senf/PPI/RateFilter.hh
senf/PPI/SocketSource.test.cc
senf/Packets/80211Bundle/InformationElements.hh
senf/Packets/80211Bundle/RadiotapPacket.cc
senf/Packets/80211Bundle/RadiotapPacket.hh
senf/Packets/80211Bundle/WLANBeaconPacket.cc
senf/Packets/80211Bundle/WLANBeaconPacket.hh
senf/Packets/80211Bundle/WLANPacket.cc
senf/Packets/80211Bundle/WLANPacket.hh
senf/Packets/80221Bundle/MIHMessageRegistry.test.cc
senf/Packets/80221Bundle/MIHPacket.cc
senf/Packets/80221Bundle/MIHPacket.hh
senf/Packets/DefaultBundle/ICMPv6Packet.cc
senf/Packets/DefaultBundle/ICMPv6TypePacket.cc
senf/Packets/DefaultBundle/RTPPacket.hh
senf/Packets/GenericTLV.ct
senf/Packets/ListParser.ct
senf/Packets/MPEGDVBBundle/SNDUPacket.cc
senf/Packets/Packet.cti
senf/Packets/Packet.test.cc
senf/Scheduler/ClockService.cc
senf/Scheduler/FIFORunner.cc
senf/Scheduler/ReadHelper.ct
senf/Scheduler/Scheduler.cc
senf/Scheduler/TimerEvent.cc
senf/Scheduler/TimerEvent.cci
senf/Scheduler/TimerSource.cc
senf/Socket/Protocols/DVB/DVBProtocolWrapper.cc
senf/Socket/Protocols/DVB/DVBSocketController.cc
senf/Socket/Protocols/INet/INet4Address.cc
senf/Socket/Protocols/INet/INet6Address.cc
senf/Socket/Protocols/INet/INet6Address.ct
senf/Socket/Protocols/UN/UNSocketProtocol.hh
senf/Socket/SocketHandle.cc
senf/Socket/SocketHandle.cci
senf/Socket/SocketHandle.cti
senf/Socket/SocketHandle.ih
senf/Socket/SocketProtocol.cc
senf/Socket/SocketProtocol.hh
senf/Utils/Console/Config.cc
senf/Utils/Console/Executor.cc
senf/Utils/Console/Node.cc
senf/Utils/Console/Parse.cc
senf/Utils/Console/ParsedCommand.hh
senf/Utils/Console/Server.cc
senf/Utils/Logger/FileTarget.cc
senf/Utils/Logger/LogFormat.cc
senf/Utils/Logger/SyslogTarget.cc
senf/Utils/Logger/SyslogTarget.hh
senf/Utils/Logger/SyslogUDPTarget.cc
senf/Utils/Logger/SyslogUDPTarget.cci
senf/Utils/Logger/SyslogUDPTarget.hh
senf/Utils/Logger/Target.cc
senf/Utils/Statistics.cc
senf/Utils/Statistics.cci
senf/Utils/StatisticsTargets.cc
senf/Utils/StatisticsTargets.hh
senf/Utils/Termlib/Editor.cc
senf/Utils/Termlib/Telnet.cc
senf/Utils/preprocessor.hh

index ec4c378..ef9abcb 100644 (file)
@@ -45,7 +45,7 @@ namespace scheduler = senf::scheduler;
 
 namespace {
     void run(senf::ClockService::clock_type t) {
-        scheduler::TimerEvent timeout(
+        scheduler::TimerEvent timeout (
                 "test-timeout", &scheduler::terminate, scheduler::now() + t);
         ppi::run();
     }
index 6e6a7ac..0827b94 100644 (file)
@@ -26,7 +26,6 @@
 //#include "AnnotationRouter.ih"
 
 // Custom includes
-#include "Connectors.hh"
 
 #define prefix_
 //-/////////////////////////////////////////////////////////////////////////////////////////////////
index a166df8..fbcd8ef 100644 (file)
 #define prefix_
 //-/////////////////////////////////////////////////////////////////////////////////////////////////
 
-senf::ppi::module::CloneSource::CloneSource(senf::Packet const & packet)
+prefix_ senf::ppi::module::CloneSource::CloneSource(senf::Packet const & packet)
     : packet_(packet)
 {
     noroute(output);
     output.onRequest(&CloneSource::request);
 }
 
-void senf::ppi::module::CloneSource::request()
+prefix_ void senf::ppi::module::CloneSource::request()
 {
     output(packet_.clone());
 }
 
-void senf::ppi::module::CloneSource::replacePacket(senf::Packet const & packet)
+prefix_ void senf::ppi::module::CloneSource::replacePacket(senf::Packet const & packet)
 {
     packet_ = packet;
 }
index 3b0b5e7..7eb092e 100644 (file)
@@ -27,7 +27,6 @@
 #define HH_SENF_PPI_CloneSource_ 1
 
 // Custom includes
-#include <senf/Packets/Packets.hh>
 #include "Module.hh"
 #include "Connectors.hh"
 
index 4da15ef..64591ad 100644 (file)
@@ -29,7 +29,6 @@
 // Custom includes
 #include <deque>
 #include <senf/Utils/safe_bool.hh>
-#include <senf/Packets/Packets.hh>
 #include "MonitorModule.hh"
 #include "ActiveFeeder.hh"
 #include <senf/Utils/Logger/SenfLog.hh>
index b65dfe0..b3b5d9b 100644 (file)
@@ -24,8 +24,6 @@
     \brief Events inline non-template implementation */
 
 // Custom includes
-#include <senf/Utils/senfassert.hh>
-#include <senf/PPI/detail/EventBinding.hh>
 
 #define prefix_ inline
 //-/////////////////////////////////////////////////////////////////////////////////////////////////
index 65b50f4..a0eae65 100644 (file)
@@ -27,8 +27,6 @@
 //#include "IdleEvent.ih"
 
 // Custom includes
-#include <senf/Scheduler/Scheduler.hh>
-#include <senf/Utils/Logger/SenfLog.hh>
 
 //#include "IdleEvent.mpp"
 #define prefix_
index c866228..ad152e1 100644 (file)
@@ -31,8 +31,8 @@
 //-/////////////////////////////////////////////////////////////////////////////////////////////////
 // senf::ppi::IdleEvent
 
-prefix_ senf::ppi::IdleEvent::IdleEvent()
-    : timer_ ("senf::ppi::IdleEvent", boost::bind(&IdleEvent::cb,this))
+prefix_ senf::ppi::IdleEvent::IdleEvent(std::string const & name)
+    : timer_ (name.empty() ? "senf::ppi::IdleEvent" : name, boost::bind(&IdleEvent::cb,this))
 {}
 
 //-/////////////////////////////////////////////////////////////////////////////////////////////////
index 11ff42a..b2023f8 100644 (file)
@@ -46,9 +46,7 @@ namespace ppi {
         : public EventImplementation<>
     {
     public:
-        IdleEvent();
-
-    protected:
+        IdleEvent(std::string const & name = "");
 
     private:
         virtual void v_enable();
index 4157922..d153cb4 100644 (file)
@@ -27,7 +27,6 @@
 #include "Route.hh"
 #include "Connectors.hh"
 #include "EventManager.hh"
-#include "ModuleManager.hh"
 #include <boost/lambda/lambda.hpp>
 #include <boost/lambda/bind.hpp>
 #include <algorithm>
index cdf60b0..44a49d0 100644 (file)
@@ -116,7 +116,7 @@ SENF_AUTO_UNIT_TEST(passiveQueueingSocketSink)
     source.submit(p);
     BOOST_CHECK_EQUAL( udpSink.qAlgorithm().size(), 1);
 
-    for( int n = 0; n < 100; n++) {
+    for (int n = 0; n < 100; n++) {
         source.submit(p);
     }
     // queue default size is 64
index 96e21b8..30329d6 100644 (file)
@@ -38,12 +38,11 @@ prefix_ senf::ppi::module::RateAnalyzer::RateAnalyzer()
     registerEvent(timer_, &RateAnalyzer::tick);
 }
 
-prefix_ void senf::ppi::module::RateAnalyzer::startStatistics(senf::ClockService::clock_type interval)
+prefix_ void senf::ppi::module::RateAnalyzer::startStatistics(ClockService::clock_type interval)
 {
     timer_.interval(interval);
-    factor_ = double(senf::ClockService::in_nanoseconds(interval)) /
-        double(senf::ClockService::in_nanoseconds(
-                   senf::ClockService::seconds(1)));
+    factor_ = double(ClockService::in_nanoseconds(interval)) /
+        double(ClockService::in_nanoseconds(ClockService::seconds(1)));
 }
 
 prefix_ void senf::ppi::module::RateAnalyzer::v_handlePacket(Packet const & p)
index b637a72..437578d 100644 (file)
@@ -32,7 +32,7 @@
 #define prefix_
 //-/////////////////////////////////////////////////////////////////////////////////////////////////
 
-senf::ppi::module::RateFilter::RateFilter(senf::ClockService::clock_type interval)
+prefix_ senf::ppi::module::RateFilter::RateFilter(ClockService::clock_type interval)
     : timer_(interval)
 {
     route(input, timer_);
@@ -40,18 +40,18 @@ senf::ppi::module::RateFilter::RateFilter(senf::ClockService::clock_type interva
     registerEvent(timer_, &RateFilter::timeout);
 }
 
-void senf::ppi::module::RateFilter::timeout()
+prefix_ void senf::ppi::module::RateFilter::timeout()
 {
     output(input());
 }
 
-senf::ClockService::clock_type senf::ppi::module::RateFilter::interval()
+prefix_ senf::ClockService::clock_type senf::ppi::module::RateFilter::interval()
     const
 {
     return timer_.interval().first;
 }
 
-void senf::ppi::module::RateFilter::interval(senf::ClockService::clock_type interval)
+prefix_ void senf::ppi::module::RateFilter::interval(ClockService::clock_type interval)
 {
     timer_.interval(interval);
 }
index c0b77de..4fccfce 100644 (file)
@@ -44,9 +44,9 @@ class RateFilter
     SENF_PPI_MODULE(RateFilter);
 
 public:
-    RateFilter(senf::ClockService::clock_type interval);
-    void interval(senf::ClockService::clock_type interval);
-    senf::ClockService::clock_type interval() const;
+    RateFilter(ClockService::clock_type interval);
+    void interval(ClockService::clock_type interval);
+    ClockService::clock_type interval() const;
 
     connector::ActiveInput<> input;
     connector::ActiveOutput<> output;
index cd4211f..ed24997 100644 (file)
 namespace ppi = senf::ppi;
 namespace module = ppi::module;
 namespace debug = module::debug;
+namespace scheduler = senf::scheduler;
 
 namespace {
-    void timeout() {
-        senf::scheduler::terminate();
+    void runPPI(senf::ClockService::clock_type t)
+    {
+        scheduler::TimerEvent timeout(
+                "socketSource test timer", &scheduler::terminate, scheduler::now() + t);
+        ppi::run();
     }
 
     int base_pid = 0;
@@ -81,10 +85,7 @@ SENF_AUTO_UNIT_TEST(socketSource)
 
     senf::UDPv4ClientSocketHandle outputSocket;
     outputSocket.writeto(senf::INet4SocketAddress(localhost4str(0)),data);
-    senf::scheduler::TimerEvent timer (
-        "socketSource test timer", &timeout,
-        senf::ClockService::now() + senf::ClockService::milliseconds(100));
-    senf::ppi::run();
+    runPPI( senf::ClockService::milliseconds(100));
 
     BOOST_REQUIRE( ! sink.empty() );
     BOOST_CHECK_EQUAL( sink.front().data().size(), data.size() );
index 396b62a..92c79f7 100644 (file)
@@ -71,7 +71,7 @@ namespace senf {
     #   include SENF_PARSER()
         SENF_PARSER_INHERIT  ( WLANInfoElementParser               );
         // we just skip the value here. If somebody needs the information he has to implement
-        // this strange information element hisself.
+        // this strange information element himself.
         SENF_PARSER_SKIP     ( length(), 0                         );
         SENF_PARSER_FINALIZE ( WLANSupportedRatesInfoElementParser );
 
index d9d97bc..521301e 100644 (file)
@@ -64,7 +64,7 @@ prefix_ void senf::RadiotapPacketParser::parseOffsetTable(boost::uint8_t * data,
     unsigned size (8u);
     while (ieee80211_radiotap_iterator_next(&iter) == 0) {
         if (iter.is_radiotap_ns &&
-            iter.this_arg_index <= int(senf::RadiotapPacketParser::MAX_INDEX))
+            iter.this_arg_index <= int(RadiotapPacketParser::MAX_INDEX))
             table[iter.this_arg_index] = iter.this_arg - data;
         // We need to set size here in the loop since the iter fields are only valid
         // when at least one present bit is set ...
@@ -192,7 +192,7 @@ prefix_ void senf::RadiotapPacketParser::updatePresentFlags(boost::uint32_t flag
 //-/////////////////////////////////////////////////////////////////////////////////////////////////
 // senf::RadiotapPacketType
 
-prefix_ void senf::RadiotapPacketType::dump(packet p, std::ostream &os)
+prefix_ void senf::RadiotapPacketType::dump(packet p, std::ostream & os)
 {
     boost::io::ios_all_saver ias(os);
     os << "Radiotap:\n"
index 69414e6..c375a56 100644 (file)
@@ -320,7 +320,7 @@ namespace senf {
         using mixin::initSize;
 
         static void init(packet p);
-        static void dump(packet p, std::ostream &os);
+        static void dump(packet p, std::ostream & os);
         static factory_t nextPacketType(packet p);
         static optional_range nextPacketRange(packet p);
     };
index d18abf1..04eee2f 100644 (file)
@@ -31,7 +31,7 @@
 #define prefix_
 //-/////////////////////////////////////////////////////////////////////////////////////////////////
 
-prefix_ void senf::WLANBeaconPacketType::dump(packet p, std::ostream &os)
+prefix_ void senf::WLANBeaconPacketType::dump(packet p, std::ostream & os)
 {
     boost::io::ios_all_saver ias(os);
     os << "WLAN beacon frame:\n"
index 25b631b..750c4cf 100644 (file)
@@ -73,7 +73,7 @@ namespace senf {
         using mixin::initSize;
         using PacketTypeBase::nextPacketRange;
 
-        static void dump(packet p, std::ostream &os);
+        static void dump(packet p, std::ostream & os);
     };
 
     /** \brief WLAN Beacon frame packet typedef
index fd3355a..2486a9d 100644 (file)
@@ -61,7 +61,7 @@ prefix_ void senf::WLANPacket_MgtFrameParser::sequenceNumber(boost::uint16_t sn)
     seqNumber_1() = 0u | sn;
 }
 
-prefix_ void senf::WLANPacket_MgtFrameType::dump(packet p, std::ostream &os)
+prefix_ void senf::WLANPacket_MgtFrameType::dump(packet p, std::ostream & os)
 {
     boost::io::ios_all_saver ias(os);
     os << "802.11 MAC Management Frame:\n";
@@ -73,7 +73,7 @@ prefix_ void senf::WLANPacket_MgtFrameType::dump(packet p, std::ostream &os)
        << senf::fieldName("fragment number")       << p->fragmentNumber() << "\n";
 }
 
-prefix_ void senf::WLANPacket_CtrlFrameType::dump(packet p, std::ostream &os)
+prefix_ void senf::WLANPacket_CtrlFrameType::dump(packet p, std::ostream & os)
 {
     boost::io::ios_all_saver ias(os);
     os << "802.11 MAC Control Frame:\n";
@@ -89,7 +89,6 @@ prefix_ void senf::WLANPacket_DataFrameParser::sequenceNumber(boost::uint16_t sn
     seqNumber_1() = 0u | sn;
 }
 
-
 prefix_ senf::MACAddressParser senf::WLANPacket_DataFrameParser::destinationAddress()
     const
 {
@@ -129,7 +128,7 @@ prefix_ senf::MACAddressParser senf::WLANPacket_DataFrameParser::bssid()
     }
 }
 
-prefix_ void senf::WLANPacket_DataFrameType::dump(packet p, std::ostream &os)
+prefix_ void senf::WLANPacket_DataFrameType::dump(packet p, std::ostream & os)
 {
     boost::io::ios_all_saver ias(os);
     os << "802.11 MAC Data Frame:\n";
index fa175a9..4a91e39 100644 (file)
@@ -120,7 +120,7 @@ namespace senf
         using mixin::initSize;
         using PacketTypeBase::nextPacketRange;
 
-        static void dump(packet p, std::ostream &os);
+        static void dump(packet p, std::ostream & os);
     };
 
     /** \brief WLAN Management frame packet typedef
@@ -178,7 +178,7 @@ namespace senf
         using mixin::initSize;
         using PacketTypeBase::nextPacketRange;
 
-        static void dump(packet p, std::ostream &os);
+        static void dump(packet p, std::ostream & os);
     };
 
     /** \brief WLAN Control frame packet typedef
@@ -282,7 +282,7 @@ namespace senf
                 : no_factory();
         }
 
-        static void dump(packet p, std::ostream &os);
+        static void dump(packet p, std::ostream & os);
     };
 
     /** \brief WLAN Data frame packet typedef
index 2c06fd3..9fb12ef 100644 (file)
@@ -81,7 +81,7 @@ namespace test {
         static const boost::uint16_t MESSAGE_ID;
 
         static void validate(packet message) {
-            return message->registerRequestCodeTLV().validate();
+            message->registerRequestCodeTLV().validate();
         }
     };
 
index 50b4439..4c40482 100644 (file)
@@ -40,7 +40,7 @@ SENF_PACKET_REGISTRY_REGISTER( senf::EtherTypes, 0x8917, senf::MIHPacket);
 //-/////////////////////////////////////////////////////////////////////////////////////////////////
 // MIHPacketType
 
-prefix_ void senf::MIHPacketType::dump(packet p, std::ostream &os)
+prefix_ void senf::MIHPacketType::dump(packet p, std::ostream & os)
 {
     boost::io::ios_all_saver ias(os);
     os << "MIH Packet:\n"
@@ -89,7 +89,7 @@ prefix_ void senf::MIHPacketType::validate(packet p)
             throw InvalidMIHPacketException("wrong MIH length: ") << senf::str(p->payloadLength());
         if (p.next(senf::nothrow))
             MIHMessageRegistry::instance().validate( p->messageId(), p.next());
-    } catch (senf::TruncatedPacketException e) {
+    } catch (TruncatedPacketException & e) {
         throw InvalidMIHPacketException("truncated MIH message");
     }
 }
@@ -97,7 +97,7 @@ prefix_ void senf::MIHPacketType::validate(packet p)
 //-/////////////////////////////////////////////////////////////////////////////////////////////////
 // MIHGenericPayloadPacketType
 
-prefix_ void senf::MIHGenericPayloadPacketType::dump(packet p, std::ostream &os)
+prefix_ void senf::MIHGenericPayloadPacketType::dump(packet p, std::ostream & os)
 {
     boost::io::ios_all_saver ias(os);
     os << "MIH Payload (service specific TLVs):\n";
index 8b54535..f99c588 100644 (file)
@@ -106,7 +106,7 @@ namespace senf {
         using mixin::initSize;
 
         /** \brief Dump given MIH packet in readable form to given output stream */
-        static void dump(packet p, std::ostream &os);
+        static void dump(packet p, std::ostream & os);
         static void finalize(packet p);
         static factory_t nextPacketType(packet p);
         static void validate(packet p);
@@ -138,7 +138,7 @@ namespace senf {
         using mixin::initSize;
 
         /** \brief Dump given MIHGenericPayload in readable form to given output stream */
-        static void dump(packet p, std::ostream &os);
+        static void dump(packet p, std::ostream & os);
         static void finalize(packet p);
     };
 
index 7f38e57..821aa16 100644 (file)
@@ -40,19 +40,19 @@ SENF_PACKET_REGISTRY_REGISTER( senf::IpTypes, 58, senf::ICMPv6Packet);
 prefix_ boost::uint16_t senf::ICMPv6PacketParser::calcChecksum()
     const
 {
-    senf::IPv6Packet ipv6 (packet().rfind<senf::IPv6Packet>(senf::nothrow));
+    IPv6Packet ipv6 (packet().rfind<IPv6Packet>(senf::nothrow));
     if (! ipv6) return 0u;
 
-    senf::IpChecksum summer;
+    IpChecksum summer;
 
     //-/////////////////////////////////////////////////////////////////////////////////////////////
     // IPv6 pseudo header
     summer.feed( ipv6->source().i(),
-                 ipv6->source().i() + senf::IPv6Packet::Parser::source_t::fixed_bytes );
+                 ipv6->source().i() + IPv6Packet::Parser::source_t::fixed_bytes );
     // need support for HopByHop routing header -> the destination used here must be the *final*
     // destination ...
     summer.feed( ipv6->destination().i(),
-                 ipv6->destination().i() + senf::IPv6PacketParser::destination_t::fixed_bytes );
+                 ipv6->destination().i() + IPv6PacketParser::destination_t::fixed_bytes );
     // packet length
     boost::uint32_t size (data().size());
     summer.feed((size>>24)&0xff);
@@ -76,12 +76,12 @@ prefix_ boost::uint16_t senf::ICMPv6PacketParser::calcChecksum()
     return rv ? rv : 0xffffu;
 }
 
-prefix_ void senf::ICMPv6PacketType::dump(packet p, std::ostream &os)
+prefix_ void senf::ICMPv6PacketType::dump(packet p, std::ostream & os)
 {
     boost::io::ios_all_saver ias(os);
     os << "ICMPv6 protocol:\n"
-       << senf::fieldName("type")                      << unsigned(p->type()) <<"\n"
-       << senf::fieldName("code")                      << unsigned(p->code()) <<"\n"
+       << senf::fieldName("type") << unsigned(p->type()) << "\n"
+       << senf::fieldName("code") << unsigned(p->code()) << "\n"
        << senf::fieldName("checksum")
        << "0x" << std::hex << std::setw(4) << unsigned(p->checksum()) << "\n";
 }
index 4420c07..4d393d6 100644 (file)
@@ -124,19 +124,19 @@ prefix_ void senf::MLDv2ListenerReportType::dump(packet p, std::ostream & os)
        << senf::fieldName("Reserved")              << unsigned(p->reserved() )
        <<"\n  Multicast Address Records:\n";
 
-    senf::MLDv2ListenerReport::Parser::mcastAddrRecords_t::container cAddrR (p->mcastAddrRecords() );
-    senf::MLDv2ListenerReport::Parser::mcastAddrRecords_t::container::iterator iAddrR (cAddrR.begin() );
+    MLDv2ListenerReport::Parser::mcastAddrRecords_t::container cAddrR (p->mcastAddrRecords() );
+    MLDv2ListenerReport::Parser::mcastAddrRecords_t::container::iterator iAddrR (cAddrR.begin() );
     for (; iAddrR != cAddrR.end(); ++iAddrR) {
         os << senf::fieldName("  Record Type")         << unsigned(iAddrR->recordType()) << "\n"
            << senf::fieldName("  Multicast Address")   << iAddrR->mcAddress() << "\n"
            << "    Source Addresses\n:";
-        senf::MLDv2AddressRecordParser::srcAddresses_t::container cSrcAddr (iAddrR->srcAddresses());
-        senf::MLDv2AddressRecordParser::srcAddresses_t::container::iterator iSrcAddr (cSrcAddr.begin());
+        MLDv2AddressRecordParser::srcAddresses_t::container cSrcAddr (iAddrR->srcAddresses());
+        MLDv2AddressRecordParser::srcAddresses_t::container::iterator iSrcAddr (cSrcAddr.begin());
         for (;iSrcAddr != cSrcAddr.end();++iSrcAddr)
             os << "      " << *iSrcAddr << "\n";
         os << "    Auxiliary Data:\n";
-        senf::MLDv2AddressRecordParser::auxData_t::container cAuxD ( iAddrR->auxData() );
-        senf::MLDv2AddressRecordParser::auxData_t::container::iterator iAuxD (cAuxD.begin() );
+        MLDv2AddressRecordParser::auxData_t::container cAuxD ( iAddrR->auxData() );
+        MLDv2AddressRecordParser::auxData_t::container::iterator iAuxD (cAuxD.begin() );
         for (;iAuxD != cAuxD.end(); ++iAuxD)
             os << "      " << *iAuxD << "\n";
     }
index 421e668..061e756 100644 (file)
@@ -63,7 +63,7 @@ namespace senf {
         using mixin::init;
         using mixin::initSize;
 
-        static void dump(packet p, std::ostream &os);
+        static void dump(packet p, std::ostream & os);
     };
 
     typedef RTPPacketType::packet RTPPacket;
index 3dd6bfd..17eda3c 100644 (file)
@@ -41,8 +41,8 @@ template <class Base>
 template <class Parser>
 prefix_ Parser senf::GenericTLVParserBase<Base>::init()
 {
-    senf::PacketParserBase::size_type oldSize (bytes() );
-    senf::PacketParserBase::size_type newParserSize ( senf::init_bytes<Parser>::value );
+    PacketParserBase::size_type oldSize (bytes() );
+    PacketParserBase::size_type newParserSize ( senf::init_bytes<Parser>::value );
     this->resize(  oldSize, newParserSize);
     std::fill(this->i(), boost::next(this->i(), newParserSize), 0u);
     Parser concreteParser = Parser(this->i(), this->state() );
@@ -60,8 +60,8 @@ prefix_  void senf::GenericTLVParserBase<Base>::dump(std::ostream & os)
     } else {
         boost::io::ios_all_saver ias(os);
         os << "  GenericTLVParser<" << prettyName(typeid(Base)) << ">\n"
-           << "    type:   " << senf::format::dumpint(this->type()) << "\n"
-           << "    length: " << senf::format::dumpint(this->length()) << "\n"
+           << "    type:   " << format::dumpint(this->type()) << "\n"
+           << "    length: " << format::dumpint(this->length()) << "\n"
            << "    value:\n";
         hexdump(value().begin(), value().end(), os);
     }
@@ -71,7 +71,7 @@ template <class Base>
 prefix_  senf::PacketInterpreterBase::range senf::GenericTLVParserBase<Base>::value()
     const
 {
-    senf::PacketData::iterator begin ( boost::next(this->i(), senf::bytes( self())) );
+    PacketData::iterator begin ( boost::next(this->i(), senf::bytes( self())) );
     return PacketInterpreterBase::range(begin, boost::next( begin, this->length()) );
 }
 
index 09d820a..9bc0da7 100644 (file)
@@ -42,7 +42,7 @@ prefix_ void senf::ListParser<ListPolicy>::init()
     container c (*this);
     typename container::iterator i (c.begin());
     typename container::iterator const e (c.end());
-    for(; i!=e; ++i)
+    for (; i!=e; ++i)
         i->init();
 }
 
index 00acdf1..53c3bd3 100644 (file)
@@ -55,7 +55,7 @@ prefix_ senf::PacketInterpreterBase::factory_t senf::SNDUPacketType::nextPacketT
 {
     if (p.data().size() < 8)
         return no_factory();
-    senf::PacketInterpreterBase::factory_t f (no_factory());
+    PacketInterpreterBase::factory_t f (no_factory());
     if (p->type() < 1536) {
         PacketRegistry<senf::ULEExtHeaderTypes>::Entry const * e (
             PacketRegistry<senf::ULEExtHeaderTypes>::lookup( p->type(), nothrow ));
index d8e06c1..8184317 100644 (file)
@@ -62,7 +62,10 @@ prefix_ OtherPacket senf::Packet::as()
     const
 {
     if (!is<OtherPacket>())
-        throw WrapException<std::bad_cast>(std::bad_cast());
+        throw WrapException<std::bad_cast>(std::bad_cast())
+            << ": called packet::as() with wrong PacketType: "
+            << (valid() ? typeId().prettyName() : "invalid packet")
+            << " != " << prettyName(typeid(OtherPacket));
     return OtherPacket(ptr()->as<typename OtherPacket::type>());
 }
 
index 49c9ba0..b2191c8 100644 (file)
@@ -160,6 +160,9 @@ SENF_AUTO_UNIT_TEST(packet)
     senf::Packet packet (FooPacket::create());
     BarPacket::createAfter(packet);
 
+    BOOST_CHECK_THROW( senf::Packet().as<BarPacket>(), senf::WrapException<std::bad_cast> );
+    BOOST_CHECK_THROW( packet.as<BarPacket>(), senf::WrapException<std::bad_cast> );
+
     BOOST_REQUIRE( packet );
     BOOST_CHECK( packet.next() );
     BOOST_CHECK( ! packet.next().next(senf::nothrow) );
index c3ee343..d3e2494 100644 (file)
@@ -41,8 +41,8 @@ senf::parseClockServiceInterval(console::ParseCommandInfo::TokensRange const & t
     out = 0;
     std::string value;
     {
-        senf::console::CheckedArgumentIteratorWrapper arg (tokens);
-        senf::console::parse( *(arg++), value );
+        console::CheckedArgumentIteratorWrapper arg (tokens);
+        console::parse( *(arg++), value );
     }
     static boost::sregex_iterator::regex_type rx ("[mun]?[dhms]");
     boost::sregex_iterator i (value.begin(), value.end(), rx);
@@ -73,11 +73,11 @@ senf::parseClockServiceInterval(console::ParseCommandInfo::TokensRange const & t
         case 'm': v *= 60.0;
         case 's': v *= 1000000000.0;
         }
-        out += senf::ClockService::nanoseconds(senf::ClockService::int64_type(v));
+        out += ClockService::nanoseconds(ClockService::int64_type(v));
         j = match.second;
     }
     if (j != value.end())
-        throw senf::console::SyntaxErrorException();
+        throw console::SyntaxErrorException();
 }
 
 prefix_ void senf::formatClockServiceInterval(ClockService::clock_type interval,
index ad58520..915d853 100644 (file)
@@ -171,7 +171,7 @@ prefix_ void senf::scheduler::detail::FIFORunner::dequeue(TaskInfo * task)
 
 prefix_ void senf::scheduler::detail::FIFORunner::run()
 {
-    for(;;) {
+    for (;;) {
         TaskList::iterator f (tasks_.begin());
         TaskList::iterator l (TaskList::current(highPriorityEnd_));
         run(f, l);
index e860e10..7753964 100644 (file)
@@ -41,7 +41,7 @@ prefix_ senf::ReadHelper<Handle>::ReadHelper(Handle handle, std::string::size_ty
       maxSize_(maxSize), predicate_(predicate), callback_(cb), errno_(0), complete_(false)
 {
     // Here we add a *static* member taking a *smart* pointer as first
-    // argumnet instead of a simple bound-member as callback to the
+    // argument instead of a simple bound-member as callback to the
     // scheduler. This ensures, that the refcount is at least 1 as
     // long as the helper is registered with the scheduler.
 }
@@ -60,7 +60,7 @@ senf::ReadHelper<Handle>::dispatchProcess(ptr helper, Handle handle, int event)
 {
     // since we have a 'ptr' argument, the instance cannot be deleted
     // before this method returns
-    return helper->process(handle,event);
+    helper->process(handle,event);
 }
 
 template <class Handle>
index 3e93130..5273eb3 100644 (file)
@@ -51,7 +51,7 @@ prefix_ void senf::scheduler::terminate()
 
 prefix_ void senf::scheduler::yield()
 {
-    senf::scheduler::detail::FIFORunner::instance().yield();
+    detail::FIFORunner::instance().yield();
 }
 
 prefix_ bool senf::scheduler::running()
@@ -165,7 +165,7 @@ prefix_ void senf::scheduler::hiresTimers()
 prefix_ senf::log::time_type senf::scheduler::LogTimeSource::operator()()
     const
 {
-    return senf::scheduler::now();
+    return scheduler::now();
 }
 
 //-/////////////////////////////////////////////////////////////////////////////////////////////////
index e48c927..b5d37e4 100644 (file)
@@ -42,13 +42,13 @@ prefix_ senf::scheduler::detail::TimerDispatcher::~TimerDispatcher()
     TimerSet::iterator i (timers_.begin());
     TimerSet::iterator const i_end (timers_.end());
     for (; i != i_end; ++i)
-        senf::scheduler::detail::FIFORunner::instance().dequeue(&(*i));
+        FIFORunner::instance().dequeue(&(*i));
 }
 
 void senf::scheduler::detail::TimerDispatcher::add(TimerEvent & event)
 {
     TimerSet::iterator i (timers_.insert(event));
-    senf::scheduler::detail::FIFORunner::instance().enqueue(&(*i));
+    FIFORunner::instance().enqueue(&(*i));
 }
 
 prefix_ void senf::scheduler::detail::TimerDispatcher::remove(TimerEvent & event)
@@ -56,7 +56,7 @@ prefix_ void senf::scheduler::detail::TimerDispatcher::remove(TimerEvent & event
     TimerSet::iterator i (TimerSet::current(event));
     if (i == timers_.end())
         return;
-    senf::scheduler::detail::FIFORunner::instance().dequeue(&(*i));
+    FIFORunner::instance().dequeue(&(*i));
     timers_.erase(i);
 }
 
@@ -64,7 +64,7 @@ prefix_ void senf::scheduler::detail::TimerDispatcher::prepareRun()
 {
     TimerSet::iterator i (timers_.begin());
     TimerSet::iterator const i_end (timers_.end());
-    ClockService::clock_type now (senf::scheduler::detail::FdManager::instance().eventTime());
+    ClockService::clock_type now (FdManager::instance().eventTime());
     for (; i != i_end && i->timeout_ <= now ; ++i)
         i->setRunnable();
 }
index 14b757d..b07ed90 100644 (file)
@@ -49,20 +49,20 @@ prefix_ senf::scheduler::TimerEvent::TimerEvent(std::string const & name, Callba
 
 prefix_ senf::scheduler::TimerEvent::~TimerEvent()
 {
-    if (senf::scheduler::detail::TimerDispatcher::alive())
+    if (detail::TimerDispatcher::alive())
         disable();
 }
 
 prefix_ void senf::scheduler::TimerEvent::enable()
 {
     if (! detail::TimerSetBase::linked())
-        senf::scheduler::detail::TimerDispatcher::instance().add(*this);
+        detail::TimerDispatcher::instance().add(*this);
 }
 
 prefix_ void senf::scheduler::TimerEvent::disable()
 {
     if (detail::TimerSetBase::linked())
-        senf::scheduler::detail::TimerDispatcher::instance().remove(*this);
+        detail::TimerDispatcher::instance().remove(*this);
 }
 
 prefix_ void senf::scheduler::TimerEvent::action(Callback const & cb)
index c03002f..e8d3dbc 100644 (file)
@@ -51,8 +51,7 @@ prefix_ senf::scheduler::detail::POSIXTimerSource::POSIXTimerSource()
 {
     if (pipe(timerPipe_) < 0)
         SENF_THROW_SYSTEM_EXCEPTION("pipe()");
-    senf::scheduler::detail::FdManager::instance().set(
-        timerPipe_[0], detail::FdManager::EV_READ, this);
+    FdManager::instance().set( timerPipe_[0], FdManager::EV_READ, this);
 
     sigemptyset(&sigSet_);
     sigaddset(&sigSet_, SIGALRM);
@@ -79,7 +78,7 @@ prefix_ senf::scheduler::detail::POSIXTimerSource::~POSIXTimerSource()
     timer_delete(timerId_);
     ::signal(SIGALRM, SIG_IGN);
     sigprocmask(SIG_UNBLOCK, &sigSet_, 0);
-    senf::scheduler::detail::FdManager::instance().remove(timerPipe_[0]);
+    FdManager::instance().remove(timerPipe_[0]);
     close(timerPipe_[0]);
     close(timerPipe_[1]);
 }
@@ -185,13 +184,12 @@ prefix_ senf::scheduler::detail::TimerFDTimerSource::TimerFDTimerSource()
     timerfd_ = timerfd_create(CLOCK_MONOTONIC, 0);
     if (timerfd_ < 0)
         SENF_THROW_SYSTEM_EXCEPTION("timerfd_create()");
-    senf::scheduler::detail::FdManager::instance().set(
-        timerfd_, detail::FdManager::EV_READ, this);
+    FdManager::instance().set( timerfd_, FdManager::EV_READ, this);
 }
 
 prefix_ senf::scheduler::detail::TimerFDTimerSource::~TimerFDTimerSource()
 {
-    senf::scheduler::detail::FdManager::instance().remove(timerfd_);
+    FdManager::instance().remove(timerfd_);
     close(timerfd_);
 }
 
index 3b9fc87..2ea3e58 100644 (file)
@@ -35,8 +35,8 @@
 prefix_ senf::DVBSectionProtocolWrapper::DVBSectionProtocolWrapper(senf::DVBDemuxSectionHandle sh)
     : protocol(sh.protocol()), dir(this)
 {
-    namespace kw = senf::console::kw;
-    namespace fty = senf::console::factory;
+    namespace kw = console::kw;
+    namespace fty = console::factory;
 
     dir.add("buffersize", fty::Command(&DVBSectionProtocolWrapper::setBufferSize, this)
             .doc("Set the size of the circular buffer used for filtered data.")
@@ -82,8 +82,8 @@ prefix_ senf::DVBSectionProtocolWrapper::DVBSectionProtocolWrapper(senf::DVBDemu
 prefix_ senf::DVBPESProtocolWrapper::DVBPESProtocolWrapper(senf::DVBDemuxPESHandle sh)
     : protocol(sh.protocol()), dir(this)
 {
-    namespace kw = senf::console::kw;
-    namespace fty = senf::console::factory;
+    namespace kw = console::kw;
+    namespace fty = console::factory;
 
     dir.add("filter",
             fty::Command<void (unsigned short int,
index 8cc640d..14bc19d 100644 (file)
@@ -457,8 +457,8 @@ prefix_ void senf::DVBSocketController::readEvent(int event)
 
 prefix_ void senf::DVBSocketController::initConsole()
 {
-    namespace fty = senf::console::factory;
-    namespace kw = senf::console::kw;
+    namespace fty = console::factory;
+    namespace kw = console::kw;
 
     dir.doc("DVB Controller " + controllerNr);
     ++controllerNr;
index 24abea3..79673df 100644 (file)
@@ -52,7 +52,7 @@ prefix_ senf::INet4Address senf::INet4Address::from_string(std::string const & s
 {
     struct in_addr ina;
     if (::inet_pton(AF_INET,s.c_str(),&ina) > 0)
-        return senf::INet4Address::from_inaddr(ina.s_addr);
+        return INet4Address::from_inaddr(ina.s_addr);
 
     if  (s.empty())
         throw AddressSyntaxException() << ": empty string";
@@ -86,7 +86,7 @@ prefix_ senf::INet4Address senf::INet4Address::from_string(std::string const & s
         throw UnknownHostnameException(s);
 
     // We are only interested in the first address ...
-    return senf::INet4Address::from_inaddr(
+    return INet4Address::from_inaddr(
         reinterpret_cast<in_addr*>(*(ent->h_addr_list))->s_addr);
 }
 
index 220f394..de988d3 100644 (file)
@@ -49,7 +49,7 @@ prefix_ senf::INet6Address senf::INet6Address::from_string(std::string const & s
 {
     struct in6_addr ina;
     if (::inet_pton(AF_INET6,s.c_str(),&ina) > 0)
-        return senf::INet6Address::from_data(&ina.s6_addr[0]);
+        return INet6Address::from_data(&ina.s6_addr[0]);
 
     if (s.empty())
         throw AddressSyntaxException() << ": empty string";
@@ -79,7 +79,7 @@ prefix_ senf::INet6Address senf::INet6Address::from_string(std::string const & s
 
     if (ent && ent->h_addrtype == AF_INET6)
         // We are only interested in the first address ...
-        return senf::INet6Address::from_data(
+        return INet6Address::from_data(
             &reinterpret_cast<in6_addr*>(*(ent->h_addr_list))->s6_addr[0]);
 
     if (resolve == ResolveINet4)
index 822cfe2..0f443c6 100644 (file)
@@ -51,11 +51,11 @@ template <class ForwardIterator, class Function>
 prefix_ void senf::detail::apply_mask(unsigned bits, ForwardIterator b, ForwardIterator e,
                                       Function fn)
 {
-    for(; bits>8 && b != e; bits -= 8, ++b)
+    for (; bits>8 && b != e; bits -= 8, ++b)
         fn(*b, boost::lambda::make_const(0xFFu));
     if (bits > 0 && b != e)
         fn( *(b++), boost::lambda::make_const(~ low_bits_mask(8-bits)));
-    for(; b != e; ++b)
+    for (; b != e; ++b)
         fn(*b, boost::lambda::make_const(0u));
 }
 
@@ -64,13 +64,13 @@ prefix_ ForwardIterator1 senf::detail::find_if_mask(unsigned bits, ForwardIterat
                                                     ForwardIterator1 e1, ForwardIterator2 b2,
                                                     Function fn)
 {
-    for(; bits>8 && b1 != e1; bits -= 8, ++b1, ++b2)
+    for (; bits>8 && b1 != e1; bits -= 8, ++b1, ++b2)
         if (fn(*b1, *b2, boost::lambda::make_const(0xFFu)))
             return b1;
     if (bits > 0 && b1 != e1)
         if (fn(*b1, *b2, boost::lambda::make_const(~ low_bits_mask(8-bits))))
             return b1;
-    for(++b1, ++b2; b1 != e1; ++b1, ++b2)
+    for (++b1, ++b2; b1 != e1; ++b1, ++b2)
         if (fn(*b1, *b2, boost::lambda::make_const(0u)))
             return b1;
     return e1;
index d115e9a..1a842c5 100644 (file)
@@ -54,9 +54,9 @@ namespace senf {
                                         /**< This override will automatically \c shutdown() the
                                            socket whenever it is called. Additionally it will
                                            disable SO_LINGER to ensure, that v_terminate will not
-                                           block. Like the overriden method, this member will ignore
-                                           failures and will never throw. It therefore safe to be
-                                           called from a destructor. */
+                                           block. Like the overridden method, this member will
+                                           ignore failures and will never throw. It therefore
+                                           safe to be called from a destructor. */
 
         ///\name Abstract Interface Implementation
         //\{
index 3955d5b..c158e8f 100644 (file)
@@ -29,7 +29,6 @@
 
 // Custom includes
 #include <sstream>
-#include <sys/socket.h>
 #include <senf/Utils/TypeInfo.hh>
 
 //#include "SocketHandle.mpp"
@@ -45,7 +44,7 @@ prefix_ void senf::SocketBody::state(SocketStateMap & map, unsigned lod)
     map["file.refcount"]   << refcount();
     map["socket.server"]   << isServer();
     map["socket.protocol"] << v_protocolName();
-    map["socket.protocol.policy"]   << prettyName(typeid(protocol().policy()));
+    map["socket.protocol.policy"] << prettyName(typeid(protocol().policy()));
     protocol().state(map,lod);
 }
 
index e28ade4..23e10a7 100644 (file)
@@ -27,7 +27,6 @@
 #include "SocketHandle.ih"
 
 // Custom includes
-#include <senf/Utils/senfassert.hh>
 #include "SocketProtocol.hh"
 
 #define prefix_ inline
index 861e6a8..fd7e290 100644 (file)
@@ -67,7 +67,7 @@ template <class SPolicy>
 prefix_ senf::SocketHandle<SPolicy>::SocketHandle(FileHandle other, bool isChecked)
     : FileHandle(other)
 {
-    SENF_ASSERT( isChecked, "Inrernal failure: Wrong overload called !!" );
+    SENF_ASSERT( isChecked, "Internal failure: Wrong overload called !!" );
     SENF_ASSERT( ! valid() || dynamic_cast<SocketBody *>(&FileHandle::body()),
                  "Internal failure: Replacing or re-assigning non-empty incompatible handle");
 }
index da397be..7775e5c 100644 (file)
@@ -60,7 +60,7 @@ namespace senf {
 
             template <class T>
             StreamableString & operator<<(T const & other);
-                                        ///< Value assigment
+                                        ///< Value assignment
                                         /**< This operator will assign the string from any
                                              arbitrary type. It will use boost::lexical_cast to
                                              convert the argument to its string representation.
@@ -139,12 +139,12 @@ namespace senf {
                                            socket whenever it is closed.
                                            \throws senf::SystemException */
         virtual void v_terminate();     ///< Forcibly close socket
-                                        /**< This override will automatically \c shutfown() the
+                                        /**< This override will automatically \c shutdown() the
                                            socket whenever it is called. Additionally it will
                                            disable SO_LINGER to ensure, that v_terminate will not
-                                           block. Like the overriden method, this member will ignore
-                                           failures and will never throw. It therefore safe to be
-                                           called from a destructor. */
+                                           block. Like the overridden method, this member will
+                                           ignore failures and will never throw. It therefore
+                                           safe to be called from a destructor. */
         virtual bool v_eof() const;     ///< Check for eof condition
                                         /**< Since the eof check for sockets is very protocol
                                            dependent, this member will forward the call to
index e4303bc..624f869 100644 (file)
     \brief SocketProtocol and ConcreteSocketProtocol non-inline non-template implementation
  */
 
-#include <sys/socket.h>
 #include "SocketProtocol.hh"
 //#include "SocketProtocol.ih"
 
 // Custom includes
+#include <sys/socket.h>
 
 //#include "SocketProtocol.mpp"
 #define prefix_
index b119393..3270322 100644 (file)
@@ -57,7 +57,7 @@
 /** \defgroup concrete_protocol_group Protocol Implementations (Concrete Protocol Classes)
     \ingroup protocol_group
 
-    Theese protocol classes define concrete and complete protocol implementations. They inherit from
+    These protocol classes define concrete and complete protocol implementations. They inherit from
     ConcreteSocketProtocol and are used with the ProtocolClientSocketHandle and
     ProtocolServerSocketHandle templates to instantiate socket handles. Appropriate typedefs are
     always provided.
@@ -166,9 +166,9 @@ namespace senf {
                                         /**< This override will automatically \c shutdown() the
                                              socket whenever it is called. Additionally it will
                                              disable SO_LINGER to ensure, that v_terminate will not
-                                             block. Like the overriden method, this member will ignore
-                                             failures and will never throw. It is therefore safe to be
-                                             called from a destructor.
+                                             block. Like the overridden method, this member will
+                                             ignore failures and will never throw. It is therefore
+                                             safe to be called from a destructor.
                                              \fixme Move into (at least) BSDSocketProtocol */
 
         virtual void state(SocketStateMap & map, unsigned lod) const;
index a457072..1f3577c 100644 (file)
@@ -141,7 +141,7 @@ RestrictGuard(RestrictedExecutor & executor)
     // This MUST BE root() not chroot() since restriction does NOT follow symlinks.
     // Therefore, if chroot() is a directory of symlinks, restricting to it will
     // execute NOTHING.
-    executor_.restrict_ = senf::console::root().thisptr();
+    executor_.restrict_ = console::root().thisptr();
 }
 
 prefix_ senf::console::detail::RestrictedExecutor::RestrictGuard::
@@ -155,7 +155,7 @@ prefix_ senf::console::detail::RestrictedExecutor::RestrictGuard::~RestrictGuard
 {
     if (! std::uncaught_exception())
         executor_.insertParsedNode( *executor_.restrict_ );
-    executor_.restrict_ = senf::console::root().thisptr();
+    executor_.restrict_ = console::root().thisptr();
 }
 
 //-/////////////////////////////////////////////////////////////////////////////////////////////////
index 1cff221..2c97f4b 100644 (file)
@@ -261,7 +261,7 @@ prefix_ void senf::console::Executor::ll(std::ostream & output,
 {
 #   define HELP_COLUMN 28
 
-    unsigned width (senf::console::Client::getWidth(output, 80u, 60u)-(HELP_COLUMN+1));
+    unsigned width (Client::getWidth(output, 80u, 60u)-(HELP_COLUMN+1));
     Path dir (cwd_);
     traverseDirectory(path, dir);
     DirectoryNode & node (*dir.back().lock());
@@ -332,7 +332,7 @@ prefix_ void senf::console::Executor::lr(std::ostream & output,
     traverseDirectory(path, dir);
     DirectoryNode & node (*dir.back().lock());
     NodesMap nodes;
-    dolr(output, senf::console::Client::getWidth(output, 80u, 60u)-(HELP_COLUMN+1),
+    dolr(output, Client::getWidth(output, 80u, 60u)-(HELP_COLUMN+1),
          nodes, "", 0, node);
 }
 
index d38096b..c6e280d 100644 (file)
@@ -35,7 +35,7 @@
 
 prefix_ senf::console::DirectoryNode & senf::console::root()
 {
-    static DirectoryNode::ptr rootNode(new DirectoryNode());
+    static DirectoryNode::ptr rootNode (new DirectoryNode());
     return *rootNode;
 }
 
index cca6f69..decd01c 100644 (file)
@@ -343,7 +343,7 @@ prefix_ Iterator senf::console::CommandParser::parseLoop(Iterator npb, Iterator
     detail::ParseDispatcher::BindInfo bind (impl().dispatcher, info);
     detail::boost_spirit::parse_info<PositionIterator> result;
 
-    for(;;) {
+    for (;;) {
         result = detail::boost_spirit::parse(
             b, e, * impl().grammar.use_parser<Impl::Grammar::SkipParser>());
         b = result.stop;
index 4df9d41..da0f703 100644 (file)
@@ -503,14 +503,12 @@ namespace console {
                                              present, if there is an argument at the current
                                              index. */
 
-#ifndef DOXYVEN
-
+#ifndef DOXYGEN
 #       define BOOST_PP_ITERATION_PARAMS_1                                                        \
             (4, (1, BOOST_PARAMETER_MAX_ARITY,                                                    \
                  SENF_ABSOLUTE_INCLUDE_PATH(Utils/Console/ParsedCommand.mpp),                     \
                  5))
 #       include BOOST_PP_ITERATE()
-
 #endif
 
     private:
index 243a782..9b6d170 100644 (file)
@@ -405,7 +405,7 @@ prefix_ unsigned senf::console::Client::getWidth(std::ostream & os, unsigned def
 
 prefix_ senf::console::Client::SysBacktrace::SysBacktrace()
 {
-    namespace fty = senf::console::factory;
+    namespace fty = console::factory;
 
     sysdir().add("backtrace", fty::Command(&SysBacktrace::backtrace)
                  .doc("Display the backtrace of the last error / exception in this console") );
index 4f9c02f..4d95d01 100644 (file)
@@ -53,7 +53,7 @@ prefix_ senf::log::FileTarget::FileTarget(std::string const & filename,
       IOStreamTarget (getNodename(filename, nodename), ofstream_t::member),
       file_ (filename)
 {
-    namespace fty = senf::console::factory;
+    namespace fty = console::factory;
 
     if (! ofstream_t::member)
         SENF_THROW_SYSTEM_EXCEPTION("logfile open") << ": " << filename;
@@ -95,8 +95,8 @@ prefix_ std::string const & senf::log::FileTarget::filename()
 
 prefix_ senf::log::FileTarget::RegisterConsole::RegisterConsole()
 {
-    namespace kw = senf::console::kw;
-    namespace fty = senf::console::factory;
+    namespace kw = console::kw;
+    namespace fty = console::factory;
 
     detail::TargetRegistry::instance().consoleDir()
         .add("file-target", fty::Command(&RegisterConsole::create)
index 67f7790..b4d2d49 100644 (file)
@@ -50,8 +50,8 @@ prefix_ senf::log::detail::LogFormat::LogFormat(console::ScopedDirectory<> & dir
     : tag_ (detail::getDefaultTag()), noformat_ (false), showTime_ (true),
       showStream_ (false), showLevel_ (true), showArea_ (true), timeBase_ (-1)
 {
-    namespace kw = senf::console::kw;
-    namespace fty = senf::console::factory;
+    namespace kw = console::kw;
+    namespace fty = console::factory;
 
     timeFormat("%Y-%m-%d %H:%M:%S.%f-0000");
 
index 071db90..130556e 100644 (file)
@@ -60,8 +60,8 @@ namespace log {
 
 prefix_ senf::log::SyslogTarget::RegisterConsole::RegisterConsole()
 {
-    namespace kw = senf::console::kw;
-    namespace fty = senf::console::factory;
+    namespace kw = console::kw;
+    namespace fty = console::factory;
 
     detail::TargetRegistry::instance().consoleDir()
         .add("syslog-target",fty::Command(&RegisterConsole::create)
index 03436ac..2d2c92a 100644 (file)
@@ -122,7 +122,7 @@ namespace log {
     private:
         struct RegisterConsole {
             RegisterConsole();
-            static boost::shared_ptr<senf::console::DirectoryNode> create(
+            static boost::shared_ptr<console::DirectoryNode> create(
                 LogFacility facility);
             static RegisterConsole instance;
         };
index bd7ed8f..77fbcad 100644 (file)
@@ -40,8 +40,8 @@
 
 prefix_ void senf::log::SyslogUDPTarget::init()
 {
-    namespace kw = senf::console::kw;
-    namespace fty = senf::console::factory;
+    namespace kw = console::kw;
+    namespace fty = console::factory;
 
     consoleDir().remove("format");
     consoleDir()
@@ -71,7 +71,7 @@ prefix_ void senf::log::SyslogUDPTarget::v_write(time_type timestamp, std::strin
     // or message will not inadvertently be interpreted as date or hostname by a receiving syslog
     // daemon or proxy
     if (syslogFormat_)
-        prfstream << '<' << (facility_ | senf::log::SyslogTarget::LEVELMAP[level]) << "> ";
+        prfstream << '<' << (facility_ | SyslogTarget::LEVELMAP[level]) << "> ";
     prfstream << prefix(timestamp, stream, area, level);
     std::string const & prf (prfstream.str());
 
@@ -110,12 +110,12 @@ namespace log {
 
 prefix_ senf::log::SyslogUDPTarget::RegisterConsole::RegisterConsole()
 {
-    namespace kw = senf::console::kw;
-    namespace fty = senf::console::factory;
+    namespace kw = console::kw;
+    namespace fty = console::factory;
 
     detail::TargetRegistry::instance().consoleDir()
         .add("udp-target",
-             fty::Command<senf::console::DirectoryNode::ptr (*)(INet4SocketAddress const &,
+             fty::Command<console::DirectoryNode::ptr (*)(INet4SocketAddress const &,
                                                                 LogFacility)
              >(&RegisterConsole::create)
              .arg("address", "target address to send log messages to")
@@ -140,29 +140,26 @@ prefix_ senf::log::SyslogUDPTarget::RegisterConsole::RegisterConsole()
                   "    }\n") );
     detail::TargetRegistry::instance().consoleDir()
         .add("udp-target",
-             fty::Command<senf::console::DirectoryNode::ptr (*)(INet4Address const &,
-                                                                LogFacility)
+             fty::Command<console::DirectoryNode::ptr (*)(INet4Address const &, LogFacility)
              >(&RegisterConsole::create)
              .arg("address")
              .arg("facility", kw::default_value = USER) );
     detail::TargetRegistry::instance().consoleDir()
         .add("udp-target",
-             fty::Command<senf::console::DirectoryNode::ptr (*)(INet6SocketAddress const &,
-                                                                LogFacility)
+             fty::Command<console::DirectoryNode::ptr (*)(INet6SocketAddress const &, LogFacility)
              >(&RegisterConsole::create)
              .arg("address")
              .arg("facility", kw::default_value = USER) );
     detail::TargetRegistry::instance().consoleDir()
         .add("udp-target",
-             fty::Command<senf::console::DirectoryNode::ptr (*)(INet6Address const &,
-                                                                LogFacility)
+             fty::Command<console::DirectoryNode::ptr (*)(INet6Address const &, LogFacility)
              >(&RegisterConsole::create)
              .arg("address")
              .arg("facility", kw::default_value = USER) );
 }
 
 prefix_ boost::shared_ptr<senf::console::DirectoryNode>
-senf::log::SyslogUDPTarget::RegisterConsole::create(senf::INet4SocketAddress const & target,
+senf::log::SyslogUDPTarget::RegisterConsole::create(INet4SocketAddress const & target,
                                                     LogFacility facility)
 {
     std::auto_ptr<Target> tp (new SyslogUDPTarget(target, facility));
@@ -172,7 +169,7 @@ senf::log::SyslogUDPTarget::RegisterConsole::create(senf::INet4SocketAddress con
 }
 
 prefix_ boost::shared_ptr<senf::console::DirectoryNode>
-senf::log::SyslogUDPTarget::RegisterConsole::create(senf::INet4Address const & target,
+senf::log::SyslogUDPTarget::RegisterConsole::create(INet4Address const & target,
                                                     LogFacility facility)
 {
     std::auto_ptr<Target> tp (new SyslogUDPTarget(target, facility));
@@ -182,7 +179,7 @@ senf::log::SyslogUDPTarget::RegisterConsole::create(senf::INet4Address const & t
 }
 
 prefix_ boost::shared_ptr<senf::console::DirectoryNode>
-senf::log::SyslogUDPTarget::RegisterConsole::create(senf::INet6SocketAddress const & target,
+senf::log::SyslogUDPTarget::RegisterConsole::create(INet6SocketAddress const & target,
                                                     LogFacility facility)
 {
     std::auto_ptr<Target> tp (new SyslogUDPTarget(target, facility));
@@ -192,7 +189,7 @@ senf::log::SyslogUDPTarget::RegisterConsole::create(senf::INet6SocketAddress con
 }
 
 prefix_ boost::shared_ptr<senf::console::DirectoryNode>
-senf::log::SyslogUDPTarget::RegisterConsole::create(senf::INet6Address const & target,
+senf::log::SyslogUDPTarget::RegisterConsole::create(INet6Address const & target,
                                                     LogFacility facility)
 {
     std::auto_ptr<Target> tp (new SyslogUDPTarget(target, facility));
index 6e7f90e..5600f90 100644 (file)
 #define prefix_ inline
 //-/////////////////////////////////////////////////////////////////////////////////////////////////
 
-prefix_ senf::log::SyslogUDPTarget::SyslogUDPTarget(senf::INet4Address const & target,
-                                                    int facility)
+prefix_ senf::log::SyslogUDPTarget::SyslogUDPTarget(INet4Address const & target, int facility)
     : Target("udp-" + senf::str(target)), LogFormat(consoleDir()), facility_ (facility),
-      handle_ ( senf::ConnectedUDPv4ClientSocketHandle(senf::INet4SocketAddress(target, 514u)) ),
+      handle_ ( ConnectedUDPv4ClientSocketHandle(INet4SocketAddress(target, 514u)) ),
       syslogFormat_ (true)
 {
     init();
 }
 
-prefix_ senf::log::SyslogUDPTarget::SyslogUDPTarget(senf::INet4SocketAddress const & target,
-                                                    int facility)
+prefix_ senf::log::SyslogUDPTarget::SyslogUDPTarget(INet4SocketAddress const & target, int facility)
     : Target("udp-" + senf::str(target)), LogFormat(consoleDir()), facility_ (facility),
-      handle_ ( senf::ConnectedUDPv4ClientSocketHandle(target) ),
+      handle_ ( ConnectedUDPv4ClientSocketHandle(target) ),
       syslogFormat_ (true)
 {
     init();
 }
 
-prefix_ senf::log::SyslogUDPTarget::SyslogUDPTarget(senf::INet6Address const & target,
-                                                    int facility)
+prefix_ senf::log::SyslogUDPTarget::SyslogUDPTarget(INet6Address const & target, int facility)
     : Target("udp-" + senf::str(target)), LogFormat(consoleDir()), facility_ (facility),
-      handle_ ( senf::ConnectedUDPv6ClientSocketHandle(senf::INet6SocketAddress(target, 514u)) ),
+      handle_ ( ConnectedUDPv6ClientSocketHandle(INet6SocketAddress(target, 514u)) ),
       syslogFormat_ (true)
 {
     init();
 }
 
-prefix_ senf::log::SyslogUDPTarget::SyslogUDPTarget(senf::INet6SocketAddress const & target,
-                                                    int facility)
+prefix_ senf::log::SyslogUDPTarget::SyslogUDPTarget(INet6SocketAddress const & target, int facility)
     : Target("udp-" + senf::str(target)), LogFormat(consoleDir()), facility_ (facility),
-      handle_ ( senf::ConnectedUDPv6ClientSocketHandle(target) ),
+      handle_ ( ConnectedUDPv6ClientSocketHandle(target) ),
       syslogFormat_ (true)
 {
     init();
index 8abb201..e62ad76 100644 (file)
@@ -101,10 +101,10 @@ namespace log {
         ///\name Structors and default members
         //\{
 
-        explicit SyslogUDPTarget(senf::INet4Address const & target, int facility = LOG_USER);
-        explicit SyslogUDPTarget(senf::INet4SocketAddress const & target, int facility = LOG_USER);
-        explicit SyslogUDPTarget(senf::INet6Address const & target, int facility = LOG_USER);
-        explicit SyslogUDPTarget(senf::INet6SocketAddress const & target, int facility = LOG_USER);
+        explicit SyslogUDPTarget(INet4Address const & target, int facility = LOG_USER);
+        explicit SyslogUDPTarget(INet4SocketAddress const & target, int facility = LOG_USER);
+        explicit SyslogUDPTarget(INet6Address const & target, int facility = LOG_USER);
+        explicit SyslogUDPTarget(INet6SocketAddress const & target, int facility = LOG_USER);
 
         //\}
         //-////////////////////////////////////////////////////////////////////////
@@ -165,14 +165,14 @@ namespace log {
 
         struct RegisterConsole {
             RegisterConsole();
-            static boost::shared_ptr<senf::console::DirectoryNode> create(
-                senf::INet4SocketAddress const & target, LogFacility facility = USER);
-            static boost::shared_ptr<senf::console::DirectoryNode> create(
-                senf::INet4Address const & target, LogFacility facility = USER);
-            static boost::shared_ptr<senf::console::DirectoryNode> create(
-                senf::INet6SocketAddress const & target, LogFacility facility = USER);
-            static boost::shared_ptr<senf::console::DirectoryNode> create(
-                senf::INet6Address const & target, LogFacility facility = USER);
+            static boost::shared_ptr<console::DirectoryNode> create(
+                INet4SocketAddress const & target, LogFacility facility = USER);
+            static boost::shared_ptr<console::DirectoryNode> create(
+                INet4Address const & target, LogFacility facility = USER);
+            static boost::shared_ptr<console::DirectoryNode> create(
+                INet6SocketAddress const & target, LogFacility facility = USER);
+            static boost::shared_ptr<console::DirectoryNode> create(
+                INet6Address const & target, LogFacility facility = USER);
             static RegisterConsole instance;
         };
     };
index 08b2ab4..fa99935 100644 (file)
@@ -53,8 +53,8 @@ namespace detail {
 
 prefix_ senf::log::Target::Target(std::string const & name)
 {
-    namespace kw = senf::console::kw;
-    namespace fty = senf::console::factory;
+    namespace kw = console::kw;
+    namespace fty = console::factory;
 
     detail::TargetRegistry::instance().registerTarget(this, name);
     consoleDir_()
@@ -286,7 +286,7 @@ prefix_ void senf::log::Target::updateRoutingCache(detail::StreamBase const * st
     unsigned limit (DISABLED::value);
     RIB::iterator i (rib_.begin());
     RIB::iterator const i_end (rib_.end());
-    for(; i != i_end; ++i)
+    for (; i != i_end; ++i)
         if ( (! i->stream_ || i->stream_ == stream) &&
              (! i->area_ || i->area_ == area) &&
              i->action_ == ACCEPT ) {
@@ -364,7 +364,7 @@ prefix_ void senf::log::Target::consoleUnroute(detail::LogParameters const & pm,
 
 prefix_ void senf::log::detail::TargetRegistry::dynamicTarget(std::auto_ptr<Target> target)
 {
-    namespace fty = senf::console::factory;
+    namespace fty = console::factory;
 
     target->consoleDir()
         .add("remove", fty::Command<void ()>(
@@ -402,8 +402,8 @@ prefix_ void senf::log::detail::TargetRegistry::consoleRemoveTarget(Target * tar
 prefix_ senf::log::detail::TargetRegistry::TargetRegistry()
     : fallbackRouting_(true)
 {
-    namespace kw = senf::console::kw;
-    namespace fty = senf::console::factory;
+    namespace kw = console::kw;
+    namespace fty = console::factory;
 
     console::sysdir().add("log", consoleDir_());
     consoleDir_()
index f2b9c9d..5175388 100644 (file)
@@ -169,7 +169,7 @@ prefix_ senf::Statistics::Statistics()
 #endif
 {
 #ifndef SENF_DISABLE_CONSOLE
-    namespace fty = senf::console::factory;
+    namespace fty = console::factory;
 
     dir.add("list", fty::Command(&Statistics::consoleList, this)
             .doc("List statistics collection intervals and current values.\n"
@@ -222,7 +222,7 @@ prefix_ senf::Statistics::Statistics()
                  "the last 5 minutes.")
             .arg("rank","Rank chain selecting the value to generate output for")
             .arg("window","Optional size of sliding average window",
-                 senf::console::kw::default_value = 1u) );
+                 console::kw::default_value = 1u) );
 #endif
 }
 
index 762aa0d..98c7c0c 100644 (file)
@@ -65,8 +65,7 @@ prefix_ senf::StatisticsBase::OutputEntry::OutputEntry(const OutputEntry& other)
 
 prefix_ void senf::StatisticsBase::OutputEntry::initDir()
 {
-    namespace fty = senf::console::factory;
-
+    namespace fty = console::factory;
     dir.add("list", fty::Command(&OutputEntry::consoleList, this)
             .doc("List all known connected targets. This list might not be complete.") );
 }
index 2c6f297..3c56a5f 100644 (file)
@@ -39,9 +39,8 @@
 // senf::detail::StatisticsLoggerRegistry
 
 prefix_ void
-senf::detail::StatisticsLoggerRegistry::apply(senf::StatisticsBase & stats,
-                                              unsigned rank,
-                                              senf::console::DirectoryNode & dir)
+senf::detail::StatisticsLoggerRegistry::apply(StatisticsBase & stats,
+                                              unsigned rank, console::DirectoryNode & dir)
 {
     Adders::const_iterator i (adders_.begin());
     Adders::const_iterator const i_end (adders_.end());
@@ -58,12 +57,10 @@ namespace {
         RegisterStatisticsLogger();
 
         static void adder(senf::StatisticsBase & stats,
-                          unsigned rank,
-                          senf::console::DirectoryNode & dir);
+                          unsigned rank, senf::console::DirectoryNode & dir);
 
         static void consoleCreate(senf::StatisticsBase & stats,
-                                  unsigned rank,
-                                  std::string const & prefix);
+                                  unsigned rank, std::string const & prefix);
     };
 
     RegisterStatisticsLogger registerStatisticsLogger;
@@ -75,12 +72,10 @@ prefix_ RegisterStatisticsLogger::RegisterStatisticsLogger()
 }
 
 prefix_ void RegisterStatisticsLogger::adder(senf::StatisticsBase & stats,
-                                             unsigned rank,
-                                             senf::console::DirectoryNode & dir)
+                                             unsigned rank, senf::console::DirectoryNode & dir)
 {
     namespace kw = senf::console::kw;
     namespace fty = senf::console::factory;
-
     dir.add("logger", fty::Command<void (std::string const &)>(
                 boost::bind(&consoleCreate, boost::ref(stats), rank, _1))
             .arg("prefix","Optional prefix string to add to each log message",
@@ -89,8 +84,7 @@ prefix_ void RegisterStatisticsLogger::adder(senf::StatisticsBase & stats,
 }
 
 prefix_ void RegisterStatisticsLogger::consoleCreate(senf::StatisticsBase & stats,
-                                                     unsigned rank,
-                                                     std::string const & prefix)
+                                                     unsigned rank, std::string const & prefix)
 {
     stats.output(rank).connect(senf::StatisticsLogger(prefix),
                                "senf::StatisticsLogger(\"" + prefix + "\")");
index 87bcd19..7f4e09d 100644 (file)
@@ -55,7 +55,7 @@ namespace senf {
         optional \a label string may be specified which will be added as prefix to all log entries.
 
         The log stream defaults to senf::StatisticsStream, the level defaults to
-        senf::log::MESSAGE and the are defaults to senf::log::DefaultArea.
+        senf::log::MESSAGE and the area defaults to senf::log::DefaultArea.
 
         \code
         // Connect with default parameters
index e710160..f99c95d 100644 (file)
@@ -36,9 +36,9 @@
 
 prefix_ senf::term::BaseEditor::BaseEditor(AbstractTerminal & terminal)
     : terminal_ (&terminal),
-      keyTimeout_ (senf::ClockService::milliseconds(DEFAULT_KEY_TIMEOUT_MS)),
+      keyTimeout_ (ClockService::milliseconds(DEFAULT_KEY_TIMEOUT_MS)),
       timer_ ("senf::term::BaseEditor::keySequenceTimeout",
-              senf::membind(&BaseEditor::keySequenceTimeout, this)),
+              membind(&BaseEditor::keySequenceTimeout, this)),
       column_ (0u), displayHeight_ (1u), line_ (0u)
 {
     terminal_->setCallbacks(*this);
@@ -220,7 +220,7 @@ prefix_ bool senf::term::BaseEditor::cb_init()
 prefix_ void senf::term::BaseEditor::cb_charReceived(char c)
 {
     inputBuffer_ += c;
-    timer_.timeout(senf::scheduler::eventTime() + keyTimeout_);
+    timer_.timeout(scheduler::eventTime() + keyTimeout_);
     processKeys();
 }
 
@@ -242,9 +242,9 @@ prefix_ void senf::term::BaseEditor::keySequenceTimeout()
 prefix_ void senf::term::BaseEditor::processKeys()
 {
     do {
-        std::pair<senf::term::KeyParser::keycode_t, std::string::size_type> result
+        std::pair<KeyParser::keycode_t, std::string::size_type> result
             (keyParser_.lookup(inputBuffer_));
-        if (result.first == senf::term::KeyParser::Incomplete)
+        if (result.first == KeyParser::Incomplete)
             return;
         v_keyReceived(result.first);
         inputBuffer_.erase(0, result.second);
index 7b65b37..d2196d6 100644 (file)
 prefix_ senf::term::BaseTelnetProtocol::BaseTelnetProtocol(Handle handle)
     : handle_ (handle), charState_ (NORMAL), command_ (CMD_NONE), option_ (0),
       inputEvent_ ("senf::term::BaseTelnetProtocol::input",
-                   senf::membind(&BaseTelnetProtocol::readHandler, this), handle,
-                   senf::scheduler::FdEvent::EV_READ),
+                   membind(&BaseTelnetProtocol::readHandler, this), handle,
+                   scheduler::FdEvent::EV_READ),
       outputEvent_ ("senf::term::BaseTelnetProtocol::output",
-                    senf::membind(&BaseTelnetProtocol::writeHandler, this), handle,
-                    senf::scheduler::FdEvent::EV_WRITE, false),
+                    membind(&BaseTelnetProtocol::writeHandler, this), handle,
+                    scheduler::FdEvent::EV_WRITE, false),
       pendingRequests_ (0u),
       requestTimeout_ (ClockService::milliseconds(DEFAULT_REQUEST_TIMEOUT_MS)),
       timeout_ ("senf::term::BaseTelnetProtocol::configTimeout",
-                senf::membind(&BaseTelnetProtocol::timeout, this))
+                membind(&BaseTelnetProtocol::timeout, this))
 {}
 
 prefix_ senf::term::BaseTelnetProtocol::BaseTelnetProtocol()
@@ -334,7 +334,7 @@ prefix_ void senf::term::BaseTelnetProtocol::transmit(char c)
 
 prefix_ void senf::term::BaseTelnetProtocol::readHandler(int state)
 {
-    if (state != senf::scheduler::FdEvent::EV_READ || handle_.eof()) {
+    if (state != scheduler::FdEvent::EV_READ || handle_.eof()) {
         inputEvent_.disable();
         v_eof();
         return;
@@ -347,7 +347,7 @@ prefix_ void senf::term::BaseTelnetProtocol::readHandler(int state)
 
 prefix_ void senf::term::BaseTelnetProtocol::writeHandler(int state)
 {
-    if (state != senf::scheduler::FdEvent::EV_WRITE) {
+    if (state != scheduler::FdEvent::EV_WRITE) {
         outputEvent_.disable();
         inputEvent_.disable();
         v_eof();
index 379a613..0178d8b 100644 (file)
@@ -47,7 +47,7 @@
  */
 #define SENF_PP_SEQ_BACK(seq) BOOST_PP_SEQ_ELEM(BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(seq)),seq)
 
-# // No recursive call so we need some more of theese ... ARGH !!!
+# // No recursive call so we need some more of these ... ARGH !!!
 # define SENF_CAT_RECURS1(a, b) SENF_CAT_RECURS1_I(a,b)
 # define SENF_CAT_RECURS1_I(a, b) a ## b
 # define SENF_CAT_RECURS2(a, b) SENF_CAT_RECURS2_I(a,b)