Regilo
A simple C++ library for controlling the Neato XV robot and the Hokuyo scanner.
regilo::IController Class Referenceabstract

The IController interface is used for all controller classes. More...

#include <controller.hpp>

Inheritance diagram for regilo::IController:
regilo::IScanController regilo::StreamController< StreamT > regilo::StreamController< ba::serial_port > regilo::StreamController< bai::tcp::socket > regilo::IHokuyoController regilo::INeatoController regilo::ScanController< ProtocolController > regilo::SerialController regilo::SocketController regilo::HokuyoController< ProtocolController > regilo::NeatoController< ProtocolController > regilo::HokuyoController< ProtocolController > regilo::NeatoController< ProtocolController >

Public Member Functions

virtual ~IController ()=default
 Default destructor.
 
virtual void connect (const std::string &endpoint)=0
 Connect the controller to a device. More...
 
virtual bool isConnected () const =0
 Test if the controller is connected. More...
 
virtual std::string getEndpoint () const =0
 Get the endpoint of device. More...
 
virtual std::shared_ptr< ILoggetLog ()=0
 Get the current Log. More...
 
virtual std::shared_ptr< const ILoggetLog () const =0
 Get the current Log (a const variant). More...
 
virtual void setLog (std::shared_ptr< ILog > log)=0
 Set a Log (it can be shared between more controllers). More...
 
virtual std::string sendCommand (const std::string &command)=0
 Send a command to the device. More...
 

Detailed Description

The IController interface is used for all controller classes.

Member Function Documentation

virtual void regilo::IController::connect ( const std::string &  endpoint)
pure virtual

Connect the controller to a device.

Parameters
endpointThe device endpoint (a path, IP address, etc.).

Implemented in regilo::SocketController, and regilo::SerialController.

virtual std::string regilo::IController::getEndpoint ( ) const
pure virtual

Get the endpoint of device.

Returns
The device endpoint or empty string.

Implemented in regilo::SocketController, and regilo::SerialController.

virtual std::shared_ptr<ILog> regilo::IController::getLog ( )
pure virtual
virtual std::shared_ptr<const ILog> regilo::IController::getLog ( ) const
pure virtual

Get the current Log (a const variant).

Returns
The Log or empty std::shared_ptr.

Implemented in regilo::StreamController< StreamT >, regilo::StreamController< bai::tcp::socket >, and regilo::StreamController< ba::serial_port >.

virtual bool regilo::IController::isConnected ( ) const
pure virtual

Test if the controller is connected.

Returns
True if connected.

Implemented in regilo::StreamController< StreamT >, regilo::StreamController< bai::tcp::socket >, and regilo::StreamController< ba::serial_port >.

virtual std::string regilo::IController::sendCommand ( const std::string &  command)
pure virtual

Send a command to the device.

Parameters
commandA command with all parameters.
Returns
A string with a whole response to the command.

Implemented in regilo::StreamController< StreamT >, regilo::StreamController< bai::tcp::socket >, and regilo::StreamController< ba::serial_port >.

virtual void regilo::IController::setLog ( std::shared_ptr< ILog log)
pure virtual

Set a Log (it can be shared between more controllers).

Parameters
logSmart pointer to the Log.

Implemented in regilo::StreamController< StreamT >, regilo::StreamController< bai::tcp::socket >, and regilo::StreamController< ba::serial_port >.


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