throw TLVParserNotRegisteredException();
}
+template <class BaseParser, class Keytype>
+prefix_ senf::PacketParserBase::size_type senf::GenericTLVParserRegistry<BaseParser,Keytype>::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////////////////////////////////////////
template <class Base>
prefix_ senf::PacketParserBase::size_type senf::GenericTLVParserBase<Base>::bytes()
+ const
{
if (Base::Registry::instance().isRegistered( *this))
return Base::Registry::instance().bytes( *this);
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 <class Parser>
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
{
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
{
if (getuid() != 0) {
BOOST_WARN_MESSAGE(false, "Cannot test senf::RawV4SocketHandle as non-root user");
+ BOOST_CHECK( true );
return;
}
try {
{
if (getuid() != 0) {
BOOST_WARN_MESSAGE(false, "Cannot test senf::RawV6SocketHandle as non-root user");
+ BOOST_CHECK( true );
return;
}
try {
#define HH_SENF_Utils_senfassert_ 1
// Custom includes
-#include <senf/Utils/senfassert.hh>
//#include "senfassert.mpp"
///////////////////////////////hh.p////////////////////////////////////////