BatchManager.h 886 B

1234567891011121314151617181920212223242526272829
  1. #pragma once
  2. #include <boost/smart_ptr.hpp>
  3. #include "../sqlite/CppSQLite3.h"
  4. class CBatch;
  5. class CBatchManager
  6. {
  7. template<class T> friend class boost::shared_ptr;
  8. template<class T> friend inline void boost::checked_delete(T *);
  9. public:
  10. static boost::shared_ptr<CBatchManager> Get();
  11. public:
  12. void initalize(bool bOnlineCard, int subjectid, int nOnlineScanType);
  13. boost::shared_ptr<CBatch>& createNewBatch();
  14. boost::shared_ptr<CBatch>& GetCurrentBatch();
  15. int GiveUpCurrentBatch();
  16. int leaveCurrentBatch();
  17. private:
  18. CBatchManager();
  19. ~CBatchManager();
  20. private:
  21. boost::shared_ptr<CBatch> currentBatch;
  22. CppSQLite3DB database_db;
  23. RTL_CRITICAL_SECTION database_db_lock;
  24. bool m_bOnlineCard; // ê?·?ê??ú??′eìa?¨?£ê?
  25. int m_nSubjectID;
  26. int m_nOnlineScanType; //参数说明:-1 代表原理的在线答题卡扫描 0:代表英语魔法词汇宝扫描
  27. };