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

- Class List
- Class Hierarchy
- Class Members

# ConfigurationParser Class Reference

`#include <ConfigurationParser.h>`

List of all members.

## Public Member Functions
| ConfigurationParser ()
virtual | ~ConfigurationParser ()
void | parseSimSetup (const char *filename)
void | parseObjectsSetup (const char *filename)
void | parseTopographySetup (const char *filename)
## Private Member Functions
void | parsePolygon ()
void | parseViewpoint ()
void | parseCarSource ()
void | parseCarSink ()
void | parseCar ()
void | parseBuilding ()
void | parseSigning ()
bool | getLine ()
void | parseLine (const char *types,...)
Sector * | lookupSector (int id)
## Private Attributes
std::istringstream | _iss
std::ifstream | _file
int | _line
CarTypeMap | _carTypes

## Detailed Description

Class for parsing the configuration files

## Constructor & Destructor Documentation

ConfigurationParser::ConfigurationParser | ( |  | ) | `[inline]`

virtual ConfigurationParser::~ConfigurationParser | ( |  | ) | `[inline, virtual]`

## Member Function Documentation

bool ConfigurationParser::getLine | ( |  | ) | `[private]`

Reads a line from the input file and strips comments

Returns:
  false if reached end of file

Sector * ConfigurationParser::lookupSector | ( | int | id | ) | `[private]`

Searches for a sector in simulator, returns its pointer if found or creates new if not found

Parameters:

  | id | Sector's ID

void ConfigurationParser::parseBuilding | ( |  | ) | `[private]`

Parses a single building

void ConfigurationParser::parseCar | ( |  | ) | `[private]`

Parses a single car

void ConfigurationParser::parseCarSink | ( |  | ) | `[private]`

Parses a car sink object

void ConfigurationParser::parseCarSource | ( |  | ) | `[private]`

Parses a car source object

void ConfigurationParser::parseLine | ( | const char * | types,
|  |  | ... |
| ) |  |  | `[private]`

Parses the currently read line It accepts arbitrary amount of parameters which it fills with value found on the line. The configuration of passed parameters is specified in the first parameter. Currently supported types are: i - int d - double f - float s - string R - dReal

Parameters:

  | types | a concatenated list of variable types

void ConfigurationParser::parseObjectsSetup | ( | const char * | filename | ) |

Parses the objects file and instantiates simulation objects according to it

void ConfigurationParser::parsePolygon | ( |  | ) | `[private]`

Parses a single polygon

void ConfigurationParser::parseSigning | ( |  | ) | `[private]`

Parses a single signing

void ConfigurationParser::parseSimSetup | ( | const char * | filename | ) |

Parses the simulation setup file with basic constants (gravity, ERP, CFM, etc.)

void ConfigurationParser::parseTopographySetup | ( | const char * | filename | ) |

Parses the topography file and instantiates sectors according to it

void ConfigurationParser::parseViewpoint | ( |  | ) | `[private]`

Parses a viewpoint

## Member Data Documentation

CarTypeMap ConfigurationParser::_carTypes`[private]`

std::ifstream ConfigurationParser::_file`[private]`

std::istringstream ConfigurationParser::_iss`[private]`

int ConfigurationParser::_line`[private]`

The documentation for this class was generated from the following files:

- src/conf/ConfigurationParser.h
- src/conf/ConfigurationParser.cpp