Update ooo320-m1
[ooovba.git] / dbaccess / source / core / api / RowSetCacheIterator.hxx
blobed878e101bfce612d5b560504bbd0a151a9ecbde
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: RowSetCacheIterator.hxx,v $
10 * $Revision: 1.12 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef DBACCESS_ROWSETCACHEITERATOR_HXX
31 #define DBACCESS_ROWSETCACHEITERATOR_HXX
33 #ifndef DBACCESS_CORE_API_ROWSETROW_HXX
34 #include "RowSetRow.hxx"
35 #endif
36 #ifndef _COMPHELPER_STLTYPES_HXX_
37 #include <comphelper/stl_types.hxx>
38 #endif
40 namespace dbaccess
42 class ORowSetBase;
43 typedef struct
45 ORowSetMatrix::iterator aIterator;
46 ::com::sun::star::uno::Any aBookmark;
47 ORowSetBase* pRowSet;
48 } ORowSetCacheIterator_Helper;
50 DECLARE_STL_STDKEY_MAP(sal_Int32,ORowSetCacheIterator_Helper,ORowSetCacheMap);
52 class ORowSetCache;
53 class ORowSetCacheIterator
55 friend class ORowSetCache;
56 ORowSetCacheMap::iterator m_aIter;
57 ORowSetCache* m_pCache;
58 ORowSetBase* m_pRowSet;
59 protected:
60 ORowSetCacheIterator(const ORowSetCacheMap::iterator& _rIter,ORowSetCache* _pCache,ORowSetBase* _pRowSet)
61 : m_aIter(_rIter)
62 ,m_pCache(_pCache)
63 ,m_pRowSet(_pRowSet)
66 public:
67 ORowSetCacheIterator() :m_aIter(),m_pCache(NULL),m_pRowSet(NULL){}
68 ORowSetCacheIterator(const ORowSetCacheIterator& _rRH);
69 ORowSetCacheIterator& operator =(const ORowSetCacheIterator&);
71 sal_Bool isNull() const;
72 ORowSetCacheIterator& operator =(const ORowSetMatrix::iterator&);
73 operator ORowSetMatrix::iterator();
75 ORowSetRow& operator *();
76 const ORowSetRow& operator *() const;
78 ORowSetMatrix::iterator& operator ->();
79 const ORowSetMatrix::iterator& operator ->() const;
81 bool operator <=(const ORowSetMatrix::iterator& _rRH) const;
82 bool operator <(const ORowSetMatrix::iterator& _rRH) const;
83 bool operator !=(const ORowSetMatrix::iterator& _rRH) const;
84 bool operator ==(const ORowSetMatrix::iterator& _rRH) const;
86 void setBookmark(const ::com::sun::star::uno::Any& _rBookmark);
87 ::com::sun::star::uno::Any getBookmark() const { return m_aIter->second.aBookmark; }
88 ::osl::Mutex* getMutex() const;
90 ORowSetCacheMap::iterator getIter() const { return m_aIter; }
93 #endif // DBACCESS_ROWSETCACHEITERATOR_HXX