g2o
Public Member Functions | Protected Attributes | List of all members
SlamParser::ParserInterface Class Reference

top-level interface to the parser More...

#include <parser_interface.h>

Collaboration diagram for SlamParser::ParserInterface:
Collaboration graph
[legend]

Public Member Functions

 ParserInterface (AbstractSlamInterface *slamInterface)
 
virtual ~ParserInterface ()
 
bool parseCommand (std::istream &input)
 

Protected Attributes

SlamContextInterface_slamContextInterface
 
Driver_driver
 
std::stringstream _buffer
 

Detailed Description

top-level interface to the parser

Definition at line 43 of file parser_interface.h.

Constructor & Destructor Documentation

SlamParser::ParserInterface::ParserInterface ( AbstractSlamInterface slamInterface)

construct a parser and use the given AbstractSlamInterface to communicate with the SLAM algorithm.

Definition at line 34 of file parser_interface.cpp.

References _driver, and _slamContextInterface.

35  {
36  _slamContextInterface = new SlamContextInterface(slamInterface);
37  _driver = new Driver(*_slamContextInterface);
38  //_driver->trace_parsing = true;
39  //_driver->trace_scanning = true;
40  }
SlamContextInterface * _slamContextInterface
SlamParser::ParserInterface::~ParserInterface ( )
virtual

Definition at line 42 of file parser_interface.cpp.

References _driver, and _slamContextInterface.

43  {
44  delete _slamContextInterface;
45  delete _driver;
46  }
SlamContextInterface * _slamContextInterface

Member Function Documentation

bool SlamParser::ParserInterface::parseCommand ( std::istream &  input)

parse a single command and forward to the SLAM engine

Definition at line 48 of file parser_interface.cpp.

References _buffer, _driver, and SlamParser::Driver::parse_stream().

Referenced by main().

49  {
50  if (input.eof())
51  return false;
52  _buffer.str("");
53  _buffer.clear();
54  input.get(*_buffer.rdbuf(), ';');
55  if (! input.eof()) // get the ';'
56  _buffer << (char)input.get();
58  return true;
59  }
bool parse_stream(std::istream &in, const std::string &sname="stream input")
Definition: driver.cpp:44

Member Data Documentation

std::stringstream SlamParser::ParserInterface::_buffer
protected

Definition at line 60 of file parser_interface.h.

Referenced by parseCommand().

Driver* SlamParser::ParserInterface::_driver
protected

Definition at line 59 of file parser_interface.h.

Referenced by parseCommand(), ParserInterface(), and ~ParserInterface().

SlamContextInterface* SlamParser::ParserInterface::_slamContextInterface
protected

Definition at line 58 of file parser_interface.h.

Referenced by ParserInterface(), and ~ParserInterface().


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