g2o
Loading...
Searching...
No Matches
SlamParser::ParserInterface Class Reference

top-level interface to the parser More...

#include <parser_interface.h>

Collaboration diagram for SlamParser::ParserInterface:

Public Member Functions

 ParserInterface (AbstractSlamInterface *slamInterface)
ParserInterface & operator= (const ParserInterface &)=delete
 ParserInterface (const ParserInterface &)=delete
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

◆ ParserInterface() [1/2]

SlamParser::ParserInterface::ParserInterface ( AbstractSlamInterface * slamInterface)
explicit

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

Definition at line 34 of file parser_interface.cpp.

34 {
35 _slamContextInterface = new SlamContextInterface(slamInterface);
36 _driver = new Driver(*_slamContextInterface);
37 //_driver->trace_parsing = true;
38 //_driver->trace_scanning = true;
39}
SlamContextInterface * _slamContextInterface

References _driver, and _slamContextInterface.

Referenced by operator=(), and ParserInterface().

◆ ParserInterface() [2/2]

SlamParser::ParserInterface::ParserInterface ( const ParserInterface & )
delete

References ParserInterface().

◆ ~ParserInterface()

SlamParser::ParserInterface::~ParserInterface ( )
virtual

Definition at line 41 of file parser_interface.cpp.

41 {
43 delete _driver;
44}

References _driver, and _slamContextInterface.

Member Function Documentation

◆ operator=()

ParserInterface & SlamParser::ParserInterface::operator= ( const ParserInterface & )
delete

References ParserInterface().

◆ parseCommand()

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

parse a single command and forward to the SLAM engine

Definition at line 46 of file parser_interface.cpp.

46 {
47 if (input.eof()) return false;
48 _buffer.str("");
49 _buffer.clear();
50 input.get(*_buffer.rdbuf(), ';');
51 if (!input.eof()) // get the ';'
52 _buffer << (char)input.get();
53 _driver->parse_stream(_buffer);
54 return true;
55}

References _buffer, and _driver.

Referenced by main(), and main().

Member Data Documentation

◆ _buffer

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

Definition at line 62 of file parser_interface.h.

Referenced by parseCommand().

◆ _driver

Driver* SlamParser::ParserInterface::_driver
protected

Definition at line 61 of file parser_interface.h.

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

◆ _slamContextInterface

SlamContextInterface* SlamParser::ParserInterface::_slamContextInterface
protected

Definition at line 60 of file parser_interface.h.

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


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