UniSet  2.6.0
SMDBServer.h
1 #ifndef _SMDBServer_H_
2 #define _SMDBServer_H_
3 // -----------------------------------------------------------------------------
4 #include "DBServer_MySQL.h"
5 #include "SMInterface.h"
6 #include "SharedMemory.h"
7 // -----------------------------------------------------------------------------
10 class SMDBServer:
11  public DBServer_MySQL
12 {
13  public:
14  SMDBServer( uniset::ObjectId objId, uniset::ObjectId shmID, SharedMemory* ic = 0,
15  const std::string& prefix = "dbserver" );
16  virtual ~SMDBServer();
17 
19  static SMDBServer* init_smdbserver( int argc, const char* const* argv,
20  uniset::ObjectId shmID, SharedMemory* ic = 0,
21  const std::string& prefix = "dbserver" );
22 
24  static void help_print( int argc, const char* const* argv );
25 
26  protected:
27  SMDBServer();
28 
29  virtual void initDB(DBInterface* db);
30  void waitSMReady();
31  void step();
32 
33  SMInterface* shm;
34 
35  private:
36  bool aiignore;
37 
38  PassiveTimer ptHeartBeat;
39  uniset::ObjectId sidHeartBeat;
40  int maxHeartBeat;
41  IOController::IOStateList::iterator aitHeartBeat;
42  uniset::ObjectId test_id;
43 
44  std::string db_locale;
45  std::string prefix;
46 };
47 // -----------------------------------------------------------------------------
48 #endif // _SMDBServer_H_
49 // -----------------------------------------------------------------------------