namespace impl {
struct PkReg_Entry {
+ virtual ~PkReg_Entry() {}
virtual void registerInterpreter(Packet const * p,
Packet::iterator b, Packet::iterator e) = 0;
virtual Packet::ptr reinterpret(Packet * p) = 0;
Parser_traits_fixed_size_check(&Parser::bytes))-sizeof(Parser_traits_sentinel<1>);
};
- template <class T>
- Parser_traits_sentinel<2> Parser_traits_fixed_size_check(T);
+ template <class R>
+ Parser_traits_sentinel<2> Parser_traits_fixed_size_check(R (*)());
template <class R,class T>
- Parser_traits_sentinel<1> Parser_traits_fixed_size_check(R (T::*)());
+ Parser_traits_sentinel<1> Parser_traits_fixed_size_check(R (T::*)() const);
template <class Parser, class Iterator>
bool check(Iterator const & b, Iterator const & e, ParserBase *);
// Custom includes
#include "ParserBase.hh"
#include "Packet.hh"
+#include <boost/static_assert.hpp>
#include <boost/test/auto_unit_test.hpp>
#include <boost/test/test_tools.hpp>
BOOST_AUTO_UNIT_TEST(parserBase_construction)
{
+ BOOST_STATIC_ASSERT( pkf::Parser_traits< Parse_Test<> >::fixed_size );
+ BOOST_STATIC_ASSERT( ! pkf::Parser_traits< Parse_Test2<> >::fixed_size );
+
BOOST_CHECK_EQUAL( pkf::min_bytes< Parse_Test<int> >(), 14u );
BOOST_CHECK( pkf::check< Parse_Test<int> >(0,14) );
BOOST_CHECK( ! pkf::check< Parse_Test<int> >(2,15) );
template <class Type> TypeIdValue(Type *);
struct Value {
+ virtual ~Value() {}
virtual std::type_info const & id() = 0;
virtual Value * clone() = 0;
};