From: tho Date: Wed, 10 Feb 2010 10:29:08 +0000 (+0000) Subject: Packets/GenericTLV: added bytes(key) member to registry X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=47d8fe245087b57098115b66094872cfffb8cbed;p=senf.git Packets/GenericTLV: added bytes(key) member to registry some minor mixed changes git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1575 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/senf/Packets/GenericTLV.ct b/senf/Packets/GenericTLV.ct index 28ae2be..6605618 100644 --- a/senf/Packets/GenericTLV.ct +++ b/senf/Packets/GenericTLV.ct @@ -134,6 +134,18 @@ prefix_ senf::PacketParserBase::size_type senf::GenericTLVParserRegistry +prefix_ senf::PacketParserBase::size_type senf::GenericTLVParserRegistry::bytes( + GenericTLVParser const & parser, Keytype const & key) + const +{ + typename Map::const_iterator i (map_.find( key)); + if (i != map_.end()) + return (i->second)->bytes(parser); + else + throw TLVParserNotRegisteredException(); +} + ///////////////////////////////ct.e//////////////////////////////////////// diff --git a/senf/Packets/GenericTLV.cti b/senf/Packets/GenericTLV.cti index b4ba16e..b9a0960 100644 --- a/senf/Packets/GenericTLV.cti +++ b/senf/Packets/GenericTLV.cti @@ -35,6 +35,7 @@ template prefix_ senf::PacketParserBase::size_type senf::GenericTLVParserBase::bytes() + const { if (Base::Registry::instance().isRegistered( *this)) return Base::Registry::instance().bytes( *this); diff --git a/senf/Packets/GenericTLV.hh b/senf/Packets/GenericTLV.hh index 8d1357f..0e0ddc3 100644 --- a/senf/Packets/GenericTLV.hh +++ b/senf/Packets/GenericTLV.hh @@ -136,7 +136,7 @@ namespace senf { GenericTLVParserBase(senf::PacketParserBase::data_iterator i, senf::PacketParserBase::state_type s) : Base(i,s) {} - senf::PacketParserBase::size_type bytes(); + senf::PacketParserBase::size_type bytes() const; void init() const; template @@ -284,6 +284,7 @@ namespace senf { void dump(GenericTLVParser const & parser, Keytype const & key, std::ostream & os) const; PacketParserBase::size_type bytes(GenericTLVParser const & parser) const; + PacketParserBase::size_type bytes(GenericTLVParser const & parser, Keytype const & key) const; }; struct TLVParserNotRegisteredException : public senf::Exception diff --git a/senf/Scheduler/ClockService.test.cc b/senf/Scheduler/ClockService.test.cc index 93c07f9..e6d405a 100644 --- a/senf/Scheduler/ClockService.test.cc +++ b/senf/Scheduler/ClockService.test.cc @@ -58,6 +58,7 @@ SENF_AUTO_UNIT_TEST(clockService) { char const * enabled (getenv("SENF_TIMING_CRITICAL_TESTS")); BOOST_WARN_MESSAGE(enabled, "Set SENF_TIMING_CRITICAL_TESTS to not skip timing critical tests"); + BOOST_CHECK( true ); senf::ClockService::restart(); // So we know, when the signal will be delivered diff --git a/senf/Socket/Protocols/INet/RawINetSocketHandle.test.cc b/senf/Socket/Protocols/INet/RawINetSocketHandle.test.cc index a3a58e1..c542811 100644 --- a/senf/Socket/Protocols/INet/RawINetSocketHandle.test.cc +++ b/senf/Socket/Protocols/INet/RawINetSocketHandle.test.cc @@ -141,6 +141,7 @@ SENF_AUTO_UNIT_TEST(RawV4ClientSocketHandle) { if (getuid() != 0) { BOOST_WARN_MESSAGE(false, "Cannot test senf::RawV4SocketHandle as non-root user"); + BOOST_CHECK( true ); return; } try { @@ -170,6 +171,7 @@ SENF_AUTO_UNIT_TEST(RawV6ClientSocketHandle) { if (getuid() != 0) { BOOST_WARN_MESSAGE(false, "Cannot test senf::RawV6SocketHandle as non-root user"); + BOOST_CHECK( true ); return; } try { diff --git a/senf/Utils/senfassert.hh b/senf/Utils/senfassert.hh index 6a6c8ca..d6f92e7 100644 --- a/senf/Utils/senfassert.hh +++ b/senf/Utils/senfassert.hh @@ -27,7 +27,6 @@ #define HH_SENF_Utils_senfassert_ 1 // Custom includes -#include //#include "senfassert.mpp" ///////////////////////////////hh.p////////////////////////////////////////