User Manual, Developers Guide and API Documentation

Handler.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_SERVICE_DLL_HANDLER_HPP
00029 #define WNS_SERVICE_DLL_HANDLER_HPP
00030 
00031 #include <WNS/service/dll/ProtocolNumber.hpp>
00032 #include <WNS/osi/PDU.hpp>
00033 #include <WNS/service/tl/FlowID.hpp>
00034 #include <WNS/service/dll/FlowID.hpp>
00035 
00036 namespace wns { namespace service { namespace dll {
00046       class Handler
00047       {
00048       public:
00052     virtual ~Handler() {};
00053 
00059     virtual void
00060     onData(const wns::osi::PDUPtr& _pdu, wns::service::dll::FlowID _dllFlowID = wns::service::dll::NoFlowID) = 0;
00061       };
00062 
00074       class FlowHandler
00075       {
00076       public:
00080     virtual ~FlowHandler() {}
00081 
00089     virtual void
00090     onFlowEstablished(wns::service::tl::FlowID /*flowID*/, wns::service::dll::FlowID /*_dllFlowID*/)=0;
00091 
00092     virtual void
00093     onFlowChanged(wns::service::tl::FlowID /*flowID*/, wns::service::dll::FlowID /*_dllFlowID*/)=0;
00094       };
00095 
00096 
00097       class IRuleControl
00098       {
00099       public:
00103     virtual ~IRuleControl() {}
00104 
00109     virtual void
00110     onFlowRemoved(wns::service::dll::FlowID /*flowID*/)=0;
00111       };
00112 
00113 
00119       class Notification :
00120     virtual public wns::service::Service
00121       {
00122       public:
00123     /*
00124      * @brief Registration of DataHandlers of the upper layer.
00125      *
00126      * @param[in] _protocol Protocol Number this _handler is responsible for
00127      *
00128      * @param[in] _handler An implementation of the Handler interface.
00129      * Will receive PDUs of the given protocol.
00130      */
00131     virtual void
00132     registerHandler(protocolNumber protocol, Handler* handler) = 0;
00133 
00134     /*
00135      * @brief Registration of FlowHandlers of higher layers.
00136      *
00137      * @param[in] _flowHandler An implementation of the FlowHandler interface.
00138      * Will receive notification about established flow.
00139      */
00140     virtual void
00141     registerFlowHandler(FlowHandler* _flowHandler) = 0;
00142 
00143     /*
00144      * @brief Registration of IRuleControl of IP.
00145      *
00146      */
00147     virtual void
00148     registerIRuleControl(IRuleControl* _iRuleControl) = 0;
00149       };
00150     } // dll
00151   } // service
00152 } // wns
00153 
00154 #endif // WNS_SERVICE_DLL_HANDLER_HPP

Generated on Sun May 27 03:31:54 2012 for openWNS by  doxygen 1.5.5