User Manual, Developers Guide and API Documentation

CRCFilter.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_CRC_CRCFILTER_HPP
00029 #define WNS_LDK_CRC_CRCFILTER_HPP
00030 
00031 #include <WNS/ldk/fu/Plain.hpp>
00032 #include <WNS/ldk/SuspendableInterface.hpp>
00033 #include <WNS/ldk/SuspendSupport.hpp>
00034 
00035 #include <WNS/pyconfig/View.hpp>
00036 #include <WNS/logger/Logger.hpp>
00037 
00038 #include <list>
00039 
00040 namespace wns { namespace ldk { namespace crc {
00041 
00042     class CRC;
00043 
00075     class CRCFilter :
00076         public fu::Plain<CRCFilter>,
00077         virtual public SuspendableInterface,
00078         public SuspendSupport
00079     {
00083         typedef std::vector<wns::ldk::FunctionalUnit*> FUContainer;
00084 
00085     public:
00089         explicit
00090         CRCFilter(fun::FUN* fuNet, const wns::pyconfig::View& _config);
00091 
00095         virtual
00096         ~CRCFilter()
00097         {};
00098 
00099     private:
00104         virtual void
00105         doSendData(const CompoundPtr& compound)
00106         {
00107             getConnector()->getAcceptor(compound)->sendData(compound);
00108         } // doSendData
00109 
00110         virtual void
00111         doOnData(const CompoundPtr& compound);
00112 
00113         virtual bool
00114         doIsAccepting(const CompoundPtr& compound) const
00115         {
00116             return getConnector()->hasAcceptor(compound);
00117         } // doIsAccepting
00118 
00119         virtual void
00120         doWakeup()
00121         {
00122             getReceptor()->wakeup();
00123         } // wakeup
00124 
00125         virtual void
00126         onFUNCreated();
00127 
00128         virtual bool
00129         onSuspend() const
00130         {
00131             return true;
00132         } // onSuspend
00134 
00139         struct Friends
00140         {
00141             CRC* crc;
00142         } friends;
00143 
00148         FUContainer fus;
00149 
00150         wns::pyconfig::View config;
00151         logger::Logger logger;
00152     };
00153 
00154 } // crc
00155 } // ldk
00156 } // wns
00157 
00158 #endif // NOT defined WNS_LDK_CRC_CRCFILTER_HPP
00159 
00160 

Generated on Mon May 21 03:31:45 2012 for openWNS by  doxygen 1.5.5