BeeeOn Gateway  v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
NamedPipeExporter.h
1 #pragma once
2 
3 #include <string>
4 #include <Poco/Logger.h>
5 
6 #include "core/Exporter.h"
7 #include "util/Loggable.h"
8 
9 namespace BeeeOn {
10 
11 class SensorDataFormatter;
12 
14  public Exporter,
15  public Loggable {
16 public:
19 
23  bool ship(const SensorData &data) override;
24 
28  void setFilePath(const std::string &path);
29 
34  void setFormatter(SensorDataFormatter * formatter);
35 
36 private:
42  int openPipe();
43 
49  bool writeAndClose(int fd, const std::string &msg);
50 
51  std::string m_pipePath;
52  SensorDataFormatter *m_formatter;
53 };
54 
55 }
Definition: SensorData.h:20
void setFilePath(const std::string &path)
Definition: NamedPipeExporter.cpp:58
Definition: Exporter.h:11
void setFormatter(SensorDataFormatter *formatter)
Definition: NamedPipeExporter.cpp:63
bool ship(const SensorData &data) override
Definition: NamedPipeExporter.cpp:38
Definition: Loggable.h:19
Definition: SensorDataFormatter.h:11
Definition: NamedPipeExporter.h:13