X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=senf%2FPackets%2FPacketImpl.ih;h=619859fecc17c278621e272da42eefdbc484a06c;hb=7ee689fe38d66aa3a0004d55e8708750d35adc0b;hp=32ce82cb99e74a1812b1dcf19d847f129280742a;hpb=20c3dbf64b3beed10655dceaee5791680fb25383;p=senf.git diff --git a/senf/Packets/PacketImpl.ih b/senf/Packets/PacketImpl.ih index 32ce82c..619859f 100644 --- a/senf/Packets/PacketImpl.ih +++ b/senf/Packets/PacketImpl.ih @@ -43,12 +43,11 @@ #include #include -///////////////////////////////ih.p//////////////////////////////////////// +//-///////////////////////////////////////////////////////////////////////////////////////////////// namespace senf { struct ComplexAnnotation; - void dumpPacketAnnotationRegistry(std::ostream & os); namespace detail { @@ -155,8 +154,16 @@ namespace detail { virtual ~EntryBase() {} virtual void * get() = 0; + + typedef EntryBase * ptr; + virtual ptr clone() const = 0; }; + inline AnnotationRegistry::EntryBase::ptr new_clone( AnnotationRegistry::EntryBase const & entry) + { + return entry.clone(); + } + template class AnnotationRegistry::Entry : public AnnotationRegistry::EntryBase @@ -169,6 +176,7 @@ namespace detail { { senf::IGNORE(&proxy_); return key_; } virtual void * get() { return & annotation_; } + virtual EntryBase::ptr clone() const { return new Entry( *this); } private: Annotation annotation_; @@ -178,7 +186,7 @@ namespace detail { }} -///////////////////////////////ih.e//////////////////////////////////////// +//-///////////////////////////////////////////////////////////////////////////////////////////////// #endif