X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=senf%2FPackets%2FPacketRegistry.ih;h=169d2757e3de344d8ff4f42620a30c7d200fa4c7;hb=b490ccf2b17ccb29681e60b3e35aa5a949df3a10;hp=24c98512c21062ecb8b1e166b74c2cac1b576ecb;hpb=26610f603ebdd465307b9621f532c1fe19fd5571;p=senf.git diff --git a/senf/Packets/PacketRegistry.ih b/senf/Packets/PacketRegistry.ih index 24c9851..169d275 100644 --- a/senf/Packets/PacketRegistry.ih +++ b/senf/Packets/PacketRegistry.ih @@ -28,6 +28,7 @@ // Custom includes #include +#include #include #include #include @@ -74,13 +75,16 @@ namespace detail { virtual ~PacketRegistryImplBase(); static void dump(std::ostream & os); + static void clear(); protected: typedef std::map RegistryMap; static RegistryMap & registries(); private: - virtual void v_dump(std::ostream & os) = 0; + virtual bool v_empty() const = 0; + virtual void v_dump(std::ostream & os) const = 0; + virtual void v_clear() = 0; }; /** \brief Internal: Singleton class implementing the packet registry. @@ -131,12 +135,26 @@ namespace detail { protected: private: - virtual void v_dump(std::ostream & os); + virtual bool v_empty() const; + virtual void v_dump(std::ostream & os) const; + virtual void v_clear(); PacketMap registry_; ReversePacketMap reverseRegistry_; }; + template ::is_integer> + struct DumpKey + { + static void dump(KeyType const & v, std::ostream & os); + }; + + template + struct DumpKey + { + static void dump(KeyType const & v, std::ostream & os); + }; + }} ///////////////////////////////ih.e////////////////////////////////////////