xref: /trunk/main/store/source/storcach.hxx (revision b9fd132d)
11a5fa39bSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
31a5fa39bSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
41a5fa39bSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
51a5fa39bSAndrew Rist  * distributed with this work for additional information
61a5fa39bSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
71a5fa39bSAndrew Rist  * to you under the Apache License, Version 2.0 (the
81a5fa39bSAndrew Rist  * "License"); you may not use this file except in compliance
91a5fa39bSAndrew Rist  * with the License.  You may obtain a copy of the License at
101a5fa39bSAndrew Rist  *
111a5fa39bSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
121a5fa39bSAndrew Rist  *
131a5fa39bSAndrew Rist  * Unless required by applicable law or agreed to in writing,
141a5fa39bSAndrew Rist  * software distributed under the License is distributed on an
151a5fa39bSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
161a5fa39bSAndrew Rist  * KIND, either express or implied.  See the License for the
171a5fa39bSAndrew Rist  * specific language governing permissions and limitations
181a5fa39bSAndrew Rist  * under the License.
191a5fa39bSAndrew Rist  *
201a5fa39bSAndrew Rist  *************************************************************/
211a5fa39bSAndrew Rist 
221a5fa39bSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _STORE_STORCACH_HXX
25*b9fd132dSpfg #define _STORE_STORCACH_HXX "$Revision$"
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