Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

SimConfig.h

Go to the documentation of this file.
00001 //-*-c++-*-
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 //! Provides the root dictionary of the simulator configuration, items from SharedGlobals and LoadFileThreads are added as entries in this dictionary
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; //!< Not persistently stored -- [re]set by main(...) on each run
00026   plist::Primitive<unsigned int> initSimTime; //!< The "boot" time to start the simulator clock at (default 0)
00027   plist::NamedEnumeration<SharedGlobals::runlevel_t> tgtRunlevel; //!< The runlevel the simulator should move to (i.e. stop before 'running' to debug startup code)
00028   plist::Primitive<bool> 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
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 /*! @file
00050  * @brief Provides the root dictionary of the simulator configuration, items from SharedGlobals and LoadFileThreads are added as entries in this dictionary
00051  * @author Ethan Tira-Thompson (ejt) (Creator)
00052  */
00053 
00054 #endif

Tekkotsu Hardware Abstraction Layer 5.1CVS
Generated Mon May 9 05:01:39 2016 by Doxygen 1.6.3