src/storage/source/UserSet.cc
void UserSet::dump(char* buffer) {
    setPinned(true);
    vector<PageIteratorPtr>* iterators = this->getIterators();
    int numIterators = iterators->size();
    int i;
    char* cur = buffer;
    for (i = 0; i < numIterators; i++) {
        PageIteratorPtr curIter = iterators->at(i);
        while (curIter->hasNext()) {
            PDBPagePtr curPage = curIter->next();
            if (curPage != nullptr) {
                memcpy(cur, curPage->getRawBytes(), curPage->getRawSize());
                cur = cur + curPage->getRawSize();
                curPage->decRefCount();
            }
        }
    }
    setPinned(false);
    delete iterators;
}
// user MUST guarantee that the size of buffer is large enough for dumping all data in the set.
user MUST guarantee that the size of buffer is large enough for dumping all data in the set.
user MUST guarantee that the size of buffer is large enough for dumping all data in the set .
void UserSet::dump(char* buffer) {
    setPinned(true);
    vector<PageIteratorPtr>* iterators = this->getIterators();
    int numIterators = iterators->size();
    int i;
    char* cur = buffer;
    for (i = 0; i < numIterators; i++) {
        PageIteratorPtr curIter = iterators->at(i);
        while (curIter->hasNext()) {
            PDBPagePtr curPage = curIter->next();
            if (curPage != nullptr) {
                memcpy(cur, curPage->getRawBytes(), curPage->getRawSize());
                cur = cur + curPage->getRawSize();
                curPage->decRefCount();
            }
        }
    }
    setPinned(false);
    delete iterators;
}
void UserSet :: dump ( char * buffer ) { setPinned ( true ) ; vector < PageIteratorPtr > * iterators = this -> getIterators ( ) ; int numIterators = iterators -> size ( ) ; int i ; char * cur = buffer ; for ( i = 0 ; i < numIterators ; i ++ ) { PageIteratorPtr curIter = iterators -> at ( i ) ; while ( curIter -> hasNext ( ) ) { PDBPagePtr curPage = curIter -> next ( ) ; if ( curPage != nullptr ) { memcpy ( cur , curPage -> getRawBytes ( ) , curPage -> getRawSize ( ) ) ; cur = cur + curPage -> getRawSize ( ) ; curPage -> decRefCount ( ) ; } } } setPinned ( false ) ; delete iterators ; }
user MUST guarantee that the size of buffer is large enough for dumping all data in the set.
user MUST guarantee that the size of buffer is large enough for dumping all data in the set .