// Custom includes
#include "../Utils/senfassert.hh"
#include <iostream>
+#include "../Utils/TypeInfo.hh"
#define prefix_
///////////////////////////////ct.p////////////////////////////////////////
return PacketType::factory();
}
+template <class PacketType>
+prefix_ std::string senf::detail::PkReg_EntryImpl<PacketType>::name()
+ const
+{
+ return prettyName(typeid(PacketType));
+}
+
template <class KeyType>
template <class PacketType>
prefix_ void senf::detail::PacketRegistryImpl<KeyType>::registerPacket(key_t key)
virtual ~PkReg_Entry();
virtual Packet::factory_t factory() const = 0;
///< Get factory of the registered packet type
+ virtual std::string name() const = 0;
};
namespace detail { template <class Key> class PacketRegistryImpl; }
: public PkReg_Entry
{
virtual Packet::factory_t factory() const;
+ virtual std::string name() const;
};
/** \brief Internal: Singleton class implementing the packet registry.
: private boost::noncopyable
{
public:
- ///////////////////////////////////////////////////////////////////////////
- // Types
-
typedef KeyType key_t;
-
typedef PkReg_Entry Entry;
+ private:
+ typedef boost::intrusive_ptr<Entry> Entry_ptr;
+ typedef std::map<key_t, Entry_ptr> PacketMap;
+ typedef std::map<senf::TypeIdValue, key_t> ReversePacketMap;
+
+ public:
+ ///////////////////////////////////////////////////////////////////////////
+ // Types
+
///////////////////////////////////////////////////////////////////////////
///\name Structors and default members
///@{
protected:
private:
- typedef boost::intrusive_ptr<Entry> Entry_ptr;
- typedef std::map<key_t, Entry_ptr> PacketMap;
- typedef std::map<senf::TypeIdValue, key_t> ReversePacketMap;
-
PacketMap registry_;
ReversePacketMap reverseRegistry_;
};