xref: /aoo42x/main/store/source/storcach.hxx (revision 1a5fa39b)
1*1a5fa39bSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*1a5fa39bSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*1a5fa39bSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*1a5fa39bSAndrew Rist  * distributed with this work for additional information
6*1a5fa39bSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*1a5fa39bSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*1a5fa39bSAndrew Rist  * "License"); you may not use this file except in compliance
9*1a5fa39bSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*1a5fa39bSAndrew Rist  *
11*1a5fa39bSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*1a5fa39bSAndrew Rist  *
13*1a5fa39bSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*1a5fa39bSAndrew Rist  * software distributed under the License is distributed on an
15*1a5fa39bSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*1a5fa39bSAndrew Rist  * KIND, either express or implied.  See the License for the
17*1a5fa39bSAndrew Rist  * specific language governing permissions and limitations
18*1a5fa39bSAndrew Rist  * under the License.
19*1a5fa39bSAndrew Rist  *
20*1a5fa39bSAndrew Rist  *************************************************************/
21*1a5fa39bSAndrew Rist 
22*1a5fa39bSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _STORE_STORCACH_HXX
25cdf0e10cSrcweir #define _STORE_STORCACH_HXX "$Revision: 1.6.8.2 $"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include "sal/types.h"
28cdf0e10cSrcweir #include "rtl/ref.hxx"
29cdf0e10cSrcweir 
30cdf0e10cSrcweir #include "store/types.h"
31cdf0e10cSrcweir #include "storbase.hxx"
32cdf0e10cSrcweir 
33cdf0e10cSrcweir namespace store
34cdf0e10cSrcweir {
35cdf0e10cSrcweir 
36cdf0e10cSrcweir /*========================================================================
37cdf0e10cSrcweir  *
38cdf0e10cSrcweir  * PageCache interface.
39cdf0e10cSrcweir  *
40cdf0e10cSrcweir  *======================================================================*/
41cdf0e10cSrcweir 
42cdf0e10cSrcweir class PageCache : public rtl::IReference
43cdf0e10cSrcweir {
44cdf0e10cSrcweir public:
45cdf0e10cSrcweir 	/** load.
46cdf0e10cSrcweir      */
47cdf0e10cSrcweir     storeError lookupPageAt (
48cdf0e10cSrcweir         PageHolder & rxPage,
49cdf0e10cSrcweir         sal_uInt32   nOffset);
50cdf0e10cSrcweir 
51cdf0e10cSrcweir 	/** insert.
52cdf0e10cSrcweir      */
53cdf0e10cSrcweir     storeError insertPageAt (
54cdf0e10cSrcweir         PageHolder const & rxPage,
55cdf0e10cSrcweir         sal_uInt32         nOffset);
56cdf0e10cSrcweir 
57cdf0e10cSrcweir 	/** update, or insert.
58cdf0e10cSrcweir      */
59cdf0e10cSrcweir     storeError updatePageAt (
60cdf0e10cSrcweir         PageHolder const & rxPage,
61cdf0e10cSrcweir         sal_uInt32         nOffset);
62cdf0e10cSrcweir 
63cdf0e10cSrcweir 	/** remove (invalidate).
64cdf0e10cSrcweir      */
65cdf0e10cSrcweir     storeError removePageAt (
66cdf0e10cSrcweir         sal_uInt32 nOffset);
67cdf0e10cSrcweir 
68cdf0e10cSrcweir private:
69cdf0e10cSrcweir     /** Implementation (abstract).
70cdf0e10cSrcweir      */
71cdf0e10cSrcweir     virtual storeError lookupPageAt_Impl (
72cdf0e10cSrcweir         PageHolder & rxPage,
73cdf0e10cSrcweir         sal_uInt32   nOffset) = 0;
74cdf0e10cSrcweir 
75cdf0e10cSrcweir     virtual storeError insertPageAt_Impl (
76cdf0e10cSrcweir         PageHolder const & rxPage,
77cdf0e10cSrcweir         sal_uInt32         nOffset) = 0;
78cdf0e10cSrcweir 
79cdf0e10cSrcweir     virtual storeError updatePageAt_Impl (
80cdf0e10cSrcweir         PageHolder const & rxPage,
81cdf0e10cSrcweir         sal_uInt32         nOffset) = 0;
82cdf0e10cSrcweir 
83cdf0e10cSrcweir     virtual storeError removePageAt_Impl (
84cdf0e10cSrcweir         sal_uInt32 nOffset) = 0;
85cdf0e10cSrcweir };
86cdf0e10cSrcweir 
87cdf0e10cSrcweir /*========================================================================
88cdf0e10cSrcweir  *
89cdf0e10cSrcweir  * PageCache factory.
90cdf0e10cSrcweir  *
91cdf0e10cSrcweir  *======================================================================*/
92cdf0e10cSrcweir 
93cdf0e10cSrcweir storeError
94cdf0e10cSrcweir PageCache_createInstance (
95cdf0e10cSrcweir     rtl::Reference< store::PageCache > & rxCache,
96cdf0e10cSrcweir     sal_uInt16                           nPageSize
97cdf0e10cSrcweir );
98cdf0e10cSrcweir 
99cdf0e10cSrcweir /*========================================================================
100cdf0e10cSrcweir  *
101cdf0e10cSrcweir  * The End.
102cdf0e10cSrcweir  *
103cdf0e10cSrcweir  *======================================================================*/
104cdf0e10cSrcweir 
105cdf0e10cSrcweir } // namespace store
106cdf0e10cSrcweir 
107cdf0e10cSrcweir #endif /* !_STORE_STORCACH_HXX */
108cdf0e10cSrcweir 
109