00001 // 00002 // Copyright (C) 2006 Institut fuer Telematik, Universitaet Karlsruhe (TH) 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 00024 #ifndef __CHURNGENERATOR_H_ 00025 #define __CHURNGENERATOR_H_ 00026 00027 #define MAX_NODETYPES 100 00028 00029 #include <string> 00030 #include <vector> 00031 #include <omnetpp.h> 00032 00033 #include <InitStages.h> 00034 00035 class UnderlayConfigurator; 00036 00042 class NodeType 00043 { 00044 public: 00045 NodeType() : typeID(0) {}; 00046 uint32_t typeID; 00047 std::string overlayType, tier1Type, tier2Type, tier3Type; 00048 std::string terminalType; 00049 std::vector<std::string> channelTypesRx, channelTypesTx; 00050 cObject** context; 00051 }; 00052 00053 00058 class ChurnGenerator : public cSimpleModule 00059 { 00060 public: 00061 virtual int numInitStages() const { return MAX_STAGE_UNDERLAY + 1; } 00062 virtual void initialize(int stage); 00063 virtual void initializeChurn() = 0; 00064 virtual void handleMessage(cMessage* msg) = 0; 00065 void setNodeType(const NodeType& t) { type = t; } 00066 const NodeType& getNodeType() { return type; } 00067 bool init; 00068 int terminalCount; 00069 00070 protected: 00071 UnderlayConfigurator* underlayConfigurator; 00072 virtual void updateDisplayString() = 0; 00073 int targetOverlayTerminalNum; 00074 NodeType type; 00075 }; 00076 00077 #endif