Branch data Line data Source code
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 : : #ifndef DBACCESS_ROWSETCACHEITERATOR_HXX
20 : : #define DBACCESS_ROWSETCACHEITERATOR_HXX
21 : :
22 : : #include "RowSetRow.hxx"
23 : : #include <comphelper/stl_types.hxx>
24 : :
25 : : namespace dbaccess
26 : : {
27 : : class ORowSetBase;
28 : : typedef struct
29 : 44 : {
30 : : ORowSetMatrix::iterator aIterator;
31 : : ::com::sun::star::uno::Any aBookmark;
32 : : ORowSetBase* pRowSet;
33 : 16892 : } ORowSetCacheIterator_Helper;
34 : :
35 : : DECLARE_STL_STDKEY_MAP(sal_Int32,ORowSetCacheIterator_Helper,ORowSetCacheMap);
36 : :
37 : : class ORowSetCache;
38 : : class ORowSetCacheIterator
39 : : {
40 : : friend class ORowSetCache;
41 : : ORowSetCacheMap::iterator m_aIter;
42 : : ORowSetCache* m_pCache;
43 : : ORowSetBase* m_pRowSet;
44 : : protected:
45 : 44 : ORowSetCacheIterator(const ORowSetCacheMap::iterator& _rIter,ORowSetCache* _pCache,ORowSetBase* _pRowSet)
46 : : : m_aIter(_rIter)
47 : : ,m_pCache(_pCache)
48 : 44 : ,m_pRowSet(_pRowSet)
49 : : {
50 : 44 : }
51 : : public:
52 : 308 : ORowSetCacheIterator() :m_aIter(),m_pCache(NULL),m_pRowSet(NULL){}
53 : : ORowSetCacheIterator(const ORowSetCacheIterator& _rRH);
54 : : ORowSetCacheIterator& operator =(const ORowSetCacheIterator&);
55 : :
56 : : sal_Bool isNull() const;
57 : : ORowSetCacheIterator& operator =(const ORowSetMatrix::iterator&);
58 : : operator ORowSetMatrix::iterator();
59 : :
60 : : ORowSetRow& operator *();
61 : : const ORowSetRow& operator *() const;
62 : :
63 : : ORowSetMatrix::iterator& operator ->();
64 : : const ORowSetMatrix::iterator& operator ->() const;
65 : :
66 : : bool operator <=(const ORowSetMatrix::iterator& _rRH) const;
67 : : bool operator <(const ORowSetMatrix::iterator& _rRH) const;
68 : : bool operator !=(const ORowSetMatrix::iterator& _rRH) const;
69 : : bool operator ==(const ORowSetMatrix::iterator& _rRH) const;
70 : :
71 : : void setBookmark(const ::com::sun::star::uno::Any& _rBookmark);
72 : : ::com::sun::star::uno::Any getBookmark() const { return m_aIter->second.aBookmark; }
73 : : ::osl::Mutex* getMutex() const;
74 : :
75 : : ORowSetCacheMap::iterator getIter() const { return m_aIter; }
76 : : };
77 : : }
78 : : #endif // DBACCESS_ROWSETCACHEITERATOR_HXX
79 : :
80 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|