X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Packets%2FPacketRegistry.ct;h=2f598ced50287ede180ccc0cb38b7f6bcae2f0ef;hb=0734bd14c709ca5ba1d0ed69c5b9f5d1487e5faa;hp=ca5a144ba05da3a7ac60e1032f320219159342c4;hpb=47368f306a577d1e46df69a7f729bd3893cbe5e7;p=senf.git diff --git a/Packets/PacketRegistry.ct b/Packets/PacketRegistry.ct index ca5a144..2f598ce 100644 --- a/Packets/PacketRegistry.ct +++ b/Packets/PacketRegistry.ct @@ -1,9 +1,9 @@ // $Id$ // // Copyright (C) 2006 -// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) -// Kompetenzzentrum fuer Satelitenkommunikation (SatCom) -// Stefan Bund +// Fraunhofer Institute for Open Communication Systems (FOKUS) +// Competence Center NETwork research (NET), St. Augustin, GERMANY +// Stefan Bund // // 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,11 +20,13 @@ // 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" // Custom includes +#include "../Utils/senfassert.hh" #include #define prefix_ @@ -34,23 +36,28 @@ template prefix_ senf::PacketInterpreterBase::factory_t senf::detail::PkReg_EntryImpl::factory() const { - return PacketInterpreter::factory(); + return PacketType::factory(); } template template prefix_ void senf::detail::PacketRegistryImpl::registerPacket(key_t key) { +#ifdef SENF_NO_DEBUG + registry_.insert(std::make_pair(key, Entry_ptr(new detail::PkReg_EntryImpl()))); + reverseRegistry_.insert(std::make_pair(senf::typeIdValue(), key)); +#else bool isUnique ( registry_.insert( std::make_pair(key, Entry_ptr(new detail::PkReg_EntryImpl()))).second); // If this assertion fails, a Packet was registered with an already known key - BOOST_ASSERT( isUnique ); + SENF_ASSERT( isUnique ); bool isNew ( reverseRegistry_.insert( std::make_pair(senf::typeIdValue(), key)).second); // If this assertion fails, the same Packet was registered with two different keys - BOOST_ASSERT( isNew ); + SENF_ASSERT( isNew ); +#endif } template