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 QueueingAlgorithm inline template implementation */
19 #define prefix_ inline
20 //-/////////////////////////////////////////////////////////////////////////////////////////////////
22 //-/////////////////////////////////////////////////////////////////////////////////////////////////
23 // senf::ppi::QueueingAlgorithmRegistry::RegistrationProxy<QAlgorithm>
25 template <class QAlgorithm>
26 prefix_ senf::ppi::QueueingAlgorithmRegistry::RegistrationProxy<QAlgorithm>::RegistrationProxy(std::string const & key)
28 QueueingAlgorithmRegistry::instance().registerQAlgorithm<QAlgorithm>( key);
31 //-/////////////////////////////////////////////////////////////////////////////////////////////////
32 // senf::ppi::QueueingAlgorithmRegistry
34 template <class QAlgorithm>
35 prefix_ void senf::ppi::QueueingAlgorithmRegistry::registerQAlgorithm(std::string key)
37 if (qAlgoMap_.find( key) == qAlgoMap_.end() )
38 qAlgoMap_.insert(key, new detail::QueueingAlgorithmRegistry_Entry<QAlgorithm>() );
40 throw Exception("Duplicated QAlgorithm Registration ") << key;
43 //-/////////////////////////////////////////////////////////////////////////////////////////////////
44 // senf::ppi::detail::QueueingAlgorithmRegistry_Entry<QAlgorithm>
46 template <class QAlgorithm>
47 prefix_ senf::ppi::QueueingAlgorithm::ptr senf::ppi::detail::QueueingAlgorithmRegistry_Entry<QAlgorithm>::create()
50 return QAlgorithm::create();
53 //-/////////////////////////////////////////////////////////////////////////////////////////////////
61 // c-file-style: "senf"
62 // indent-tabs-mode: nil
63 // ispell-local-dictionary: "american"
64 // compile-command: "scons -u test"