From 220d58bd7c21381d574fa5155db76be3ff49a9c8 Mon Sep 17 00:00:00 2001 From: sears Date: Tue, 9 Mar 2010 00:14:24 +0000 Subject: [PATCH] DataPage::RecordIterator -> DataPage::iterator git-svn-id: svn+ssh://svn.corp.yahoo.com/yahoo/yrl/labs/pnuts/code/logstore@672 8dad8b1f-cf64-0410-95b6-bcf113ffbcfe --- datapage.cpp | 4 ++-- datapage.h | 8 ++++---- logiterators.h | 2 +- test/check_datapage.cpp | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/datapage.cpp b/datapage.cpp index 2d2696a..df4db61 100644 --- a/datapage.cpp +++ b/datapage.cpp @@ -265,7 +265,7 @@ bool DataPage::append(TUPLE const * dat) template bool DataPage::recordRead(typename TUPLE::key_t key, size_t keySize, TUPLE ** buf) { - RecordIterator itr(this, NULL); + iterator itr(this, NULL); int match = -1; while((*buf=itr.getnext()) != 0) @@ -298,7 +298,7 @@ bool DataPage::recordRead(typename TUPLE::key_t key, size_t keySize, TUP template -TUPLE* DataPage::RecordIterator::getnext() +TUPLE* DataPage::iterator::getnext() { len_t len; bool succ; diff --git a/datapage.h b/datapage.h index 953f518..0d936f9 100644 --- a/datapage.h +++ b/datapage.h @@ -14,7 +14,7 @@ class DataPage { public: - class RecordIterator + class iterator { private: void scan_to_key(TUPLE * key) { @@ -37,11 +37,11 @@ public: } } public: - RecordIterator(DataPage *dp, TUPLE * key=NULL) : read_offset_(0), dp(dp) { + iterator(DataPage *dp, TUPLE * key=NULL) : read_offset_(0), dp(dp) { scan_to_key(key); } - void operator=(const RecordIterator &rhs) + void operator=(const iterator &rhs) { this->read_offset_ = rhs.read_offset_; this->dp = rhs.dp; @@ -188,7 +188,7 @@ public: inline uint16_t recordCount(); - RecordIterator begin(){return RecordIterator(this);} + iterator begin(){return iterator(this);} pageid_t get_start_pid(){return first_page_;} int get_page_count(){return page_count_;} diff --git a/logiterators.h b/logiterators.h index cdcd5ea..0945580 100644 --- a/logiterators.h +++ b/logiterators.h @@ -170,7 +170,7 @@ private: pageid_t curr_pageid; //current page id DataPage *curr_page; //current page - typedef typename DataPage::RecordIterator DPITR_T; + typedef typename DataPage::iterator DPITR_T; DPITR_T *dp_itr; }; diff --git a/test/check_datapage.cpp b/test/check_datapage.cpp index 5ebf90c..b68424b 100644 --- a/test/check_datapage.cpp +++ b/test/check_datapage.cpp @@ -102,7 +102,7 @@ void insertProbeIter(size_t NUM_ENTRIES) for(int i = 0; i < dpages ; i++) { DataPage dp(xid, dsp[i]); - DataPage::RecordIterator itr = dp.begin(); + DataPage::iterator itr = dp.begin(); datatuple *dt=0; while( (dt=itr.getnext()) != NULL) {