00001 // $Id: Joins.hh 1742 2010-11-04 14:51:56Z g0dil $ 00002 // 00003 // Copyright (C) 2007 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_Joins_ 00027 #define HH_SENF_PPI_Joins_ 1 00028 00029 // Custom includes 00030 #include <boost/ptr_container/ptr_vector.hpp> 00031 #include "predecl.hh" 00032 #include "Connectors.hh" 00033 #include "Module.hh" 00034 #include "MultiConnectorMixin.hh" 00035 00036 //#include "Joins.mpp" 00037 //-///////////////////////////////////////////////////////////////////////////////////////////////// 00038 00039 namespace senf { 00040 namespace ppi { 00041 00042 namespace module { 00043 00063 class PassiveJoin 00064 : public Module, 00065 public MultiConnectorMixin<PassiveJoin, connector::PassiveInput<> > 00066 { 00067 SENF_PPI_MODULE(PassiveJoin); 00068 public: 00069 connector::ActiveOutput<> output; 00070 00071 PassiveJoin(); 00072 00073 private: 00074 void connectorSetup(connector::PassiveInput<> & conn); 00075 void request(connector::GenericPassiveInput & input); 00076 void onThrottle(); 00077 void onUnthrottle(); 00078 00079 friend class MultiConnectorMixin<PassiveJoin, connector::PassiveInput<> >; 00080 }; 00081 00108 class PriorityJoin 00109 : public Module, 00110 public MultiConnectorMixin<PriorityJoin, connector::ActiveInput<> > 00111 { 00112 SENF_PPI_MODULE(PriorityJoin); 00113 public: 00114 connector::PassiveOutput<> output; 00115 00116 PriorityJoin(); 00117 00118 private: 00119 void connectorSetup(PriorityJoin::ConnectorType & conn, int priority=-1); 00120 void request(); 00121 void onThrottle(); 00122 void onUnthrottle(); 00123 00124 friend class MultiConnectorMixin<PriorityJoin, connector::ActiveInput<> >; 00125 }; 00126 00127 }}} 00128 00129 //-///////////////////////////////////////////////////////////////////////////////////////////////// 00130 #include "Joins.cci" 00131 //#include "Joins.ct" 00132 //#include "Joins.cti" 00133 #endif 00134 00135 00136 // Local Variables: 00137 // mode: c++ 00138 // fill-column: 100 00139 // comment-column: 40 00140 // c-file-style: "senf" 00141 // indent-tabs-mode: nil 00142 // ispell-local-dictionary: "american" 00143 // compile-command: "scons -u test" 00144 // End: