ElementChemistryDB.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #pragma once
  2. #include "DBBase.h"
  3. #include "Element.h"
  4. #include "PosXray.h"
  5. namespace OTSSQLITE
  6. {
  7. using namespace OTSDATA;
  8. class __declspec(dllexport) CElementChemistryDB
  9. {
  10. public:
  11. CElementChemistryDB(CDBStoreBasePtr a_datastore);
  12. ~CElementChemistryDB();
  13. CElementChemistriesList GetElementChemistryListById(const long a_nXrayId, const long a_nFieldId, const long a_nElementSize);
  14. CPosXrayInfoList& GetXrayInfoList(const BOOL a_bForce = FALSE);
  15. BOOL SaveElementChemistriesList(const CPosXraysList& a_xrayPointList);
  16. BOOL SaveElementChemistriesList(const CPosXrayPtr a_pxrayPoint);
  17. BOOL DeleteElementChemistryById(const long a_nFieldId, const long a_nXrayId);
  18. virtual CDBTableBasePtr GetTableInfo() ;
  19. virtual BOOL Init(const BOOL a_bClean = FALSE) ;
  20. virtual BOOL CreateTable(const BOOL a_bForce = FALSE) ;
  21. virtual BOOL DeleteTable() ;
  22. virtual BOOL RemoveAllRows() ;
  23. virtual BOOL IsDBExist() ;
  24. virtual CDBStoreBasePtr GetDatastore() ;
  25. virtual CDBQueryBasePtr GetTableQuery(LPCTSTR a_sOrderColumnName = nullptr) ;
  26. protected:
  27. BOOL ReadXrayPointInfoList();
  28. CPosXrayInfoList ReadXrayPointInfoList(CDBQueryBasePtr a_query);
  29. CPosXrayInfoPtr ReadPosXrayInfo(CDBQueryBasePtr a_query);
  30. CDBQueryBasePtr GetQueryById(const long a_nXrayId, const long a_nFieldId, const long a_nElementId, const long a_nElementNum);
  31. protected:
  32. CDBTableBasePtr m_tableInfo;
  33. CElementChemistriesList m_listElementChemistry;
  34. CPosXrayInfoList m_listPosXrayInfo;
  35. private:
  36. CDBBasePtr myDB;
  37. };
  38. typedef std::shared_ptr<CElementChemistryDB> __declspec(dllexport) CElementChemistryDBPtr;
  39. }