User Manual, Developers Guide and API Documentation

FlowGate.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. 5, 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 WNS_LDK_FLOWGATE_HPP
00029 #define WNS_LDK_FLOWGATE_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 
00036 #include <WNS/ldk/FlowSeparator.hpp>
00037 
00038 #include <WNS/ldk/fun/FUN.hpp>
00039 #include <WNS/ldk/Key.hpp>
00040 
00041 #include <WNS/logger/Logger.hpp>
00042 
00043 #include <WNS/DerefLess.hpp>
00044 
00045 namespace wns { namespace ldk {
00046 
00047     class FlowGateInterface
00048     {
00049     public:
00050         virtual
00051         ~FlowGateInterface(){}
00052 
00053         virtual void
00054         createFlow(const ConstKeyPtr& key) = 0;
00055 
00056         virtual void
00057         destroyFlow(const ConstKeyPtr& key) = 0;
00058 
00059         virtual void
00060         openFlow(const ConstKeyPtr& key) = 0;
00061 
00062         virtual void
00063         closeFlow(const ConstKeyPtr& key) = 0;
00064     };
00065 
00066     class FlowGate :
00067         virtual public FunctionalUnit,
00068         virtual public FlowGateInterface,
00069         public CommandTypeSpecifier<>,
00070         public HasReceptor<>,
00071         public HasConnector<>,
00072         public HasDeliverer<>,
00073         public Cloneable<FlowGate>
00074     {
00075         typedef std::map<ConstKeyPtr, bool, DerefLess<ConstKeyPtr> > FlowStatus;
00076         FlowStatus flowStatus;
00077 
00078         KeyBuilder* keyBuilder;
00079 
00080         wns::logger::Logger logger;
00081 
00082         bool
00083         flowIsKnown(const ConstKeyPtr& key) const;
00084 
00085     public:
00087         FlowGate(fun::FUN* fun, const wns::pyconfig::View& config);
00089         FlowGate(fun::FUN* fun, const wns::pyconfig::View& config, KeyBuilder* builder);
00090 
00091         virtual
00092         ~FlowGate();
00093 
00094         virtual void
00095         onFUNCreated();
00096 
00110         virtual void doSendData(const CompoundPtr& compound);
00111         virtual void doOnData(const CompoundPtr& compound);
00112         virtual bool doIsAccepting(const CompoundPtr& compound) const;
00113         virtual void doWakeup();
00115 
00116 
00125         virtual void
00126         createFlow(const ConstKeyPtr& key);
00127 
00128         virtual void
00129         destroyFlow(const ConstKeyPtr& key);
00130 
00131         virtual void
00132         openFlow(const ConstKeyPtr& key);
00133 
00134         virtual void
00135         closeFlow(const ConstKeyPtr& key);
00137 
00138 
00139     };
00140 
00141 }
00142 }
00143 
00144 #endif // note defined WNS_LDK_FLOWGATE_HPP
00145 
00146 

Generated on Thu May 24 03:31:39 2012 for openWNS by  doxygen 1.5.5