// // MetaTable::clearTable // // Removes all objects from a metatable. // void MetaTable::clearTable() { MetaObject *obj = NULL; // iterate on the source table while((obj = tableIterator(obj))) { removeObject(obj); delete obj; obj = NULL; // restart from the beginning } }
// // MetaTable::clearTable // // Removes all objects from a metatable. // void MetaTable::clearTable() { MetaObject *obj = NULL; // iterate on the source table while((obj = tableIterator(NULL))) { removeObject(obj); delete obj; } }
// // MetaTable::copyTableTo // // Adds copies of all objects in the source table to the destination table. // void MetaTable::copyTableTo(MetaTable *dest) const { MetaObject *srcobj = NULL; // iterate on the source table while((srcobj = tableIterator(srcobj))) { // create the new object MetaObject *newObject = srcobj->clone(); // add the new object to the destination table dest->addObject(newObject); } }
// // Adds copies of all objects in the source table to the destination table. // void MetaTable::copyTableTo(MetaTable *dest) const { MetaObject *srcobj = nullptr; // iterate on the source table while((srcobj = tableIterator(srcobj))) { // create the new object MetaObject *newObject = srcobj->clone(); // add the new object to the destination table dest->addObject(newObject); } // since we iterated head to tail above, the items have been added in // reversed order; the only good way to fix this is to have the hash // tables reverse their chains now. dest->pImpl->reverseTables(); }
TableIterator ReportTableBase::end(void) { TableIterator tableIterator(*this); return tableIterator.end(); }
//////////////////////////////////////////////////////////////////////////////// // operations that return an iterator position TableIterator ReportTableBase::begin(void) { TableIterator tableIterator(*this); return tableIterator.begin(); }