#include "PacketRegistry.ih"
// Custom includes
-#include <senf/Utils/senfassert.hh>
#include <iostream>
#include <iomanip>
-#include <cmath>
#include <senf/Utils/TypeInfo.hh>
#include <senf/Utils/Format.hh>
+#include <senf/Utils/senfassert.hh>
#define prefix_
-///////////////////////////////ct.p////////////////////////////////////////
+//-/////////////////////////////////////////////////////////////////////////////////////////////////
-///////////////////////////////////////////////////////////////////////////
+//-/////////////////////////////////////////////////////////////////////////////////////////////////
// senf::detail::PacketRegistryImpl<KeyType>::Entry
template <class KeyType>
prefix_ senf::detail::PacketRegistryImpl<KeyType>::Entry::~Entry()
{}
-///////////////////////////////////////////////////////////////////////////
+//-/////////////////////////////////////////////////////////////////////////////////////////////////
// senf::detail::PacketRegistryImpl<KeyType>::EntryImpl<PacketType>
template <class KeyType>
return typeid(PacketType);
}
-///////////////////////////////////////////////////////////////////////////
-// senf::PacketRegistry<Tag>
-
-template <class Tag>
-prefix_ typename senf::PacketRegistry<Tag>::Registry &
-senf::PacketRegistry<Tag>::registry()
-{
- static Registry registry (prettyName(typeid(Tag)));
- return registry;
-}
-
-///////////////////////////////////////////////////////////////////////////
+//-/////////////////////////////////////////////////////////////////////////////////////////////////
// senf::detail::PacketRegistryImpl<KeyType>:
template <class KeyType>
template <class PacketType>
prefix_ void senf::detail::PacketRegistryImpl<KeyType>::registerPacket(key_t key, int priority)
{
- SENF_ASSERT(registry_.insert(
- typename Entry::ptr(new EntryImpl<PacketType>(key,priority))).second);
+ SENF_ASSERT_EXPRESSION(
+ registry_.insert(
+ typename Entry::ptr(new EntryImpl<PacketType>(key,priority))).second,
+ "Duplicate packet registration");
}
template <class KeyType>
registry_.clear();
}
-///////////////////////////////////////////////////////////////////////////
+//-/////////////////////////////////////////////////////////////////////////////////////////////////
// senf::detail::DumpKey<KeyType,is_integral>
template <class KeyType, bool is_integral>
os << " " << senf::format::dumpint(v);
}
-///////////////////////////////ct.e////////////////////////////////////////
+//-/////////////////////////////////////////////////////////////////////////////////////////////////
#undef prefix_
\f