fixed some file headers to the new format
[senf.git] / Packets / PacketRegistry.ct
index ca5a144..4d68a92 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 //
 // Copyright (C) 2006
-// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
-// Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
-//     Stefan Bund <stefan.bund@fokus.fraunhofer.de>
+// Fraunhofer Institute for Open Communication Systems (FOKUS) 
+// Competence Center NETwork research (NET), St. Augustin, GERMANY 
+//     Stefan Bund <g0dil@berlios.de>
 //
 // This program is free software; you can redistribute it and/or modify
 // it under the terms of the GNU General Public License as published by
@@ -20,7 +20,8 @@
 // Free Software Foundation, Inc.,
 // 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
-// Definition of non-inline template funPacketRegistry.ons
+/** \file
+    \brief PacketRegistry non-inline template implementation */
 
 #include "PacketRegistry.ih"
 
@@ -34,13 +35,17 @@ template <class PacketType>
 prefix_ senf::PacketInterpreterBase::factory_t senf::detail::PkReg_EntryImpl<PacketType>::factory()
     const
 {
-    return PacketInterpreter<PacketType>::factory();
+    return PacketType::factory();
 }
 
 template <class KeyType>
 template <class PacketType>
 prefix_ void senf::detail::PacketRegistryImpl<KeyType>::registerPacket(key_t key)
 {
+#ifdef NDEBUG
+    registry_.insert(std::make_pair(key, Entry_ptr(new detail::PkReg_EntryImpl<PacketType>())));
+    reverseRegistry_.insert(std::make_pair(senf::typeIdValue<PacketType>(), key));
+#else
     bool isUnique (
         registry_.insert(
             std::make_pair(key, Entry_ptr(new detail::PkReg_EntryImpl<PacketType>()))).second);
@@ -51,6 +56,7 @@ prefix_ void senf::detail::PacketRegistryImpl<KeyType>::registerPacket(key_t key
             std::make_pair(senf::typeIdValue<PacketType>(), key)).second);
     // If this assertion fails, the same Packet was registered with two different keys
     BOOST_ASSERT( isNew );
+#endif
 }
 
 template <class KeyType>