g2o
Loading...
Searching...
No Matches
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)
 
ParserInterfaceoperator= (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.

◆ ParserInterface() [2/2]

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

◆ ~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

◆ 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();
54 return true;
55}
bool parse_stream(std::istream &in, const std::string &sname="stream input")
Definition driver.cpp:43

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

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: