User Manual, Developers Guide and API Documentation

ConnectorRegistry.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_CONNECTORREGISTRY_HPP
00014 #define WNS_LDK_CONNECTORREGISTRY_HPP
00015 
00016 #include <WNS/ldk/Connector.hpp>
00017 
00018 #include <WNS/container/Registry.hpp>
00019 
00020 #include <string>
00021 
00022 namespace wns { namespace ldk {
00023 
00024         class ConnectorRegistry
00025         {
00026         public:
00027             ConnectorRegistry()
00028                 : theRegistry_()
00029             {}
00030 
00031             ConnectorRegistry(const ConnectorRegistry&)
00032                 : theRegistry_()
00033             {}
00034 
00035             virtual
00036             ~ConnectorRegistry()
00037             {}
00038 
00039             Connector*
00040             getFromConnectorRegistry(std::string portname) const
00041             {
00042                 return theRegistry_.find(portname);
00043             }
00044 
00045             std::list<std::string>
00046             getKeysFromConnectorRegistry() const
00047             {
00048                 return theRegistry_.keys();
00049             }
00050 
00051             void
00052             addToConnectorRegistry(std::string portname, Connector* cr)
00053             {
00054                 theRegistry_.insert(portname, cr);
00055             }
00056 
00057         protected:
00058             void
00059             updateConnectorRegistry(const std::string portname, Connector* cr)
00060             {
00061                 theRegistry_.update(portname, cr);
00062             }
00063 
00064         private:
00065             container::Registry<std::string, Connector*> theRegistry_;
00066         };
00067     } // ldk
00068 } // wns
00069 
00070 #endif // WNS_LDK_CONNECTORREGISTRY_HPP

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