hyperion.ng
LedDeviceFile.h
1 #pragma once
2 
3 // STL includes
4 #include <fstream>
5 
6 // Leddevice includes
7 #include <leddevice/LedDevice.h>
8 
13 class LedDeviceFile : public LedDevice
14 {
15 public:
21  LedDeviceFile(const QJsonObject &deviceConfig);
22 
26  virtual ~LedDeviceFile();
27 
29  static LedDevice* construct(const QJsonObject &deviceConfig);
30 
36  virtual bool init(const QJsonObject &deviceConfig);
37 
38 protected:
46  virtual int write(const std::vector<ColorRgb> & ledValues);
47 
49  std::ofstream _ofs;
50 };
Implementation of the LedDevice that write the led-colors to an ASCII-textfile(&#39;/home/pi/LedDevice.out&#39;)
Definition: LedDeviceFile.h:13
Interface (pure virtual base class) for LedDevices.
Definition: LedDevice.h:32
std::ofstream _ofs
The outputstream.
Definition: LedDeviceFile.h:49
virtual bool init(const QJsonObject &deviceConfig)
Sets configuration.
Definition: LedDeviceFile.cpp:18
virtual ~LedDeviceFile()
Destructor of this test-device.
Definition: LedDeviceFile.cpp:9
static LedDevice * construct(const QJsonObject &deviceConfig)
constructs leddevice
Definition: LedDeviceFile.cpp:13
virtual int write(const std::vector< ColorRgb > &ledValues)
Writes the given led-color values to the output stream.
Definition: LedDeviceFile.cpp:34
LedDeviceFile(const QJsonObject &deviceConfig)
Constructs specific LedDevice.
Definition: LedDeviceFile.cpp:3