Changeset 656

Show
Ignore:
Timestamp:
10/08/06 17:00:19 (2 years ago)
Author:
common
Message:

nepenthes

  • add SQLCallback to SQLHandler, so the handler can inform the callback about the connections status (up & down)
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • nepenthes/trunk/nepenthes-core/include/SQLCallback.hpp

    r594 r656  
    5151                } 
    5252 
     53                virtual void sqlConnected()=0; 
     54                virtual void sqlDisconnected()=0; 
     55 
    5356        protected: 
    5457                string m_SQLCallbackName; 
  • nepenthes/trunk/nepenthes-core/include/SQLHandler.hpp

    r598 r656  
    4040{ 
    4141        class SQLQuery; 
     42        class SQLCallback; 
    4243 
    4344 
     
    7273        protected: 
    7374                string m_SQLHandlerName; 
     75                SQLCallback *m_Callback; 
    7476        }; 
    7577} 
  • nepenthes/trunk/nepenthes-core/include/SQLHandlerFactory.hpp

    r598 r656  
    3939{ 
    4040        class SQLHandler; 
     41        class SQLCallback; 
    4142 
    4243 
     
    5051                } 
    5152 
    52                 virtual SQLHandler *createSQLHandler(string server, string user, string passwd, string table, string options)=0; 
     53                virtual SQLHandler *createSQLHandler(string server, string user, string passwd, string table, string options, SQLCallback *cb)=0; 
    5354                 
    5455        protected: 
  • nepenthes/trunk/nepenthes-core/include/SQLManager.hpp

    r598 r656  
    5858                virtual bool registerSQLHandlerFactory(SQLHandlerFactory * handlerfactory); 
    5959                virtual void unregisterSQLHandlerFactory(const char *dbtype); 
    60                 virtual SQLHandler *createSQLHandler(const char *dbtype, string server, string user, string passwd, string table, string options); 
     60                virtual SQLHandler *createSQLHandler(const char *dbtype, string server, string user, string passwd, string table, string options, SQLCallback *cb); 
    6161 
    6262        private: 
  • nepenthes/trunk/nepenthes-core/src/SQLManager.cpp

    r598 r656  
    8888} 
    8989 
    90 SQLHandler *SQLManager::createSQLHandler(const char *dbtype, string server, string user, string passwd, string table, string options
     90SQLHandler *SQLManager::createSQLHandler(const char *dbtype, string server, string user, string passwd, string table, string options, SQLCallback *cb
    9191{ 
    9292        list <SQLHandlerFactory *>::iterator it; 
     
    9696                if (dbtype == (*it)->getDBType()) 
    9797                { 
    98                         SQLHandler *sqlh =  (*it)->createSQLHandler(server, user,passwd,table,options); 
     98                        SQLHandler *sqlh =  (*it)->createSQLHandler(server, user,passwd,table,options,cb); 
    9999                        if (sqlh->Init() == true) 
    100100                        {