LibreOffice Module dbaccess (master) 1
StaticSet.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 "CacheSet.hxx"
23
24namespace dbaccess
25{
26 // is used when nothing is supported by the driver
27 // we use a snapshot
28 class OStaticSet : public OCacheSet
29 {
31 ORowSetMatrix::iterator m_aSetIter;
32 bool m_bEnd;
33 bool fetchRow();
34 void fillAllRows();
35 public:
36 explicit OStaticSet(sal_Int32 i_nMaxRows) : OCacheSet(i_nMaxRows)
38 , m_bEnd(false)
39 {
40 m_aSet.push_back(nullptr); // this is the beforefirst record
41 }
42
43 virtual void reset(const css::uno::Reference< css::sdbc::XResultSet>& _xDriverSet) override;
44
45 virtual void fillValueRow(ORowSetRow& _rRow,sal_Int32 _nPosition) override;
46 // css::sdbcx::XRowLocate
47 virtual css::uno::Any getBookmark() override;
48 virtual bool moveToBookmark( const css::uno::Any& bookmark ) override;
49 virtual sal_Int32 compareBookmarks( const css::uno::Any& first, const css::uno::Any& second ) override;
50 virtual bool hasOrderedBookmarks( ) override;
51 virtual sal_Int32 hashBookmark( const css::uno::Any& bookmark ) override;
52
53 bool isBeforeFirst( );
54 bool isAfterLast( );
55
56 // css::sdbc::XResultSet
57 virtual bool next() override;
58 virtual void beforeFirst( ) override;
59 virtual void afterLast( ) override;
60 virtual bool first() override;
61 virtual bool last() override;
62 virtual sal_Int32 getRow( ) override;
63 virtual bool absolute( sal_Int32 row ) override;
64 virtual bool previous( ) override;
65 virtual void refreshRow( ) override;
66 virtual bool rowUpdated( ) override;
67 virtual bool rowInserted( ) override;
68 virtual bool rowDeleted( ) override;
69 // css::sdbc::XResultSetUpdate
70 virtual void insertRow( const ORowSetRow& _rInsertRow,const connectivity::OSQLTable& _xTable ) override;
71 virtual void deleteRow(const ORowSetRow& _rInsertRow,const connectivity::OSQLTable& _xTable ) override;
72 };
73}
74
75/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual sal_Int32 getRow() override
Definition: StaticSet.cxx:168
virtual css::uno::Any getBookmark() override
Definition: StaticSet.cxx:45
virtual bool first() override
Definition: StaticSet.cxx:149
virtual void deleteRow(const ORowSetRow &_rInsertRow, const connectivity::OSQLTable &_xTable) override
Definition: StaticSet.cxx:259
virtual void insertRow(const ORowSetRow &_rInsertRow, const connectivity::OSQLTable &_xTable) override
Definition: StaticSet.cxx:247
virtual bool previous() override
Definition: StaticSet.cxx:218
OStaticSet(sal_Int32 i_nMaxRows)
Definition: StaticSet.hxx:36
virtual void beforeFirst() override
Definition: StaticSet.cxx:136
virtual bool rowDeleted() override
Definition: StaticSet.cxx:242
virtual bool moveToBookmark(const css::uno::Any &bookmark) override
Definition: StaticSet.cxx:50
virtual bool absolute(sal_Int32 row) override
Definition: StaticSet.cxx:178
virtual sal_Int32 hashBookmark(const css::uno::Any &bookmark) override
Definition: StaticSet.cxx:69
virtual sal_Int32 compareBookmarks(const css::uno::Any &first, const css::uno::Any &second) override
Definition: StaticSet.cxx:56
virtual bool rowInserted() override
Definition: StaticSet.cxx:237
virtual void reset(const css::uno::Reference< css::sdbc::XResultSet > &_xDriverSet) override
Definition: StaticSet.cxx:271
virtual bool hasOrderedBookmarks() override
Definition: StaticSet.cxx:64
virtual void afterLast() override
Definition: StaticSet.cxx:142
virtual bool rowUpdated() override
Definition: StaticSet.cxx:232
ORowSetMatrix::iterator m_aSetIter
Definition: StaticSet.hxx:31
ORowSetMatrix m_aSet
Definition: StaticSet.hxx:30
virtual bool next() override
Definition: StaticSet.cxx:109
virtual void refreshRow() override
Definition: StaticSet.cxx:228
virtual void fillValueRow(ORowSetRow &_rRow, sal_Int32 _nPosition) override
Definition: StaticSet.cxx:39
virtual bool last() override
Definition: StaticSet.cxx:159
css::uno::Reference< css::sdbcx::XColumnsSupplier > OSQLTable
std::vector< ORowSetRow > ORowSetMatrix
Definition: RowSetRow.hxx:31
end