User Manual, Developers Guide and API Documentation

CompoundSwitch.hpp

Go to the documentation of this file.
00001 /*******************************************************************************
00002  * This file is part of openWNS (open Wireless Network Simulator)
00003  * _____________________________________________________________________________
00004  *
00005  * Copyright (C) 2004-2007
00006  * Chair of Communication Networks (ComNets)
00007  * Kopernikusstr. 16, D-52074 Aachen, Germany
00008  * phone: ++49-241-80-27910,
00009  * fax: ++49-241-80-22242
00010  * email: info@openwns.org
00011  * www: http://www.openwns.org
00012  * _____________________________________________________________________________
00013  *
00014  * openWNS is free software; you can redistribute it and/or modify it under the
00015  * terms of the GNU Lesser General Public License version 2 as published by the
00016  * Free Software Foundation;
00017  *
00018  * openWNS is distributed in the hope that it will be useful, but WITHOUT ANY
00019  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
00020  * A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
00021  * details.
00022  *
00023  * You should have received a copy of the GNU Lesser General Public License
00024  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00025  *
00026  ******************************************************************************/
00027 
00028 #ifndef DLL_COMPOUNDSWITCH_COMPOUNDSWITCH_HPP
00029 #define DLL_COMPOUNDSWITCH_COMPOUNDSWITCH_HPP
00030 
00031 #include <WNS/ldk/CommandTypeSpecifier.hpp>
00032 #include <WNS/ldk/HasReceptor.hpp>
00033 #include <WNS/ldk/HasConnector.hpp>
00034 #include <WNS/ldk/HasDeliverer.hpp>
00035 #include <WNS/ldk/Processor.hpp>
00036 
00037 #include <WNS/Cloneable.hpp>
00038 #include <WNS/pyconfig/View.hpp>
00039 #include <WNS/logger/Logger.hpp>
00040 
00041 #include <DLL/compoundSwitch/CompoundSwitchConnector.hpp>
00042 #include <DLL/compoundSwitch/CompoundSwitchDeliverer.hpp>
00043 
00044 namespace dll { namespace compoundSwitch {
00045 
00046     class FilterInterface;
00047     class Filter;
00048 
00055     class CompoundSwitchCommand :
00056         public wns::ldk::Command
00057     {
00058     public:
00059         CompoundSwitchCommand()
00060         {
00061             local.filterName = "";
00062         }
00063 
00064         struct {
00065             // Used by filter::FilterByFilterName
00066             std::string filterName;
00067         } local;
00068         struct {} peer;
00069         struct {} magic;
00070     };
00071 
00110     class CompoundSwitch :
00111         virtual public wns::ldk::FunctionalUnit,
00112         public wns::ldk::CommandTypeSpecifier<CompoundSwitchCommand>,
00113         public wns::ldk::HasReceptor<>,
00114         public wns::ldk::HasConnector<CompoundSwitchConnector>,
00115         public wns::ldk::HasDeliverer<CompoundSwitchDeliverer>,
00116         public wns::Cloneable<CompoundSwitch>
00117     {
00118     public:
00119         CompoundSwitch(wns::ldk::fun::FUN* fuNet, const wns::pyconfig::View& config);
00120 
00121         ~CompoundSwitch();
00122 
00123         virtual void onFUNCreated();
00124 
00125         wns::ldk::FunctionalUnit*
00126         findFUNFriend( std::string friendName);
00127 
00128         wns::ldk::CommandProxy*
00129         getCommandProxy()
00130         {
00131             return getFUN()->getProxy();
00132         }
00133 
00134     private:
00135 
00136         typedef std::list<Filter*> Filters;
00137 
00138         virtual void
00139         doSendData(const wns::ldk::CompoundPtr& compound);
00140 
00141         virtual void
00142         doOnData(const wns::ldk::CompoundPtr& compound);
00143 
00144         virtual bool
00145         doIsAccepting(const wns::ldk::CompoundPtr& compound) const;
00146 
00147         virtual void
00148         doWakeup();
00149 
00150         // Log output of association between Filter and Functional Unit
00151         void
00152         printFilterAssociation();
00153 
00154         struct Friends {
00155         } friends_;
00156 
00157         wns::logger::Logger logger_;
00158 
00159         bool mustAccept_;
00160     };
00161 }}
00162 
00163 #endif // NOT defined DLL_COMPOUNDSWITCH_COMPOUNDSWITCH_HPP

Generated on Fri Feb 10 03:32:29 2012 for openWNS by  doxygen 1.5.5