00001 // $Id: AnnotationRouter.hh 1756 2011-01-06 10:10:07Z tho $ 00002 // 00003 // Copyright (C) 2008 00004 // Fraunhofer (FOKUS) 00005 // Competence Center NETwork research (NET), St. Augustin, GERMANY 00006 // Stefan Bund <g0dil@berlios.de> 00007 // 00008 // This program is free software; you can redistribute it and/or modify 00009 // it under the terms of the GNU General Public License as published by 00010 // the Free Software Foundation; either version 2 of the License, or 00011 // (at your option) any later version. 00012 // 00013 // This program is distributed in the hope that it will be useful, 00014 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 // GNU General Public License for more details. 00017 // 00018 // You should have received a copy of the GNU General Public License 00019 // along with this program; if not, write to the 00020 // Free Software Foundation, Inc., 00021 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00022 00026 #ifndef HH_SENF_PPI_AnnotationRouter_ 00027 #define HH_SENF_PPI_AnnotationRouter_ 1 00028 00029 // Custom includes 00030 #include <boost/ptr_container/ptr_map.hpp> 00031 #include <senf/Utils/String.hh> 00032 #include "Module.hh" 00033 #include "Connectors.hh" 00034 #include "MultiConnectorMixin.hh" 00035 00036 //#include "AnnotationRouter.mpp" 00037 //-///////////////////////////////////////////////////////////////////////////////////////////////// 00038 00039 namespace senf { 00040 namespace ppi { 00041 namespace module { 00042 00096 template <class AnnotationType> 00097 class AnnotationRouter 00098 : public Module, 00099 public MultiConnectorMixin< AnnotationRouter<AnnotationType>, 00100 connector::ActiveOutput<>, 00101 AnnotationType > 00102 { 00103 SENF_PPI_MODULE(AnnotationRouter); 00104 public: 00105 connector::PassiveInput<> input; 00106 connector::ActiveOutput<> defaultOutput; 00107 00108 AnnotationRouter(); 00109 00110 struct DuplicateKeyException : public senf::Exception 00111 { DuplicateKeyException(AnnotationType const & key) 00112 : senf::Exception("Duplicate senf::ppi::module::AnnotationRouter routing key ") 00113 { append( senf::str(key)); } }; 00114 00115 private: 00116 AnnotationType connectorSetup(connector::ActiveOutput<> & conn, AnnotationType const & key); 00117 void request(); 00118 00119 friend class MultiConnectorMixin< AnnotationRouter<AnnotationType>, 00120 connector::ActiveOutput<>, 00121 AnnotationType >; 00122 }; 00123 00124 }}} 00125 00126 //-///////////////////////////////////////////////////////////////////////////////////////////////// 00127 //#include "AnnotationRouter.cci" 00128 #include "AnnotationRouter.ct" 00129 //#include "AnnotationRouter.cti" 00130 #endif 00131 00132 00133 // Local Variables: 00134 // mode: c++ 00135 // fill-column: 100 00136 // comment-column: 40 00137 // c-file-style: "senf" 00138 // indent-tabs-mode: nil 00139 // ispell-local-dictionary: "american" 00140 // compile-command: "scons -u test" 00141 // End: