LibreOffice Module store (master) 1
storpage.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#pragma once
21
22#include <sal/types.h>
23#include <rtl/string.h>
24
25#include "object.hxx"
26
27#include "storbase.hxx"
28#include "storbios.hxx"
29#include "stortree.hxx"
30
31namespace store
32{
33
34class ILockBytes;
35struct OStoreDirectoryPageData;
36class OStoreDirectoryPageObject;
37
39{
40public:
42
45 virtual storeError initialize (
46 ILockBytes * pLockBytes,
47 storeAccessMode eAccessMode,
48 sal_uInt16 & rnPageSize) override;
49
54 inline bool isValid() const;
55
59 static storeError namei (
60 const rtl_String *pPath,
61 const rtl_String *pName,
62 OStorePageKey &rKey);
63
65 OStoreDirectoryPageObject & rPage, // [out]
66 sal_uInt32 nAttrib,
67 const rtl_String * pPath,
68 const rtl_String * pName,
70
72 OStorePageKey & rKey,
73 OStorePageLink & rLink,
74 sal_uInt32 & rAttrib);
75
80 const OStorePageKey &rKey);
81
84 virtual bool isKindOf (sal_uInt32 nTypeId) override;
85
86protected:
87 virtual ~OStorePageManager() override;
88
89private:
92
96
99
102 static const sal_uInt32 m_nTypeId;
103
106 friend OStorePageManager*
107 SAL_CALL query<> (OStoreObject *pHandle, OStorePageManager*);
108
112
116 const OStorePageKey &rKey,
118
120 const OStorePageKey &rKey,
122
126 OStoreBTreeNodeObject & rNode,
127 sal_uInt16 & rIndex,
128 OStorePageKey const & rKey);
129
132 storeError remove_Impl (entry & rEntry);
133
136};
137
138inline bool OStorePageManager::isValid() const
139{
140 return base::isValid();
141}
142
143template<> inline OStorePageManager*
144SAL_CALL query (OStoreObject *pHandle, SAL_UNUSED_PARAMETER OStorePageManager*)
145{
146 if (pHandle && pHandle->isKindOf (OStorePageManager::m_nTypeId))
147 {
148 // Handle is kind of OStorePageManager.
149 return static_cast<OStorePageManager*>(pHandle);
150 }
151 return nullptr;
152}
153
154} // namespace store
155
156/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const char * pName
virtual bool isKindOf(sal_uInt32 nTypeId)
Replaces dynamic_cast type checking.
Definition: object.cxx:28
bool isValid() const
Definition: storbios.hxx:163
OStorePageManager(const OStorePageManager &)=delete
OStoreBTreeRootObject m_aRoot
Representation.
Definition: storpage.hxx:111
PageHolderObject< inode > inode_holder_type
Definition: storpage.hxx:98
bool isValid() const
isValid.
Definition: storpage.hxx:138
storeError remove(const OStorePageKey &rKey)
remove.
Definition: storpage.cxx:425
OStorePageManager & operator=(const OStorePageManager &)=delete
storeError iterate(OStorePageKey &rKey, OStorePageLink &rLink, sal_uInt32 &rAttrib)
Definition: storpage.cxx:316
OStorePageManager self
Definition: storpage.hxx:91
OStoreBTreeNodeData page
Definition: storpage.hxx:94
OStorePageBIOS base
Definition: storpage.hxx:90
OStoreBTreeNodeObject node
Definition: storpage.hxx:95
virtual storeError initialize(ILockBytes *pLockBytes, storeAccessMode eAccessMode, sal_uInt16 &rnPageSize) override
Initialization (two-phase construction).
Definition: storpage.cxx:54
static const sal_uInt32 m_nTypeId
IStoreHandle TypeId.
Definition: storpage.hxx:102
OStoreDirectoryPageData inode
Definition: storpage.hxx:97
virtual bool isKindOf(sal_uInt32 nTypeId) override
IStoreHandle.
Definition: storpage.cxx:45
storeError load_dirpage_Impl(const OStorePageKey &rKey, OStoreDirectoryPageObject &rPage)
DirectoryPage I/O (managed).
Definition: storpage.cxx:352
storeError remove_Impl(entry &rEntry)
remove (possibly down from root).
Definition: storpage.cxx:138
virtual ~OStorePageManager() override
Definition: storpage.cxx:41
static storeError namei(const rtl_String *pPath, const rtl_String *pName, OStorePageKey &rKey)
DirectoryPage I/O (managed).
Definition: storpage.cxx:206
storeError save_dirpage_Impl(const OStorePageKey &rKey, OStoreDirectoryPageObject &rPage)
Definition: storpage.cxx:373
storeError iget(OStoreDirectoryPageObject &rPage, sal_uInt32 nAttrib, const rtl_String *pPath, const rtl_String *pName, storeAccessMode eMode)
Definition: storpage.cxx:229
OStoreBTreeEntry entry
Definition: storpage.hxx:93
storeError find_lookup(OStoreBTreeNodeObject &rNode, sal_uInt16 &rIndex, OStorePageKey const &rKey)
find_lookup (node page and index, w/o split).
Definition: storpage.cxx:101
Mode eMode
Old OStorePageCache implementation.
Definition: lockbyte.cxx:133
store_handle_type *SAL_CALL query(OStoreObject *pHandle, store_handle_type *)
Template helper function as dynamic_cast replacement.
storeAccessMode
Access Mode enumeration.
Definition: types.h:62
storeError
Error Code enumeration.
Definition: types.h:73