diff --git a/src/TDB2.cpp b/src/TDB2.cpp index 76a478e28..d80d9b452 100644 --- a/src/TDB2.cpp +++ b/src/TDB2.cpp @@ -68,42 +68,10 @@ TDB2::TDB2 () : mLock (true) , mAllOpenAndLocked (false) +, mId (1) { } -//////////////////////////////////////////////////////////////////////////////// -TDB2::TDB2 (const TDB2& other) -{ - throw std::string ("unimplemented TDB2::TDB2"); -// mLocations = other.mLocations; -// mFiles = other.mFiles; -// mLock = other.mLock; -// mAllOpenAndLocked = false; // Deliberately so. -// -// // Set all to NULL, otherwise we are duplicating open file handles. -// foreach (file, mFiles) -// mFiles[file->first] = NULL; -} - -//////////////////////////////////////////////////////////////////////////////// -TDB2& TDB2::operator= (const TDB2& other) -{ - throw std::string ("unimplemented TDB2::operator="); -// if (this != &other) -// { -// mLocations = other.mLocations; -// mFiles = other.mFiles; -// mLock = other.mLock; -// mAllOpenAndLocked = false; // Deliberately so. -// -// // Set all to NULL, otherwise we are duplicating open file handles. -// foreach (file, mFiles) -// mFiles[file->first] = NULL; -// } -// - return *this; -} - //////////////////////////////////////////////////////////////////////////////// TDB2::~TDB2 () { @@ -205,6 +173,8 @@ int TDB2::loadPending (std::vector & tasks, Filter& filter) // TODO Add hidden attribute indicating source? line[length - 1] = '\0'; // Kill \n Task task (line); + task.id (mId++); + if (filter.pass (task)) tasks.push_back (task); } @@ -255,6 +225,8 @@ int TDB2::loadCompleted (std::vector & tasks, Filter& filter) // TODO Add hidden attribute indicating source? line[length - 1] = '\0'; // Kill \n Task task (line); + task.id (mId++); + if (filter.pass (task)) tasks.push_back (task); } diff --git a/src/TDB2.h b/src/TDB2.h index 5e32844c2..2b25da5df 100644 --- a/src/TDB2.h +++ b/src/TDB2.h @@ -40,10 +40,8 @@ class TDB2 { public: - TDB2 (); // Default constructor - TDB2 (const TDB2&); // Copy constructor - TDB2& operator= (const TDB2&); // Assignment operator - ~TDB2 (); // Destructor + TDB2 (); // Default constructor + ~TDB2 (); // Destructor void clear (); void location (const std::string&); @@ -66,6 +64,7 @@ private: std::vector mLocations; bool mLock; bool mAllOpenAndLocked; + int mId; // TODO Need cache of raw file contents to preserve comments. };