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 AnnotationRouter non-inline template implementation  */
    17 //#include "AnnotationRouter.ih"
    22 //-/////////////////////////////////////////////////////////////////////////////////////////////////
    24 template <class AnnotationType>
    25 prefix_ senf::ppi::module::AnnotationRouter<AnnotationType>::AnnotationRouter()
    28     noroute(defaultOutput);
    29     input.onRequest(&AnnotationRouter::request);
    30     input.throttlingDisc( senf::ppi::ThrottlingDiscipline::NONE);
    33 template <class AnnotationType>
    34 prefix_ AnnotationType senf::ppi::module::AnnotationRouter<AnnotationType>::
    35 connectorSetup(connector::ActiveOutput<> & conn, AnnotationType const & key)
    37     if (this->connectors().find(key) != this->connectors().end())
    38         throw DuplicateKeyException(key);
    39     route(input, conn).autoThrottling( false);
    43 template <class AnnotationType>
    44 prefix_ void senf::ppi::module::AnnotationRouter<AnnotationType>::request()
    46     Packet const & p (input());
    47     typename AnnotationRouter::ContainerType::iterator i (
    48         this->connectors().find(p.annotation<AnnotationType>()));
    49     if (SENF_UNLIKELY(i == this->connectors().end()))
    50         defaultOutput.write(p);
    55 //-/////////////////////////////////////////////////////////////////////////////////////////////////
    63 // c-file-style: "senf"
    64 // indent-tabs-mode: nil
    65 // ispell-local-dictionary: "american"
    66 // compile-command: "scons -u test"