#ifndef __CopyRows_h_ #define __CopyRows_h_ #include "../shared/ThreadClass.h" #include "../shared/Messages.h" #include "../shared/DatabaseWithRetry.h" class CopyRows : private ThreadClass { private: // This isn't very interesting at this time. However, we plan to add some // external controls. If nothing else, someone should be able to sit at // the debug console and tell the copy process to skip ahead some. enum { mtSetLastId, mtQuit }; RequestQueue _incoming; const std::string _realDatabase; const std::string _tableName; const std::string _destinationName; const std::string _readScriptName; DatabaseWithRetry _source; DatabaseWithRetry _destination; DatabaseWithRetry *_monitor; int64_t _lastId; time_t _nextLogReportTime; time_t _nextDatabaseReportTime; CopyRows(std::string const &tableName, std::string const &destinationName); void findLastId(); void checkForCopy(); void checkForDatabaseReport(); protected: void threadFunction(); public: // Look in the config file and get the list of dest names and create a new // thread for each of them. Since this class reads so many other things // from the config file, including the name of the source database, it didn't // make sense for the main program to have to read in that one item. static void startAll(); // Probably never used. Copied from a standard one just for completeness. ~CopyRows(); }; #endif