ElementChemistryDB.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. BOOL SaveElementChemistriesList(const CPosXraysList& a_xrayPointList);
  15. BOOL SaveElementChemistriesList(const CPosXrayPtr a_pxrayPoint);
  16. BOOL DeleteElementChemistryById(const long a_nFieldId, const long a_nXrayId);
  17. std::map<std::vector<int>, CPosXrayPtr> ReadPosXrayInfo(OTSSQLITE::CDBQueryBasePtr a_query=nullptr);
  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. CDBQueryBasePtr GetQueryById(const long a_nXrayId, const long a_nFieldId, const long a_nElementId, const long a_nElementNum);
  28. protected:
  29. CDBTableBasePtr m_tableInfo;
  30. CElementChemistriesList m_listElementChemistry;
  31. CPosXrayInfoList m_listPosXrayInfo;
  32. private:
  33. CDBBasePtr myDB;
  34. };
  35. typedef std::shared_ptr<CElementChemistryDB> __declspec(dllexport) CElementChemistryDBPtr;
  36. }