hyperion.ng/libsrc/leddevice/LedDeviceFile.h
redPanther d6a34edfb2 Leddevice refactoring the next part (#253)
* add general switchOff

* refactoring of leddevices regarding ledcount and switchoff

* remove obsolete includes
2016-09-23 08:49:22 +02:00

51 lines
1.0 KiB
C++

#pragma once
// STL includes
#include <fstream>
// Leddevice includes
#include <leddevice/LedDevice.h>
///
/// Implementation of the LedDevice that write the led-colors to an
/// ASCII-textfile('/home/pi/LedDevice.out')
///
class LedDeviceFile : public LedDevice
{
public:
///
/// Constructs specific LedDevice
///
/// @param deviceConfig json device config
///
LedDeviceFile(const Json::Value &deviceConfig);
///
/// Destructor of this test-device
///
virtual ~LedDeviceFile();
/// constructs leddevice
static LedDevice* construct(const Json::Value &deviceConfig);
///
/// Sets configuration
///
/// @param deviceConfig the json device config
/// @return true if success
virtual bool setConfig(const Json::Value &deviceConfig);
protected:
///
/// 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);
/// The outputstream
std::ofstream _ofs;
};