User Manual, Developers Guide and API Documentation

NotFoundStrategy.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_FLOWSEPARATOR_NOTFOUNDSTRATEGY_HPP
00029 #define WNS_LDK_FLOWSEPARATOR_NOTFOUNDSTRATEGY_HPP
00030 
00031 
00032 #include <WNS/ldk/fun/FUN.hpp>
00033 #include <WNS/ldk/Key.hpp>
00034 #include <memory>
00035 
00036 namespace wns { namespace ldk { namespace flowseparator {
00037 
00038     class CreatorStrategy;
00039     class FlowInfoProvider;
00040 
00044     class NotFoundStrategy
00045     {
00046     public:
00047         virtual
00048         ~NotFoundStrategy();
00049 
00054         virtual FunctionalUnit*
00055         ifNotFound(const ConstKeyPtr& key) const = 0;
00056 
00059         virtual void
00060         onFUNCreated() = 0;
00061 
00062             virtual FunctionalUnit*
00063             createPrototype() const = 0;
00064 
00065     }; // class NotFoundStrategy
00066 
00072     class Complain :
00073         public virtual NotFoundStrategy
00074     {
00075     public:
00076         Complain();
00077 
00078         Complain(fun::FUN* fuNet, const pyconfig::View& config);
00079 
00080         FunctionalUnit*
00081         ifNotFound(const ConstKeyPtr& key) const;
00082 
00083             FunctionalUnit*
00084             createPrototype() const;
00085 
00086         void
00087         onFUNCreated();
00088     };
00089 
00095     class CreateOnFirstCompound :
00096         public virtual NotFoundStrategy
00097     {
00098     public:
00099         CreateOnFirstCompound(fun::FUN* fuNet, const pyconfig::View& config);
00100         CreateOnFirstCompound(CreatorStrategy* _creator);
00101 
00102         virtual
00103         ~CreateOnFirstCompound();
00104 
00105         FunctionalUnit* ifNotFound(const ConstKeyPtr& key) const;
00106 
00107             FunctionalUnit*
00108             createPrototype() const;
00109 
00110         void onFUNCreated();
00111 
00112     private:
00116         std::auto_ptr<CreatorStrategy> creator;
00117     };
00118 
00125     class CreateOnValidFlow :
00126         public virtual NotFoundStrategy
00127     {
00128     public:
00129         CreateOnValidFlow(fun::FUN* fuNet, const pyconfig::View& config);
00130 
00131         CreateOnValidFlow(CreatorStrategy* _creator, FlowInfoProvider* _flowInfo);
00132 
00133         virtual
00134         ~CreateOnValidFlow();
00135 
00136             FunctionalUnit*
00137             createPrototype() const;
00138 
00139         FunctionalUnit*
00140         ifNotFound(const ConstKeyPtr& key) const;
00141 
00142         void
00143         onFUNCreated();
00144     private:
00148         fun::FUN* fun;
00149 
00153         std::auto_ptr<CreatorStrategy> creator;
00154 
00161         FlowInfoProvider* flowInfo;
00162 
00167         std::string flowInfoProviderName;
00168     };
00169 
00170     typedef FUNConfigCreator<NotFoundStrategy> NotFoundStrategyCreator;
00171     typedef wns::StaticFactory<NotFoundStrategyCreator> NotFoundStrategyFactory;
00172 
00173 } // namespace flowseparator
00174 } // namespace ldk
00175 } // namespace wns
00176 
00177 #endif // WNS_LDK_FLOWSEPARATOR_NOTFOUNDSTRATEGY_HPP

Generated on Fri May 25 03:31:43 2012 for openWNS by  doxygen 1.5.5