AlgorithmDB.h 886 B

12345678910111213141516171819202122232425262728293031323334
  1. #pragma once
  2. #include <string>
  3. #include <iostream>
  4. #include <vector>
  5. #include <memepp/native.hpp>
  6. class AlgorithmDB
  7. {
  8. public:
  9. struct Record {
  10. std::string strAlgorithmId;
  11. std::string strEquipId;
  12. std::string strThresholdFormula;
  13. std::string strNewThresholdFormula;
  14. std::vector<std::string> collectPointVec;//存储当前算是中的采集点号,为了是方便后面转换成测点号
  15. };
  16. public:
  17. AlgorithmDB() {};
  18. ~AlgorithmDB() {};
  19. void InitAlgorithmDB(memepp::native_string& folderPath);
  20. void AddRecord(const Record& record);
  21. std::vector<Record> GetAllRecords();
  22. void DeleteRecord(const std::string& algorithmId);
  23. std::vector<Record> SearchRecord(const std::string& name);
  24. void UpdateRecord(const std::string& algorithmId, const Record& newRecord);
  25. private:
  26. std::string m_filename;
  27. std::string m_filename_tmp;
  28. };