User Manual, Developers Guide and API Documentation

ConnectorReceptacleRegistry.hpp

Go to the documentation of this file.
00001 /******************************************************************************
00002  * WNS (Wireless Network Simulator)                                           *
00003  * __________________________________________________________________________ *
00004  *                                                                            *
00005  * Copyright (C) 2004-2008                                                    *
00006  * Chair of Communication Networks (ComNets)                                  *
00007  * Kopernikusstr. 1, D-52074 Aachen, Germany                                  *
00008  * phone: ++49-241-80-27910 (phone), fax: ++49-241-80-22242                   *
00009  * email: wns@comnets.rwth-aachen.de                                          *
00010  * www: http://wns.comnets.rwth-aachen.de                                     *
00011  ******************************************************************************/
00012 
00013 #ifndef WNS_LDK_CONNECTORRECEPTACLEREGISTRY_HPP
00014 #define WNS_LDK_CONNECTORRECEPTACLEREGISTRY_HPP
00015 
00016 #include <WNS/ldk/IConnectorReceptacle.hpp>
00017 
00018 #include <WNS/container/Registry.hpp>
00019 
00020 #include <string>
00021 
00022 namespace wns { namespace ldk {
00023 
00024         class ConnectorReceptacleRegistry
00025         {
00026         public:
00027             ConnectorReceptacleRegistry()
00028                 : theRegistry_()
00029             {}
00030 
00031             ConnectorReceptacleRegistry(const ConnectorReceptacleRegistry&)
00032                 : theRegistry_()
00033             {}
00034 
00035             virtual
00036             ~ConnectorReceptacleRegistry()
00037             {}
00038 
00039             IConnectorReceptacle*
00040             getFromConnectorReceptacleRegistry(std::string portname) const
00041             {
00042                 return theRegistry_.find(portname);
00043             }
00044 
00045             std::list<std::string>
00046             getKeysFromConnectorReceptacleRegistry() const
00047             {
00048                 return theRegistry_.keys();
00049             }
00050 
00051         protected:
00052             void
00053             updateConnectorReceptacleRegistry(const std::string portname, IConnectorReceptacle* cr)
00054             {
00055                 theRegistry_.update(portname, cr);
00056             }
00057 
00058             void
00059             addToConnectorReceptacleRegistry(std::string portname, IConnectorReceptacle* cr)
00060             {
00061                 theRegistry_.insert(portname, cr);
00062             }
00063 
00064         private:
00065             container::Registry<std::string, IConnectorReceptacle*> theRegistry_;
00066         };
00067     } // ldk
00068 } // wns
00069 
00070 #endif // WNS_LDK_CONNECTORRECEPTACLEREGISTRY_HPP

Generated on Tue May 22 03:31:37 2012 for openWNS by  doxygen 1.5.5