User Manual, Developers Guide and API Documentation

HasDeliverer.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_HASDELIVERER_HPP
00029 #define WNS_LDK_HASDELIVERER_HPP
00030 
00031 #include <WNS/ldk/HasDelivererInterface.hpp>
00032 #include <WNS/ldk/DelivererRegistry.hpp>
00033 #include <WNS/ldk/SinglePort.hpp>
00034 #include <WNS/ldk/SingleDeliverer.hpp>
00035 
00036 namespace wns { namespace ldk {
00037 
00042     namespace hasdeliverer
00043     {
00048             typedef SingleDeliverer DefaultDelivererStrategy;
00049     }
00050 
00056         template <typename DELIVERERTYPE = hasdeliverer::DefaultDelivererStrategy,
00057                   typename PORTID = SinglePort>
00058         class HasDeliverer
00059             : public virtual HasDelivererInterface,
00060               public virtual DelivererRegistry
00061         {
00062         public:
00063             HasDeliverer()
00064                 : DelivererRegistry(),
00065                   deliverer_()
00066             {
00067                 addToDelivererRegistry(PORTID().name, &deliverer_);
00068             }
00069 
00070         HasDeliverer( const HasDeliverer& other)
00071                 : DelivererRegistry(),
00072                   deliverer_()
00073             {
00074                 addToDelivererRegistry(PORTID().name, &deliverer_);
00075             }
00076 
00077             HasDeliverer(DelivererRegistry* dr)
00078                 : DelivererRegistry(),
00079                   deliverer_()
00080             {
00081                 dr->addToDelivererRegistry(PORTID().name, &deliverer_);
00082             }
00083 
00084             virtual
00085             ~HasDeliverer()
00086             {}
00087 
00088             DELIVERERTYPE*
00089             getDeliverer() const
00090             {
00091                 return &deliverer_;
00092             }
00093 
00094         private:
00095             mutable DELIVERERTYPE deliverer_;
00096         };
00097 
00098     } // ldk
00099 } // wns
00100 
00101 
00102 #endif // NOT defined WNS_LDK_HASDELIVERER_HPP
00103 

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