UniSet  1.4.0
SMDBServer.h
00001 #ifndef _SMDBServer_H_
00002 #define _SMDBServer_H_
00003 // -----------------------------------------------------------------------------
00004 #include "DBServer_MySQL.h"
00005 #include "SMInterface.h"
00006 #include "SharedMemory.h"
00007 // -----------------------------------------------------------------------------
00010 class SMDBServer:
00011     public DBServer_MySQL
00012 {
00013     public:
00014         SMDBServer( UniSetTypes::ObjectId objId, UniSetTypes::ObjectId shmID, SharedMemory* ic=0,
00015                     const std::string prefix="dbserver" );
00016         virtual ~SMDBServer();
00017     
00019         static SMDBServer* init_smdbserver( int argc, const char* const* argv, 
00020                             UniSetTypes::ObjectId shmID, SharedMemory* ic=0,
00021                             const std::string prefix="dbserver" );
00022 
00024         static void help_print( int argc, const char* const* argv );
00025 
00026     protected:
00027         SMDBServer();
00028 
00029         virtual void initDB(DBInterface *db);
00030         void waitSMReady();
00031         void step();
00032 
00033         SMInterface* shm;
00034 
00035     private:
00036         bool aiignore;
00037 
00038         PassiveTimer ptHeartBeat;
00039         UniSetTypes::ObjectId sidHeartBeat;
00040         int maxHeartBeat;
00041         IOController::AIOStateList::iterator aitHeartBeat;
00042         UniSetTypes::ObjectId test_id;
00043 
00044         std::string db_locale;
00045         std::string prefix;
00046 };
00047 // -----------------------------------------------------------------------------
00048 #endif // _SMDBServer_H_
00049 // -----------------------------------------------------------------------------