ReaSEUnderlayConfigurator.h

Go to the documentation of this file.
00001 //
00002 // Copyright (C) 2010 Institut fuer Telematik, Karlsruher Institut fuer Technologie (KIT)
00003 //
00004 // This program is free software; you can redistribute it and/or
00005 // modify it under the terms of the GNU General Public License
00006 // as published by the Free Software Foundation; either version 2
00007 // of the License, or (at your option) any later version.
00008 //
00009 // This program is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 // GNU General Public License for more details.
00013 //
00014 // You should have received a copy of the GNU General Public License
00015 // along with this program; if not, write to the Free Software
00016 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00017 //
00018 
00025 #ifndef REASEUNDERLAYCONFIGURATOR_H_
00026 #define REASEUNDERLAYCONFIGURATOR_H_
00027 
00028 
00029 #include <vector>
00030 #include <deque>
00031 #include <set>
00032 
00033 #include <omnetpp.h>
00034 
00035 #include <UnderlayConfigurator.h>
00036 #include <ConnectReaSE.h>
00037 
00038 class AccessInfo;
00039 class IPvXAddress;
00040 
00047 class ReaSEUnderlayConfigurator : public UnderlayConfigurator
00048 {
00049 public:
00056     TransportAddress* createNode(NodeType type, bool initialize=false);
00057 
00064     void preKillNode(NodeType type, TransportAddress* addr=NULL);
00065 
00072     void migrateNode(NodeType type, TransportAddress* addr=NULL);
00073 
00074 private:
00075     // parameters
00076     int accessRouterNum; 
00077     int overlayAccessRouterNum; 
00078     int overlayTerminalNum; 
00079     ConnectReaSE* TerminalConnector;
00080 
00081 protected:
00082 
00090     void initializeUnderlay(int stage);
00091 
00097     void handleTimerEvent(cMessage* msg);
00098 
00102     void finishUnderlay();
00103 
00107     void setDisplayString();
00108     std::vector<cModule*> accessNode; 
00109     std::deque<IPvXAddress> killList; 
00110     std::set<int> scheduledID; 
00111 
00112     // statistics
00113     int numCreated; 
00114     int numKilled; 
00115 };
00116 
00117 
00118 
00119 #endif /* REASEUNDERLAYCONFIGURATOR_H_ */