X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Packets%2FPacketImpl.hh;h=0ad1e77f847caa6ddc5c7d8585c565af6afaa311;hb=6fecbc9f068fc7c391f5f23d2c7ff37f61f1ff2d;hp=de52e40bb58b56b5d74a2fb1db910f2b9b22771a;hpb=2ffca72ed06b10829071cd1b28d9047ff735f929;p=senf.git diff --git a/Packets/PacketImpl.hh b/Packets/PacketImpl.hh index de52e40..0ad1e77 100644 --- a/Packets/PacketImpl.hh +++ b/Packets/PacketImpl.hh @@ -82,8 +82,13 @@ namespace detail { struct AnnotationIndexerBase { + virtual ~AnnotationIndexerBase(); + virtual void v_dump(PacketImpl * p, std::ostream & os) = 0; + static unsigned maxAnnotations; static std::vector & small(); + static std::vector & registry(); + static void dump(PacketImpl * p, std::ostream & os); }; template @@ -92,11 +97,13 @@ namespace detail { public AnnotationIndexerBase { AnnotationIndexer(); + virtual void v_dump(PacketImpl * p, std::ostream & os); unsigned index_; static unsigned index(); static bool const Complex = boost::is_base_of::value; static bool const Small = (sizeof(Annotation) <= sizeof(AnnotationEntry) && ! Complex); +# if 0 // The test is difficult since it does not work with user-defined trivial constructors # ifdef BOOST_HAS_TYPE_TRAITS_INTRINSICS BOOST_STATIC_ASSERT(( (boost::has_trivial_constructor::value @@ -104,18 +111,21 @@ namespace detail { || Complex )); # endif +# endif }; template ::Small> struct GetAnnotation { static Annotation & get(AnnotationEntry & e); + static void dump(AnnotationEntry & e, std::ostream & os); }; template struct GetAnnotation { static Annotation & get(AnnotationEntry & e); + static void dump(AnnotationEntry & e, std::ostream & os); }; /** \brief Internal: Packet data storage @@ -189,6 +199,9 @@ namespace detail { // Annotations template Annotation & annotation(); + void dumpAnnotations(std::ostream & os); + template + void dumpAnnotation(std::ostream & os); /** \brief Internal: Keep PacketImpl instance alive