|
INET Framework for OMNeT++/OMNEST
|
00001 // 00002 // Copyright (C) 2005 Andras Varga 00003 // 00004 // This program is free software; you can redistribute it and/or 00005 // modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 00013 // 00014 // You should have received a copy of the GNU Lesser General Public License 00015 // along with this program; if not, see <http://www.gnu.org/licenses/>. 00016 // 00017 00018 #ifndef SCENARIOMANAGER_H 00019 #define SCENARIOMANAGER_H 00020 00021 #include <omnetpp.h> 00022 #include "INETDefs.h" 00023 #include "IScriptable.h" 00024 00025 00038 class INET_API ScenarioManager : public cSimpleModule 00039 { 00040 protected: 00041 // total number of changes, and number of changes already done 00042 int numChanges; 00043 int numDone; 00044 00045 protected: 00046 // utilities 00047 const char *getRequiredAttribute(cXMLElement *node, const char *attr); 00048 virtual cModule *getRequiredModule(cXMLElement *node, const char *attr); 00049 virtual cGate *getRequiredGate(cXMLElement *node, const char *modattr, const char *gateattr); 00050 00051 // dispatch to command processors 00052 virtual void processCommand(cXMLElement *node); 00053 00054 // command processors 00055 virtual void processAtCommand(cXMLElement *node); 00056 virtual void processSetParamCommand(cXMLElement *node); 00057 virtual void processSetChannelAttrCommand(cXMLElement *node); 00058 virtual void processCreateModuleCommand(cXMLElement *node); 00059 virtual void processDeleteModuleCommand(cXMLElement *node); 00060 virtual void processConnectCommand(cXMLElement *node); 00061 virtual void processDisconnectCommand(cXMLElement *node); 00062 virtual void processModuleSpecificCommand(cXMLElement *node); 00063 00064 public: 00065 ScenarioManager() {} 00066 00067 protected: 00068 virtual void initialize(); 00069 virtual void handleMessage(cMessage *msg); 00070 virtual void updateDisplayString(); 00071 }; 00072 00073 #endif