trikRuntime
trikControl::Fifo Class Reference

Class that represents linux FIFO file, which is commonly used by various sensors. More...

#include <fifo.h>

Inheritance diagram for trikControl::Fifo:
Collaboration diagram for trikControl::Fifo:

Public Slots

QString read () override
 Reads data from this FIFO file, returning all available data as string. More...
 
bool hasData () const override
 Returns true if FIFO has new data in it. More...
 
- Public Slots inherited from trikControl::FifoInterface
virtual QString read ()=0
 Reads data from this FIFO file, returning all available data as string. More...
 
virtual bool hasData () const =0
 Returns true if FIFO has new data in it. More...
 

Public Member Functions

 Fifo (const QString &virtualPort, const trikKernel::Configurer &configurer, const trikHal::HardwareAbstractionInterface &hardwareAbstraction)
 Constructor. More...
 
 Fifo (const QString &fileName, const trikHal::HardwareAbstractionInterface &hardwareAbstraction)
 Constructor. More...
 
 ~Fifo () override
 
Status status () const override
 Returns current status of the device. More...
 
- Public Member Functions inherited from trikControl::DeviceInterface
 DeviceInterface ()=default
 
virtual ~DeviceInterface ()=default
 

Additional Inherited Members

- Public Types inherited from trikControl::DeviceInterface
enum  Status {
  Status::permanentFailure, Status::temporaryFailure, Status::off, Status::starting,
  Status::ready, Status::stopping
}
 Device status. More...
 
- Signals inherited from trikControl::FifoInterface
void newData (const QString &data)
 Emitted when new string is arrived to FIFO file. Emitted several times if more than one string arrives at once. More...
 
- Static Public Member Functions inherited from trikControl::DeviceInterface
static Status combine (const DeviceInterface &underlying, const DeviceInterface::Status &dependent)
 Helper method to return status of a device relying on other device to work. More...
 

Detailed Description

Class that represents linux FIFO file, which is commonly used by various sensors.

Constructor & Destructor Documentation

Fifo::Fifo ( const QString &  virtualPort,
const trikKernel::Configurer configurer,
const trikHal::HardwareAbstractionInterface hardwareAbstraction 
)

Constructor.

Creates FIFO device by a description in config file.

Parameters
virtualPort- port in system-config.xml on which this FIFO file is configured.
configurer- configurer object containing preparsed XML files with parameters.
hardwareAbstraction- interface to underlying hardware or operating system capabilities of a robot.
Fifo::Fifo ( const QString &  fileName,
const trikHal::HardwareAbstractionInterface hardwareAbstraction 
)

Constructor.

Creates FIFO device programmatically by file name.

Parameters
fileName- name of a FIFO file.
hardwareAbstraction- interface to underlying hardware or operating system capabilities of a robot.
Fifo::~Fifo ( )
override

Member Function Documentation

bool Fifo::hasData ( ) const
overrideslot

Returns true if FIFO has new data in it.

QString Fifo::read ( )
overrideslot

Reads data from this FIFO file, returning all available data as string.

DeviceInterface::Status Fifo::status ( ) const
overridevirtual

Returns current status of the device.

Implements trikControl::DeviceInterface.


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