| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- #pragma once
- #include "DBBase.h"
- #include "OTSParticle.h"
- #include "OTSSegment.h"
- namespace OTSSQLITE
- {
- using namespace OTSDATA;
- using namespace OTSSQLITE;
- class __declspec(dllexport) CSegmentDB : public CDBBase
- {
- public:
- CSegmentDB(CDBStoreBasePtr a_datastore);
- ~CSegmentDB();
- COTSFeaturePtr GetFeatureById(const long a_nXrayId, const long a_nFieldId, const long a_nSegmentSize);
- COTSParticleList& GetParticleInfoList(const BOOL a_bForce = FALSE);
- BOOL SaveFeature(const COTSParticleList& a_ParticleList);
- BOOL SaveFeature(const COTSParticlePtr a_pParticle);
- BOOL DeleteFeatureById(const long a_nFieldId, const long a_nXrayId);
- virtual CDBTableBasePtr GetTableInfo() override;
- bool GetAllSegmentsRecord(std::map < std::vector <int>, COTSSegmentsList>& mapSegments);
- virtual BOOL Init(const BOOL a_bClean = FALSE) override;
- virtual BOOL CreateTable(const BOOL a_bForce = FALSE) override;
- virtual BOOL DeleteTable() override;
- virtual BOOL RemoveAllRows() override;
- virtual BOOL IsDBExist() override;
- virtual CDBStoreBasePtr GetDatastore() override;
- virtual CDBQueryBasePtr GetTableQuery(LPCTSTR a_sOrderColumnName = nullptr) override;
- protected:
- BOOL ReadParticleInfoList();
- COTSParticleList ReadParticleInfoList(CDBQueryBasePtr a_query);
- COTSParticlePtr ReadParticleInfo(CDBQueryBasePtr a_query);
- CDBQueryBasePtr GetQueryById(const long a_nXrayId, const long a_nFieldId, const long a_nSegmentId, const long a_nSegmentNum);
- CDBQueryBasePtr GetQueryOfAllRecord();
- protected:
- CDBTableBasePtr m_tableInfo;
- COTSFeaturePtr m_pFeature;
- COTSParticleList m_listParticle;
- private:
- CDBBasePtr myDB;
- };
- typedef std::shared_ptr<CSegmentDB> __declspec(dllexport) CSegmentDBPtr;
- }
|