hyperion.ng/libsrc/leddevice/LedDeviceFile.h

42 lines
817 B
C
Raw Normal View History

#pragma once
// STL includes0
#include <fstream>
// Leddevice includes
#include <leddevice/LedDevice.h>
2013-09-09 04:54:13 +02:00
///
/// Implementation of the LedDevice that write the led-colors to an
/// ASCII-textfile('/home/pi/LedDevice.out')
///
class LedDeviceFile : public LedDevice
{
public:
2013-09-09 04:54:13 +02:00
///
/// Constructs the test-device, which opens an output stream to the file
///
LedDeviceFile(const std::string& output);
2013-09-09 04:54:13 +02:00
///
/// Destructor of this test-device
///
virtual ~LedDeviceFile();
2013-09-09 04:54:13 +02:00
///
/// Writes the given led-color values to the output stream
///
/// @param ledValues The color-value per led
///
/// @return Zero on success else negative
///
virtual int write(const std::vector<ColorRgb> & ledValues);
/// Switch the leds off
virtual int switchOff();
private:
2013-09-09 04:54:13 +02:00
/// The outputstream
std::ofstream _ofs;
};