24#include <rtl/string.h>
25#include <osl/mutex.hxx>
35const sal_uInt32 OStorePageManager::m_nTypeId = sal_uInt32(0x62190120);
37OStorePageManager::OStorePageManager()
57 sal_uInt16 & rnPageSize)
60 osl::MutexGuard aGuard(*
this);
87 xRoot->insert (0,
entry(aKey));
113 SAL_WARN_IF(rIndex >= xPage->usageCount(),
"store",
"store::PageManager::find_lookup(): logic error");
114 entry e (xPage->m_pData[rIndex]);
144 sal_uInt16
i = xPage->find (rEntry),
n = xPage->usageCount();
158 sal_uInt32
const nAddr = xPage->m_pData[
i].m_aLink.location();
174 i = xPage->find (rEntry);
175 n = xPage->usageCount();
189 "OStorePageManager::remove(): find failed");
199 return aNode.
remove (
i, rEntry, *
this);
207 const rtl_String *pPath,
const rtl_String *pName,
OStorePageKey &rKey)
210 if (!(pPath &&
pName))
232 const rtl_String * pPath,
233 const rtl_String * pName,
237 osl::MutexGuard aGuard(*
this);
299 memcpy (&aDstKey, &(xPage->
m_pData[0]),
sizeof(aDstKey));
319 sal_uInt32 & rAttrib)
322 osl::MutexGuard aGuard(*
this);
337 entry e (xNode->m_pData[
i]);
365 entry e (xNode->m_pData[
i]);
389 entry e (xNode->m_pData[
i]);
402 xNode->m_pData[
i].m_aLink = rPage.
location();
415 xNode->insert (
i + 1,
entry (rKey, aLink));
428 osl::MutexGuard aGuard(*
this);
446 entry e (xNodePage->m_pData[
i]);
473 eErrCode = aPage.
truncate (0, *
this);
storeError remove(sal_uInt16 nIndexL, OStoreBTreeEntry &rEntryL, OStorePageBIOS &rBIOS)
remove (down to leaf node, recursive).
storeError loadOrCreate(sal_uInt32 nAddr, OStorePageBIOS &rBIOS)
storeError find_lookup(OStoreBTreeNodeObject &rNode, sal_uInt16 &rIndex, OStorePageKey const &rKey, OStorePageBIOS &rBIOS) const
find_lookup (w/o split()).
storeError find_insert(OStoreBTreeNodeObject &rNode, sal_uInt16 &rIndex, OStorePageKey const &rKey, OStorePageBIOS &rBIOS)
find_insert (possibly with split()).
sal_uInt32 attrib() const
attrib.
void key(OStorePageKey const &rKey)
key.
sal_uInt32 dataLength() const
dataLength.
storeError truncate(sal_uInt32 nPage, OStorePageBIOS &rBIOS)
truncate (external data page).
storeError acquirePage(const OStorePageDescriptor &rDescr, storeAccessMode eMode)
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)
storeError releasePage(const OStorePageDescriptor &rDescr)
virtual storeError initialize(ILockBytes *pLockBytes, storeAccessMode eAccessMode, sal_uInt16 &rnPageSize)
Initialization.
OStoreBTreeRootObject m_aRoot
Representation.
bool isValid() const
isValid.
storeError remove(const OStorePageKey &rKey)
remove.
storeError iterate(OStorePageKey &rKey, OStorePageLink &rLink, sal_uInt32 &rAttrib)
virtual storeError initialize(ILockBytes *pLockBytes, storeAccessMode eAccessMode, sal_uInt16 &rnPageSize) override
Initialization (two-phase construction).
static const sal_uInt32 m_nTypeId
IStoreHandle TypeId.
virtual bool isKindOf(sal_uInt32 nTypeId) override
IStoreHandle.
storeError load_dirpage_Impl(const OStorePageKey &rKey, OStoreDirectoryPageObject &rPage)
DirectoryPage I/O (managed).
storeError remove_Impl(entry &rEntry)
remove (possibly down from root).
virtual ~OStorePageManager() override
static storeError namei(const rtl_String *pPath, const rtl_String *pName, OStorePageKey &rKey)
DirectoryPage I/O (managed).
storeError save_dirpage_Impl(const OStorePageKey &rKey, OStoreDirectoryPageObject &rPage)
storeError iget(OStoreDirectoryPageObject &rPage, sal_uInt32 nAttrib, const rtl_String *pPath, const rtl_String *pName, storeAccessMode eMode)
storeError find_lookup(OStoreBTreeNodeObject &rNode, sal_uInt16 &rIndex, OStorePageKey const &rKey)
find_lookup (node page and index, w/o split).
storeError construct(rtl::Reference< PageData::Allocator > const &rxAllocator)
sal_uInt32 location() const
Location.
std::shared_ptr< PageData > & get()
void swap(PageHolderObject< T > &rhs)
#define SAL_WARN_IF(condition, area, stream)
Old OStorePageCache implementation.
sal_uInt32 htonl(sal_uInt32 h)
sal_uInt32 ntohl(sal_uInt32 n)
CompareResult compare(const OStoreBTreeEntry &rOther) const
sal_uInt16 capacity() const
capacity.
NameBlock m_aNameBlock
Representation.
ChunkScope scope(sal_uInt32 nPosition) const
scope (internal).
sal_uInt32 m_nLow
Representation.
sal_uInt32 location() const
Operation.
char m_pData[STORE_MAXIMUM_NAMESIZE]
constexpr sal_uInt32 STORE_ATTRIB_ISDIR
storeAccessMode
Access Mode enumeration.
storeError
Error Code enumeration.
@ store_E_InvalidParameter
@ store_E_AccessViolation
constexpr sal_uInt32 STORE_ATTRIB_ISLINK
Attributes (predefined).
constexpr auto STORE_MAXIMUM_NAMESIZE
NameSize (enforced) limit.