00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include "fennel/common/CommonPreamble.h"
00025 #include "fennel/segment/DelegatingSegment.h"
00026
00027 FENNEL_BEGIN_CPPFILE("$Id: //open/dev/fennel/segment/DelegatingSegment.cpp#12 $");
00028
00029 DelegatingSegment::DelegatingSegment(
00030 SharedSegment pDelegateSegmentInit)
00031 : Segment(pDelegateSegmentInit->getCache()),
00032 pDelegateSegment(pDelegateSegmentInit)
00033 {
00034 setUsablePageSize(pDelegateSegment->getUsablePageSize());
00035 }
00036
00037 DelegatingSegment::~DelegatingSegment()
00038 {
00039 }
00040
00041 void DelegatingSegment::closeImpl()
00042 {
00043 Segment::closeImpl();
00044 pDelegateSegment.reset();
00045 }
00046
00047 BlockNum DelegatingSegment::getAllocatedSizeInPages()
00048 {
00049 return pDelegateSegment->getAllocatedSizeInPages();
00050 }
00051
00052 BlockNum DelegatingSegment::getNumPagesOccupiedHighWater()
00053 {
00054 return pDelegateSegment->getNumPagesOccupiedHighWater();
00055 }
00056
00057 BlockNum DelegatingSegment::getNumPagesExtended()
00058 {
00059 return pDelegateSegment->getNumPagesExtended();
00060 }
00061
00062 PageId DelegatingSegment::getPageSuccessor(PageId pageId)
00063 {
00064 return pDelegateSegment->getPageSuccessor(pageId);
00065 }
00066
00067 void DelegatingSegment::setPageSuccessor(PageId pageId, PageId successorId)
00068 {
00069 pDelegateSegment->setPageSuccessor(pageId,successorId);
00070 }
00071
00072 BlockId DelegatingSegment::translatePageId(PageId pageId)
00073 {
00074 return pDelegateSegment->translatePageId(pageId);
00075 }
00076
00077 PageId DelegatingSegment::translateBlockId(BlockId blockId)
00078 {
00079 return pDelegateSegment->translateBlockId(blockId);
00080 }
00081
00082 PageId DelegatingSegment::allocatePageId(PageOwnerId ownerId)
00083 {
00084 return pDelegateSegment->allocatePageId(ownerId);
00085 }
00086
00087 bool DelegatingSegment::ensureAllocatedSize(BlockNum nPages)
00088 {
00089 return pDelegateSegment->ensureAllocatedSize(nPages);
00090 }
00091
00092 void DelegatingSegment::deallocatePageRange(PageId startPageId,PageId endPageId)
00093 {
00094 pDelegateSegment->deallocatePageRange(startPageId,endPageId);
00095 }
00096
00097 bool DelegatingSegment::isPageIdAllocated(PageId pageId)
00098 {
00099 return pDelegateSegment->isPageIdAllocated(pageId);
00100 }
00101
00102 Segment::AllocationOrder DelegatingSegment::getAllocationOrder() const
00103 {
00104 return pDelegateSegment->getAllocationOrder();
00105 }
00106
00107 void DelegatingSegment::notifyPageMap(CachePage &page)
00108 {
00109 pDelegateSegment->notifyPageMap(page);
00110 }
00111
00112 void DelegatingSegment::notifyPageUnmap(CachePage &page)
00113 {
00114 pDelegateSegment->notifyPageUnmap(page);
00115 }
00116
00117 void DelegatingSegment::notifyAfterPageRead(CachePage &page)
00118 {
00119 pDelegateSegment->notifyAfterPageRead(page);
00120 }
00121
00122 void DelegatingSegment::notifyPageDirty(CachePage &page,bool bDataValid)
00123 {
00124 pDelegateSegment->notifyPageDirty(page,bDataValid);
00125 }
00126
00127 void DelegatingSegment::notifyBeforePageFlush(CachePage &page)
00128 {
00129 pDelegateSegment->notifyBeforePageFlush(page);
00130 }
00131
00132 void DelegatingSegment::notifyAfterPageFlush(CachePage &page)
00133 {
00134 pDelegateSegment->notifyAfterPageFlush(page);
00135 }
00136
00137 bool DelegatingSegment::canFlushPage(CachePage &page)
00138 {
00139 return pDelegateSegment->canFlushPage(page);
00140 }
00141
00142 void DelegatingSegment::delegatedCheckpoint(
00143 Segment &delegatingSegment,CheckpointType checkpointType)
00144 {
00145 pDelegateSegment->delegatedCheckpoint(delegatingSegment,checkpointType);
00146 }
00147
00148 PageId DelegatingSegment::updatePage(PageId pageId, bool needsTranslation)
00149 {
00150 return pDelegateSegment->updatePage(pageId, needsTranslation);
00151 }
00152
00153 FENNEL_END_CPPFILE("$Id: //open/dev/fennel/segment/DelegatingSegment.cpp#12 $");
00154
00155