AnnotationRouter.hh
Go to the documentation of this file.
1 //
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
6 //
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
11 //
12 
13 
17 #ifndef HH_SENF_PPI_AnnotationRouter_
18 #define HH_SENF_PPI_AnnotationRouter_ 1
19 
20 // Custom includes
21 #include <boost/ptr_container/ptr_map.hpp>
22 #include <senf/Utils/String.hh>
23 #include "Module.hh"
24 #include "Connectors.hh"
25 #include "MultiConnectorMixin.hh"
26 
27 //#include "AnnotationRouter.mpp"
28 //-/////////////////////////////////////////////////////////////////////////////////////////////////
29 
30 namespace senf {
31 namespace ppi {
32 namespace module {
33 
87  template <class AnnotationType>
89  : public Module,
90  public MultiConnectorMixin< AnnotationRouter<AnnotationType>,
91  connector::ActiveOutput<>,
92  AnnotationType >
93  {
95  public:
98 
100 
102  { DuplicateKeyException(AnnotationType const & key)
103  : senf::Exception("Duplicate senf::ppi::module::AnnotationRouter routing key ")
104  { append( senf::str(key)); } };
105 
106  private:
107  AnnotationType connectorSetup(connector::ActiveOutput<> & conn, AnnotationType const & key);
108  void request();
109 
110  friend class MultiConnectorMixin< AnnotationRouter<AnnotationType>,
111  connector::ActiveOutput<>,
112  AnnotationType >;
113  };
114 
115 }}}
116 
117 //-/////////////////////////////////////////////////////////////////////////////////////////////////
118 //#include "AnnotationRouter.cci"
119 #include "AnnotationRouter.ct"
120 //#include "AnnotationRouter.cti"
121 #endif
122 
123 
124 // Local Variables:
125 // mode: c++
126 // fill-column: 100
127 // comment-column: 40
128 // c-file-style: "senf"
129 // indent-tabs-mode: nil
130 // ispell-local-dictionary: "american"
131 // compile-command: "scons -u test"
132 // End:
Connector actively sending packets.
Definition: Connectors.hh:677
Module base-class.
Definition: Module.hh:169
Connectors public header.
Module public header.
Route packets to destination according to some annotation value
void append(std::string text)
#define SENF_PPI_MODULE(name)
Define PPI Module.
Definition: Module.hh:346
connector::ActiveOutput defaultOutput
MultiConnectorMixin public header.
Connector passively receiving packets.
Definition: Connectors.hh:655