LibreOffice Module store (master) 1
storlckb.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
24#include <rtl/string.h>
25#include <rtl/ref.hxx>
26
27#include "object.hxx"
28#include "storbase.hxx"
29
30namespace store
31{
32
33class OStorePageManager;
34struct OStoreDataPageData;
35struct OStoreDirectoryPageData;
36
38{
39public:
41
50 OStorePageManager *pManager,
51 rtl_String const *pPath,
52 rtl_String const *pName,
53 storeAccessMode eAccessMode);
54
63 sal_uInt32 nOffset,
64 void *pBuffer,
65 sal_uInt32 nBytes,
66 sal_uInt32 &rnDone);
67
76 sal_uInt32 nOffset,
77 const void *pBuffer,
78 sal_uInt32 nBytes,
79 sal_uInt32 &rnDone);
80
85 storeError setSize (sal_uInt32 nSize);
86
89 virtual bool isKindOf (sal_uInt32 nMagic) override;
90
91protected:
92 virtual ~OStoreLockBytes() override;
93
94private:
97 static const sal_uInt32 m_nTypeId;
98
101 friend OStoreLockBytes*
102 SAL_CALL query<> (OStoreObject *pHandle, OStoreLockBytes*);
103
105
108
111
113
116};
117
118template<> inline OStoreLockBytes*
119SAL_CALL query (OStoreObject *pHandle, SAL_UNUSED_PARAMETER OStoreLockBytes*)
120{
121 if (pHandle && pHandle->isKindOf (OStoreLockBytes::m_nTypeId))
122 {
123 // Handle is kind of OStoreLockBytes.
124 return static_cast<OStoreLockBytes*>(pHandle);
125 }
126 return nullptr;
127}
128
129} // namespace store
130
131/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const char * pName
static const sal_uInt32 m_nTypeId
IStoreHandle TypeId.
Definition: storlckb.hxx:97
storeError create(OStorePageManager *pManager, rtl_String const *pPath, rtl_String const *pName, storeAccessMode eAccessMode)
create (two-phase construction).
Definition: storlckb.cxx:55
OStoreDirectoryPageData inode
Definition: storlckb.hxx:107
virtual bool isKindOf(sal_uInt32 nMagic) override
IStoreHandle.
Definition: storlckb.cxx:50
inode_holder_type m_xNode
Definition: storlckb.hxx:110
storeError writeAt(sal_uInt32 nOffset, const void *pBuffer, sal_uInt32 nBytes, sal_uInt32 &rnDone)
Write at Offset from Buffer.
Definition: storlckb.cxx:200
OStoreLockBytes(const OStoreLockBytes &)=delete
PageHolderObject< inode > inode_holder_type
Definition: storlckb.hxx:109
storeError setSize(sal_uInt32 nSize)
setSize.
Definition: storlckb.cxx:323
OStoreLockBytes & operator=(const OStoreLockBytes &)=delete
rtl::Reference< OStorePageManager > m_xManager
Definition: storlckb.hxx:104
virtual ~OStoreLockBytes() override
Definition: storlckb.cxx:42
storeError readAt(sal_uInt32 nOffset, void *pBuffer, sal_uInt32 nBytes, sal_uInt32 &rnDone)
Read at Offset into Buffer.
Definition: storlckb.cxx:103
OStoreDataPageData data
Definition: storlckb.hxx:106
virtual bool isKindOf(sal_uInt32 nTypeId)
Replaces dynamic_cast type checking.
Definition: object.cxx:28
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.
const sal_uInt16 nMagic
storeAccessMode
Access Mode enumeration.
Definition: types.h:62
storeError
Error Code enumeration.
Definition: types.h:73