Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

/home/pauldt/projects/IDEA/IDEA-ALL/IDEA-DEV/Core/Simulator/Includes/SimScriptReaderBase.hh

Go to the documentation of this file.
00001 // -*- Mode: c++ -*-
00002 //     File: $Source: /home/cvs/ISG-Repository/IDEA-DEV/Core/Simulator/Includes/SimScriptReaderBase.hh,v $
00003 //      Tag: $Name: DR_01_11_06 $
00004 //      CVS: $Id: SimScriptReaderBase.hh,v 1.5 2005/12/30 22:16:18 rijsman Exp $
00005 //     Info: $CVSROOT/IDEA-DEV/COPYRIGHT
00006 
00007 #ifndef SIMULATORE_SCRIPT_READER_BASE_HEADER_
00008 #define SIMULATORE_SCRIPT_READER_BASE_HEADER_
00009 
00010 #include <fstream>
00011 #include <sstream>
00012 #include "TimeBasics.hh"
00013 
00014 namespace IDEA
00015 {
00024   template< class Type > bool parseType( std::istringstream& stringStream, Type& type )
00025   {
00026     stringStream >> type;
00027 
00028     if( stringStream.fail() )
00029       {
00030         std::cerr << "Error: can not parse '" << stringStream << "'" << std::endl;
00031         
00032         return false;
00033       }
00034 
00035     return true;
00036   }
00040   template<> bool parseType( std::istringstream& stringStream, std::string& buffer );
00041 
00049   class SimulatorScriptReaderBase
00050   {
00051   public:
00055     virtual ~SimulatorScriptReaderBase();
00056     
00070     bool parseTimeUnit( std::istringstream& iss, Granularity& g ) const;
00071   protected:
00072     static std::string SECONDS;
00073     static std::string DECI_SECONDS;
00074     static std::string CENTI_SECONDS;
00075     static std::string MILLI_SECONDS;
00076     static std::string MICRO_SECONDS;
00077     static std::string NANO_SECONDS;
00078 
00082     SimulatorScriptReaderBase();
00083     
00084   };
00085 
00089 }
00090 
00091 #endif // SIMULATORE_SCRIPT_READER_BASE_HEADER_

Contact information
© IDEA
Generated on Fri Feb 3 17:09:41 2006 for IDEA.