ClassFlowInfluxDBv2.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #pragma once
  2. #ifndef CLASSFINFLUXDBv2_H
  3. #define CLASSFINFLUXDBv2_H
  4. #include <string>
  5. #include "ClassFlow.h"
  6. #include "ClassFlowPostProcessing.h"
  7. #include "interface_influxdb.h"
  8. typedef struct
  9. {
  10. bool enabled;
  11. std::string uri;
  12. std::string bucket;
  13. std::string dborg;
  14. std::string dbtoken;
  15. std::string dbfield;
  16. std::string oldValue;
  17. } influxDBv2_controll_config_t;
  18. extern influxDBv2_controll_config_t influxDBv2_controll_config;
  19. class ClassFlowInfluxDBv2 : public ClassFlow
  20. {
  21. protected:
  22. InfluxDB influxDB;
  23. ClassFlowPostProcessing *flowpostprocessing;
  24. void SetInitialParameter(void);
  25. void handleFieldname(std::string _decsep, std::string _value);
  26. void handleMeasurement(std::string _decsep, std::string _value);
  27. public:
  28. ClassFlowInfluxDBv2();
  29. ClassFlowInfluxDBv2(std::vector<ClassFlow *> *lfc);
  30. ClassFlowInfluxDBv2(std::vector<ClassFlow *> *lfc, ClassFlow *_prev);
  31. bool ReadParameter(FILE *pFile, std::string &aktparamgraph);
  32. bool doFlow(std::string temp_time);
  33. std::string name() { return "ClassFlowInfluxDBv2"; };
  34. };
  35. #endif // CLASSFINFLUXDBv2_H