User Manual, Developers Guide and API Documentation

FakeFU.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_TOOLS_FAKEFU_HPP
00029 #define WNS_LDK_TOOLS_FAKEFU_HPP
00030 
00031 #include <WNS/ldk/HasReceptor.hpp>
00032 #include <WNS/ldk/HasConnector.hpp>
00033 #include <WNS/ldk/HasDeliverer.hpp>
00034 #include <WNS/ldk/Forwarding.hpp>
00035 #include <WNS/ldk/fun/Main.hpp>
00036 
00037 
00038 namespace wns { namespace ldk { namespace tools {
00039 
00046     class FakeFU :
00047         public HasReceptor<>,
00048         public HasConnector<>,
00049         public HasDeliverer<>,
00050         public FunctionalUnit,
00051         public Cloneable<FakeFU>
00052     {
00053     public:
00054         FakeFU() :
00055             HasReceptor<>(),
00056             HasConnector<>(),
00057             HasDeliverer<>(),
00058                         //          Forwarding<FakeFU>(),
00059                         Cloneable<FakeFU>(),
00060                         fun(new fun::Main(NULL))
00061         {}
00062 
00063             virtual
00064             ~FakeFU()
00065             {
00066                 delete fun;
00067             }
00068 
00069             virtual bool
00070             doIsAccepting(const CompoundPtr& compound) const
00071             {
00072                 return isAcceptingForwarded(compound);
00073             }
00074 
00075             virtual bool
00076             isAcceptingForwarded(const CompoundPtr& compound) const
00077             {
00078                 return getConnector()->hasAcceptor(compound);
00079             }
00080 
00081             virtual void
00082             doSendData(const CompoundPtr& compound)
00083             {
00084                 sendDataForwarded(compound);
00085             }
00086 
00087             virtual void
00088             sendDataForwarded(const CompoundPtr& compound)
00089             {
00090                 getConnector()->getAcceptor(compound)->sendData(compound);
00091             }
00092 
00093             virtual void
00094             doWakeup()
00095             {
00096                 wakeupForwarded();
00097             }
00098 
00099             virtual void
00100             wakeupForwarded()
00101             {
00102                 getReceptor()->wakeup();
00103             }
00104 
00105             virtual void
00106             doOnData(const CompoundPtr& compound)
00107             {
00108                 onDataForwarded(compound);
00109             }
00110 
00111             virtual void
00112             onDataForwarded(const CompoundPtr& compound)
00113             {
00114                 getDeliverer()->getAcceptor(compound)->onData(compound);
00115             }
00116 
00117         virtual fun::FUN*
00118         getFUN() const
00119         {
00120             return fun;
00121         }
00122 
00123         virtual wns::ldk::Command*
00124         getCommand(const wns::ldk::CommandPool*) const
00125         {
00126             return NULL;
00127         }
00128 
00129         virtual wns::ldk::Command*
00130         activateCommand(wns::ldk::CommandPool*) const
00131         {
00132             return NULL;
00133         }
00134 
00135         virtual wns::ldk::CommandPool*
00136         createReply(const wns::ldk::CommandPool*) const
00137         {
00138             return NULL;
00139         }
00140 
00141         virtual void
00142         calculateSizes(const wns::ldk::CommandPool*, Bit&, Bit&) const
00143         {
00144             return;
00145         }
00146 
00147         virtual void
00148         commitSizes(wns::ldk::CommandPool*) const
00149         {
00150             return;
00151         }
00152 
00153         virtual wns::ldk::Command*
00154         createCommand() const
00155         {
00156             return NULL;
00157         }
00158 
00159         virtual wns::ldk::Command*
00160         copyCommand(const wns::ldk::Command*) const
00161         {
00162             return NULL;
00163         }
00164 
00165         virtual wns::ldk::CopyCommandInterface*
00166         getCopyCommandInterface() const
00167         {
00168             return NULL;
00169         }
00170 
00171         virtual CommandReaderInterface*
00172         getCommandReader(CommandProxy*)
00173         {
00174             return NULL;
00175         }
00176 
00177 #ifndef NDEBUG
00178         virtual size_t
00179         getCommandObjSize() const
00180         {
00181             return 0;
00182         }
00183 #endif
00184         private:
00185             fun::Main* fun;
00186     };
00187 
00188 }
00189 }
00190 }
00191 
00192 #endif // NOT defined WNS_LDK_TOOLS_FAKEFU_HPP
00193 
00194 
00195 

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