hyperion.ng/libsrc/leddevice/LedDeviceFile.h

51 lines
1.0 KiB
C
Raw Normal View History

#pragma once
// STL includes
#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 specific LedDevice
2013-09-09 04:54:13 +02:00
///
/// @param deviceConfig json device config
///
LedDeviceFile(const Json::Value &deviceConfig);
2013-09-09 04:54:13 +02:00
///
/// 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:
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);
2013-09-09 04:54:13 +02:00
/// The outputstream
std::ofstream _ofs;
};