2 // Copyright (c) 2020 Fraunhofer Institute for Applied Information Technology (FIT)
3 // Network Research Group (NET)
4 // Schloss Birlinghoven, 53754 Sankt Augustin, GERMANY
5 // Contact: support@wiback.org
7 // This file is part of the SENF code tree.
8 // It is licensed under the 3-clause BSD License (aka New BSD License).
9 // See LICENSE.txt in the top level directory for details or visit
10 // https://opensource.org/licenses/BSD-3-Clause
15 \brief MIH Message-Registry non-inline template implementation */
18 #include "Exceptions.hh"
21 //-/////////////////////////////////////////////////////////////////////////////////////////////////
22 // senf::MIHMessageRegistry
24 template <typename MIHPacket>
25 prefix_ void senf::MIHMessageRegistry::registerMessageType(key_t messageId)
27 map_.insert(messageId, new detail::MIHMessageRegistryEntry<MIHPacket>() );
30 template <typename MIHPacket>
31 prefix_ senf::MIHMessageRegistry::RegistrationProxy<MIHPacket>::RegistrationProxy(key_t messageId)
33 MIHMessageRegistry::instance().registerMessageType<MIHPacket>(messageId);
36 template <typename MIHPacket>
37 prefix_ void senf::detail::MIHMessageRegistryEntry<MIHPacket, true>::validate(senf::Packet message)
40 if (! message.is<MIHPacket>())
41 throw InvalidMIHPacketException("invalid packet chain: ")
42 << (message ? message.typeId().prettyName() : "invalid packet")
43 << " != " << prettyName(typeid(MIHPacket));
44 MIHPacket::type::validate(message.as<MIHPacket>());
47 //-/////////////////////////////////////////////////////////////////////////////////////////////////
55 // c-file-style: "senf"
56 // indent-tabs-mode: nil
57 // ispell-local-dictionary: "american"
58 // compile-command: "scons -u test"