darker
2025-02-11 23a50ec03beb2a4d99cc89766256a053d1d19727
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef SECS_RUNTIME_MANAGER_H
#define SECS_RUNTIME_MANAGER_H
 
#include <string>
#include <vector>
#include <mutex>
#include "Database.h"
 
class SECSRuntimeManager {
public:
    /**
     * »ñÈ¡µ¥ÀýʵÀý
     * @return SECSRuntimeManagerʵÀýµÄÒýÓÃ
     */
    static SECSRuntimeManager& getInstance();
 
    /**
     * ÉèÖÃÊý¾Ý¿âÁ¬½Ó
     * @param db Êý¾Ý¿âÁ¬½ÓµÄÖ¸Õë
     */
    void setDatabase(BL::Database* db);
 
    /**
     * ³õʼ»¯SECSÔËÐÐÉèÖùÜÀí¿â
     * @return ³É¹¦·µ»Øtrue£¬Ê§°Ü·µ»Øfalse
     */
    bool initRuntimeSetting();
 
    /**
    * Ïú»ÙSECSÔËÐÐÉèÖùÜÀí¿â
    */
    void termRuntimeSetting();
 
private:
    SECSRuntimeManager();
    ~SECSRuntimeManager();
 
    // ½ûÖ¹¿½±´ºÍ¸³Öµ
    SECSRuntimeManager(const SECSRuntimeManager&) = delete;
    SECSRuntimeManager& operator=(const SECSRuntimeManager&) = delete;
 
    BL::Database* m_pDB;
    static std::mutex m_mutex;
};
 
#endif // SECS_RUNTIME_MANAGER_H