LibreOffice Module store (master) 1
lockbyte.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/config.h>
23
24#include <memory>
25
26#include <sal/types.h>
27
28#include <rtl/ustring.h>
30
31#include <store/types.h>
32#include "storbase.hxx"
33
34namespace rtl { template <class reference_type> class Reference; }
35
36namespace store
37{
38
40{
41public:
48 sal_uInt16 nPageSize);
49
55 std::shared_ptr<PageData> & rPage,
56 sal_uInt32 nOffset);
57
63 std::shared_ptr<PageData> const & rPage,
64 sal_uInt32 nOffset);
65
73 sal_uInt32 nOffset,
74 void *pBuffer,
75 sal_uInt32 nBytes);
76
84 sal_uInt32 nOffset,
85 const void *pBuffer,
86 sal_uInt32 nBytes);
87
92 storeError getSize (sal_uInt32 & rnSize);
93
98 storeError setSize (sal_uInt32 nSize);
99
104
105protected:
106 virtual ~ILockBytes() override {}
107
108private:
113 sal_uInt16 nPageSize) = 0;
114
116 std::shared_ptr<PageData> & rPage,
117 sal_uInt32 nOffset) = 0;
118
120 std::shared_ptr<PageData> const & rPage,
121 sal_uInt32 nOffset) = 0;
122
124 sal_uInt32 nOffset,
125 void *pBuffer,
126 sal_uInt32 nBytes) = 0;
127
129 sal_uInt32 nOffset,
130 const void *pBuffer,
131 sal_uInt32 nBytes) = 0;
132
134 sal_uInt32 & rnSize) = 0;
135
137 sal_uInt32 nSize) = 0;
138
139 virtual storeError flush_Impl() = 0;
140};
141
144 rtl_uString * pFilename,
145 storeAccessMode eAccessMode
146);
147
150);
151
152} // namespace store
153
154/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual storeError writeAt_Impl(sal_uInt32 nOffset, const void *pBuffer, sal_uInt32 nBytes)=0
virtual storeError initialize_Impl(rtl::Reference< PageData::Allocator > &rxAllocator, sal_uInt16 nPageSize)=0
Implementation (abstract).
virtual storeError writePageAt_Impl(std::shared_ptr< PageData > const &rPage, sal_uInt32 nOffset)=0
virtual storeError flush_Impl()=0
storeError initialize(rtl::Reference< PageData::Allocator > &rxAllocator, sal_uInt16 nPageSize)
Definition: lockbyte.cxx:37
storeError readPageAt(std::shared_ptr< PageData > &rPage, sal_uInt32 nOffset)
Definition: lockbyte.cxx:43
storeError flush()
Definition: lockbyte.cxx:127
storeError writePageAt(std::shared_ptr< PageData > const &rPage, sal_uInt32 nOffset)
Definition: lockbyte.cxx:52
storeError writeAt(sal_uInt32 nOffset, const void *pBuffer, sal_uInt32 nBytes)
Definition: lockbyte.cxx:94
storeError setSize(sal_uInt32 nSize)
Definition: lockbyte.cxx:122
virtual ~ILockBytes() override
Definition: lockbyte.hxx:106
virtual storeError setSize_Impl(sal_uInt32 nSize)=0
virtual storeError readPageAt_Impl(std::shared_ptr< PageData > &rPage, sal_uInt32 nOffset)=0
virtual storeError getSize_Impl(sal_uInt32 &rnSize)=0
storeError getSize(sal_uInt32 &rnSize)
Definition: lockbyte.cxx:116
storeError readAt(sal_uInt32 nOffset, void *pBuffer, sal_uInt32 nBytes)
Definition: lockbyte.cxx:72
virtual storeError readAt_Impl(sal_uInt32 nOffset, void *pBuffer, sal_uInt32 nBytes)=0
Reference
Old OStorePageCache implementation.
Definition: lockbyte.cxx:133
storeError FileLockBytes_createInstance(rtl::Reference< ILockBytes > &rxLockBytes, rtl_uString *pFilename, storeAccessMode eAccessMode)
Definition: lockbyte.cxx:837
storeError MemoryLockBytes_createInstance(rtl::Reference< ILockBytes > &rxLockBytes)
Definition: lockbyte.cxx:873
storeAccessMode
Access Mode enumeration.
Definition: types.h:62
storeError
Error Code enumeration.
Definition: types.h:73