OTSSTDLibFileMgr.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #pragma once
  2. #include "afx.h"
  3. #include "DBStoreFile.h"
  4. #include "OTSSTDLibDB.h"
  5. #include "ParticleEngine/ParticleSTD.h"
  6. #include "ParticleEngine/ParticleSTDDB.h"
  7. #include "ParticleEngine/ConstantsDataDb.h"
  8. #include "ParticleEngine/ZeroElementRulesDataDB.h"
  9. #include "ParticleEngine/MaxEDSRulesDataDB.h"
  10. using namespace OTSSQLITE;
  11. namespace OTSClassifyEngine
  12. {
  13. class __declspec(dllexport) CSTDLibFileMgr : public CDBStoreFile
  14. {
  15. public:
  16. CSTDLibFileMgr(std::string fileName);
  17. virtual ~CSTDLibFileMgr();
  18. virtual void Close() override
  19. {
  20. m_datastorePtr.reset();
  21. }
  22. BOOL CreateSTDLibFile();
  23. CSTDLibPtr GetSTDLib(BOOL bForce = FALSE);
  24. // Load/Save
  25. BOOL Load(CSTDLibPtr& lib, BOOL bClear = TRUE);
  26. BOOL LoadPartSTD(ParticleSTDPtr lib, BOOL bClear = TRUE);
  27. BOOL LoadZeroElementRulesData(ParticleSTDPtr lib, BOOL bClear = TRUE);
  28. BOOL LoadMaxEDSRulesData(ParticleSTDPtr lib, BOOL bClear = TRUE);
  29. std::string LoadConstantsData(BOOL bClear = TRUE);
  30. protected:
  31. void Init();
  32. void Cleanup();
  33. //Get DB
  34. CSTDLibDBPtr GetSTDLibDB();
  35. CParticleSTDDBPtr GetParticleSTDDB();
  36. CConstantsDataDbPtr GetConstantsDataDb();
  37. CMaxEDSRulesDataDBPtr GetMaxEDSRulesDataDB();
  38. CZeroElementRulesDataDBPtr GetZeroElementRulesDataDB();
  39. protected:
  40. // file pathname
  41. CString m_strPathName;
  42. CSTDLibDBPtr m_pSTDLibDB;
  43. CParticleSTDDBPtr m_pParticleSTDDB;
  44. CZeroElementRulesDataDBPtr m_pZeroElementRulesDataDB;
  45. CMaxEDSRulesDataDBPtr m_pMaxEDSRulesDataDB;
  46. CConstantsDataDbPtr m_pConstantsDataDb;
  47. };
  48. typedef std::shared_ptr<CSTDLibFileMgr> CSTDLibFileMgrPtr;
  49. }