- Main Page
- Modules
- Classes
- Files
- Related Pages

- File List
- File Members

# src/conf/ConfigurationParser.h

Go to the documentation of this file.

    00001 #ifndef CONFIGURATIONPARSER_H_
    00002 #define CONFIGURATIONPARSER_H_
    00003
    00004 #include <sstream>
    00005 #include <fstream>
    00006
    00007 #include "../config.h"
    00008 #include "../typedefs.h"
    00009 #include "../SimulatorException.h"
    00010
    00014 class ConfigurationParser
    00015 {
    00016 public:
    00017     ConfigurationParser(): _iss(), _file(), _line(0), _carTypes() {};
    00018     virtual ~ConfigurationParser() {};
    00019
    00023     void parseSimSetup(const char* filename);
    00027     void parseObjectsSetup(const char* filename);
    00031     void parseTopographySetup(const char* filename);
    00032
    00033 private:
    00034     std::istringstream _iss;
    00035     std::ifstream _file;
    00036     int _line;
    00037     CarTypeMap _carTypes;
    00038
    00040     void parsePolygon();
    00042     void parseViewpoint();
    00044     void parseCarSource();
    00046     void parseCarSink();
    00048     void parseCar();
    00050     void parseBuilding();
    00052     void parseSigning();
    00053
    00058     bool getLine();
    00071     void parseLine(const char* types, ...);
    00076     Sector* lookupSector(int id);
    00077 };
    00078
    00079 class ConfigurationException: public SimulatorException {
    00080 public:
    00081     ConfigurationException(const std::string msg): SimulatorException(msg) {};
    00082     ConfigurationException(const char* msg): SimulatorException(msg) {};
    00083     ~ConfigurationException() {};
    00084 };
    00085 #endif /*CONFIGURATIONPARSER_H_*/