57 eErrCode = aSingle.
truncate (nSingle, rBIOS);
71 eErrCode = rBIOS.
free (nAddr);
96 eErrCode = aDouble.
truncate (nDouble, nSingle, rBIOS);
107 if ((nDouble + nSingle) == 0)
110 eErrCode = rBIOS.
free (nAddr);
137 eErrCode = aTriple.
truncate (nTriple, nDouble, nSingle, rBIOS);
142 if ((nTriple + nDouble + nSingle) == 0)
145 eErrCode = rBIOS.
free (nAddr);
189 page const & rPage = *xImpl;
192 sal_uInt16
const nLimit = rPage.capacityCount();
193 if (nSingle >= nLimit)
197 sal_uInt32
const nAddr =
store::ntohl(rPage.m_pData[nSingle]);
215 page const & rPage = *xImpl;
218 sal_uInt16
const nLimit = rPage.capacityCount();
219 if ((nDouble >= nLimit) || (nSingle >= nLimit))
223 sal_uInt32
const nAddr =
store::ntohl(rPage.m_pData[nDouble]);
234 return aSingle.
read (nSingle, rData, rBIOS);
248 page const & rPage = *xImpl;
251 sal_uInt16
const nLimit = rPage.capacityCount();
252 if (!((nTriple < nLimit) && (nDouble < nLimit) && (nSingle < nLimit)))
256 sal_uInt32
const nAddr =
store::ntohl(rPage.m_pData[nTriple]);
267 return aDouble.
read (nDouble, nSingle, rData, rBIOS);
279 page & rPage = *xImpl;
282 sal_uInt16
const nLimit = rPage.capacityCount();
283 if (nSingle >= nLimit)
287 sal_uInt32
const nAddr =
store::ntohl(rPage.m_pData[nSingle]);
318 page & rPage = *xImpl;
321 sal_uInt16
const nLimit = rPage.capacityCount();
322 if ((nDouble >= nLimit) || (nSingle >= nLimit))
340 return aSingle.
write (nSingle, rData, rBIOS);
354 page & rPage = *xImpl;
357 sal_uInt16
const nLimit = rPage.capacityCount();
358 if (!((nTriple < nLimit) && (nDouble < nLimit) && (nSingle < nLimit)))
376 return aDouble.
write (nDouble, nSingle, rData, rBIOS);
387 page & rPage = *xImpl;
390 sal_uInt16
const nLimit = rPage.capacityCount();
391 if (nSingle >= nLimit)
396 for (sal_uInt16
i = nLimit;
i > nSingle;
i--)
403 eErrCode = rBIOS.
free (nAddr);
433 page & rPage = *xImpl;
436 sal_uInt16
const nLimit = rPage.capacityCount();
437 if ((nDouble >= nLimit) || (nSingle >= nLimit))
442 for (sal_uInt16
i = nLimit;
i > nDouble + 1;
i--)
488 page & rPage = *xImpl;
491 sal_uInt16
const nLimit = rPage.capacityCount();
492 if (!((nTriple < nLimit) && (nDouble < nLimit) && (nSingle < nLimit)))
497 for (sal_uInt16
i = nLimit;
i > nTriple + 1;
i--)
515 if ((nDouble + nSingle) == 0)
546 page::DataBlock::LinkDescriptor &rDescr)
const
550 sal_uInt32 index0, index1, index2;
554 sal_uInt32 nLimit =
nCount;
561 rDescr.m_nIndex0 =
static_cast<sal_uInt16
>(index0 & 0xffff);
571 nLimit =
nCount * nCapacity;
575 sal_uInt32
n = nPage;
578 index1 =
n / nCapacity;
579 index0 =
n % nCapacity;
582 n = index1 * nCapacity + index0;
585 SAL_WARN(
"store",
"wrong math on indirect indices");
590 rDescr.m_nIndex0 =
static_cast<sal_uInt16
>(index0 & 0xffff);
591 rDescr.m_nIndex1 =
static_cast<sal_uInt16
>(index1 & 0xffff);
600 nLimit =
nCount * nCapacity * nCapacity;
604 sal_uInt32
n = nPage;
607 index2 =
n / (nCapacity * nCapacity);
608 n =
n % (nCapacity * nCapacity);
611 index1 =
n / nCapacity;
612 index0 =
n % nCapacity;
615 n = index2 * nCapacity * nCapacity +
616 index1 * nCapacity + index0;
619 SAL_WARN(
"store",
"wrong math on double indirect indices");
624 rDescr.m_nIndex0 =
static_cast<sal_uInt16
>(index0 & 0xffff);
625 rDescr.m_nIndex1 =
static_cast<sal_uInt16
>(index1 & 0xffff);
626 rDescr.m_nIndex2 =
static_cast<sal_uInt16
>(index2 & 0xffff);
635 nLimit =
nCount * nCapacity * nCapacity * nCapacity;
639 sal_uInt32
n = nPage;
642 sal_uInt32 index3 =
n / (nCapacity * nCapacity * nCapacity);
643 n =
n % (nCapacity * nCapacity * nCapacity);
646 index2 =
n / (nCapacity * nCapacity);
647 n =
n % (nCapacity * nCapacity);
650 index1 =
n / nCapacity;
651 index0 =
n % nCapacity;
654 n = index3 * nCapacity * nCapacity * nCapacity +
655 index2 * nCapacity * nCapacity +
656 index1 * nCapacity + index0;
659 SAL_WARN(
"store",
"wrong math on triple indirect indices");
664 rDescr.m_nIndex0 =
static_cast<sal_uInt16
>(index0 & 0xffff);
665 rDescr.m_nIndex1 =
static_cast<sal_uInt16
>(index1 & 0xffff);
666 rDescr.m_nIndex2 =
static_cast<sal_uInt16
>(index2 & 0xffff);
667 rDescr.m_nIndex3 =
static_cast<sal_uInt16
>(index3 & 0xffff);
683 page::DataBlock::LinkDescriptor aLink;
689 sal_uInt32
const nAddr =
directLink (aLink.m_nIndex0);
697 sal_uInt32
const nAddr =
singleLink (aLink.m_nIndex1);
706 eErrCode = aSingle.
read (aLink.m_nIndex0, rData, rBIOS);
710 sal_uInt32
const nAddr =
doubleLink (aLink.m_nIndex2);
719 eErrCode = aDouble.
read (aLink.m_nIndex1, aLink.m_nIndex0, rData, rBIOS);
723 sal_uInt32
const nAddr =
tripleLink (aLink.m_nIndex3);
732 eErrCode = aTriple.
read (aLink.m_nIndex2, aLink.m_nIndex1, aLink.m_nIndex0, rData, rBIOS);
742 SAL_WARN(
"store",
"OStoreDirectoryPageObject::get(): scope failed");
756 page::DataBlock::LinkDescriptor aLink;
762 sal_uInt32
const nAddr =
directLink (aLink.m_nIndex0);
790 eErrCode = aSingle.
write (aLink.m_nIndex0, rData, rBIOS);
803 eErrCode = aDouble.
write (aLink.m_nIndex1, aLink.m_nIndex0, rData, rBIOS);
816 eErrCode = aTriple.
write (aLink.m_nIndex2, aLink.m_nIndex1, aLink.m_nIndex0, rData, rBIOS);
826 SAL_WARN(
"store",
"OStoreDirectoryPageObject::put(): scope failed");
839 page::DataBlock::LinkDescriptor aLink;
861 eErrCode =
truncate (eScope, aLink.m_nIndex0, rBIOS);
876 eErrCode =
truncate (eScope, aLink.m_nIndex1 + 1, rBIOS);
886 if (aLink.m_nIndex0 == 0)
900 eErrCode =
truncate (eScope, aLink.m_nIndex2 + 1, rBIOS);
906 doubleLink (aLink.m_nIndex2), aLink.m_nIndex1, aLink.m_nIndex0, rBIOS);
911 if ((aLink.m_nIndex1 + aLink.m_nIndex0) == 0)
920 eErrCode =
truncate (eScope, aLink.m_nIndex3 + 1, rBIOS);
926 tripleLink (aLink.m_nIndex3), aLink.m_nIndex2, aLink.m_nIndex1, aLink.m_nIndex0, rBIOS);
931 if ((aLink.m_nIndex2 + aLink.m_nIndex1 + aLink.m_nIndex0) == 0)
945 SAL_WARN(
"store",
"OStoreDirectoryPageObject::put(): scope failed");
957 page::ChunkScope eScope,
973 eErrCode = rBIOS.
free (nAddr);
virtual storeError verify(sal_uInt32 nAddr) const override
page::ChunkScope scope(sal_uInt32 nPage, page::DataBlock::LinkDescriptor &rDescr) const
scope (external data page; private).
virtual storeError guard(sal_uInt32 nAddr) override
External representation.
storeError write(sal_uInt32 nPage, OStoreDataPageObject &rData, OStorePageBIOS &rBIOS)
write (external data page).
sal_uInt32 singleLink(sal_uInt16 nIndex) const
single indirect.
page & PAGE()
Representation.
virtual storeError verify(sal_uInt32 nAddr) const override
storeError read(sal_uInt32 nPage, OStoreDataPageObject &rData, OStorePageBIOS &rBIOS) const
read (external data page).
sal_uInt32 tripleLink(sal_uInt16 nIndex) const
triple indirect.
sal_uInt32 directLink(sal_uInt16 nIndex) const
direct.
storeError truncate(sal_uInt32 nPage, OStorePageBIOS &rBIOS)
truncate (external data page).
sal_uInt32 doubleLink(sal_uInt16 nIndex) const
double indirect.
storeError truncate(sal_uInt16 nSingle, OStorePageBIOS &rBIOS)
truncate (indirect data page).
virtual storeError guard(sal_uInt32 nAddr) override
virtual storeError verify(sal_uInt32 nAddr) const override
storeError loadOrCreate(sal_uInt32 nAddr, OStorePageBIOS &rBIOS)
External representation.
storeError read(sal_uInt16 nSingle, OStoreDataPageObject &rData, OStorePageBIOS &rBIOS) const
read (indirect data page).
storeError write(sal_uInt16 nSingle, OStoreDataPageObject &rData, OStorePageBIOS &rBIOS)
write (indirect data page).
rtl::Reference< PageData::Allocator > & allocator()
storeError saveObjectAt(OStorePageObject &rPage, sal_uInt32 nAddr)
storeError loadObjectAt(OStorePageObject &rPage, sal_uInt32 nAddr)
Page I/O.
storeError free(sal_uInt32 nAddr)
storeError allocate(OStorePageObject &rPage)
sal_uInt32 location() const
Location.
std::shared_ptr< PageData > m_xPage
Representation.
static storeError verify(std::shared_ptr< PageData > const &rxPage, sal_uInt32 nAddr)
static storeError guard(std::shared_ptr< PageData > const &rxPage, sal_uInt32 nAddr)
#define SAL_WARN(area, stream)
Old OStorePageCache implementation.
sal_uInt32 htonl(sal_uInt32 h)
sal_uInt32 ntohl(sal_uInt32 n)
static storeError store_truncate_Impl(sal_uInt32 nAddr, sal_uInt16 nSingle, OStorePageBIOS &rBIOS)
store_truncate_Impl (single indirect page).
static const sal_uInt16 singleCount
single.
static const sal_uInt16 directCount
direct.
static const sal_uInt16 tripleCount
triple.
static const sal_uInt16 doubleCount
double.
sal_uInt16 capacityCount() const
storeError
Error Code enumeration.
@ store_E_InvalidChecksum