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(-1) {}; 00046 int32_t typeID; 00047 std::string terminalType; 00048 std::vector<std::string> channelTypesRx, channelTypesTx; 00049 cObject** context; 00050 }; 00051 00052 00057 class ChurnGenerator : public cSimpleModule 00058 { 00059 public: 00060 virtual int numInitStages() const { return MAX_STAGE_UNDERLAY + 1; } 00061 virtual void initialize(int stage); 00062 virtual void initializeChurn() = 0; 00063 virtual void handleMessage(cMessage* msg) = 0; 00064 void setNodeType(const NodeType& t) { type = t; } 00065 const NodeType& getNodeType() { return type; } 00066 bool init; 00067 int terminalCount; 00068 00069 protected: 00070 UnderlayConfigurator* underlayConfigurator; 00071 virtual void updateDisplayString() = 0; 00072 int targetOverlayTerminalNum; 00073 NodeType type; 00074 }; 00075 00076 #endif