SimConfig.h
Go to the documentation of this file.00001
00002 #ifndef INCLUDED_SimConfig_h_
00003 #define INCLUDED_SimConfig_h_
00004
00005 #include "Shared/plist.h"
00006 #include "SharedGlobals.h"
00007 #include "IPC/RCRegion.h"
00008
00009
00010 class SimConfig : public plist::Dictionary {
00011 public:
00012 SimConfig() : plist::Dictionary(false),
00013 cmdPrompt("hal> "),
00014 initSimTime(0),
00015 tgtRunlevel(SharedGlobals::RUNNING, SharedGlobals::runlevel_names),
00016 multiprocess(false),
00017 lastfile()
00018 {
00019 sim::config.setUnusedWarning(false);
00020 addEntry("InitialTime",initSimTime,"The value to initialize the simulator's clock (in milliseconds)");
00021 addEntry("InitialRunlevel",tgtRunlevel,"Specifies how far startup should proceed before pausing for user interaction.\nThis value only affects startup, and setting this value from the simulator command prompt will have no effect. (Use the 'runlevel' command instead.)");
00022 addEntry("Multiprocess",multiprocess,"The processing/threading model to use - true to use real process forks a la Aibo/Aperios, or false to just more threads like a sane person would do");
00023 }
00024
00025 std::string cmdPrompt;
00026 plist::Primitive<unsigned int> initSimTime;
00027 plist::NamedEnumeration<SharedGlobals::runlevel_t> tgtRunlevel;
00028 plist::Primitive<bool> multiprocess;
00029
00030 void setLastFile(const std::string& str) const {
00031 lastfile=str;
00032 }
00033 const std::string& getLastFile() const {
00034 return lastfile;
00035 }
00036 virtual unsigned int loadFile(const char* filename) {
00037 lastfile=filename;
00038 return plist::Dictionary::loadFile(filename);
00039 }
00040 virtual unsigned int saveFile(const char* filename) const {
00041 lastfile=filename;
00042 return plist::Dictionary::saveFile(filename);
00043 }
00044
00045 protected:
00046 mutable std::string lastfile;
00047 };
00048
00049
00050
00051
00052
00053
00054 #endif