#pragma once #include "DBBase.h" #include "Element.h" #include "PosXray.h" namespace OTSSQLITE { using namespace OTSDATA; class __declspec(dllexport) CElementChemistryDB { public: CElementChemistryDB(CDBStoreBasePtr a_datastore); ~CElementChemistryDB(); CElementChemistriesList GetElementChemistryListById(const long a_nXrayId, const long a_nFieldId, const long a_nElementSize); BOOL SaveElementChemistriesList(const CPosXrayList& a_xrayPointList); BOOL SaveElementChemistriesList(const CPosXrayPtr a_pxrayPoint); BOOL DeleteElementChemistryById(const long a_nFieldId, const long a_nXrayId); std::map, CPosXrayPtr> ReadPosXrayInfo(OTSSQLITE::CDBQueryBasePtr a_query=nullptr); virtual CDBTableBasePtr GetTableInfo() ; virtual BOOL Init(const BOOL a_bClean = FALSE) ; virtual BOOL CreateTable(const BOOL a_bForce = FALSE) ; virtual BOOL DeleteTable() ; virtual BOOL RemoveAllRows() ; virtual BOOL IsDBExist() ; virtual CDBStoreBasePtr GetDatastore() ; virtual CDBQueryBasePtr GetTableQuery(LPCTSTR a_sOrderColumnName = nullptr) ; protected: CDBQueryBasePtr GetQueryById(const long a_nXrayId, const long a_nFieldId, const long a_nElementId, const long a_nElementNum); protected: CDBTableBasePtr m_tableInfo; CElementChemistriesList m_listElementChemistry; CPosXrayList m_listPosXrayInfo; private: CDBBasePtr myDB; }; typedef std::shared_ptr __declspec(dllexport) CElementChemistryDBPtr; }