1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include "RowSetCacheIterator.hxx"
21 #include "RowSetCache.hxx"
22 #include "RowSetBase.hxx"
24 using namespace dbaccess
;
26 ORowSetCacheIterator::ORowSetCacheIterator(const ORowSetCacheIterator
& _rRH
)
27 : m_aIter(_rRH
.m_aIter
)
28 , m_pCache(_rRH
.m_pCache
)
29 ,m_pRowSet(_rRH
.m_pRowSet
)
33 ORowSetCacheIterator::operator ORowSetMatrix::iterator
const &()
35 return m_aIter
->second
.aIterator
;
38 ORowSetCacheIterator
& ORowSetCacheIterator::operator =(const ORowSetCacheIterator
& _rRH
)
43 m_pCache
= _rRH
.m_pCache
;
44 m_aIter
= _rRH
.m_aIter
;
45 m_pRowSet
= _rRH
.m_pRowSet
;
50 ORowSetCacheIterator
& ORowSetCacheIterator::operator =(const ORowSetMatrix::iterator
& _rIter
)
52 m_aIter
->second
.aIterator
= _rIter
;
56 ORowSetRow
& ORowSetCacheIterator::operator *()
58 return *m_aIter
->second
.aIterator
;
61 ORowSetMatrix::iterator
& ORowSetCacheIterator::operator ->()
63 return m_aIter
->second
.aIterator
;
66 bool ORowSetCacheIterator::operator <(const ORowSetMatrix::iterator
& _rRH
) const
68 return m_aIter
->second
.aIterator
< _rRH
;
71 bool ORowSetCacheIterator::operator !=(const ORowSetMatrix::iterator
& _rRH
) const
73 return m_aIter
->second
.aIterator
!= _rRH
;
76 bool ORowSetCacheIterator::isNull() const
78 bool bRet
= !m_pCache
|| !m_pRowSet
|| m_aIter
== m_pCache
->m_aCacheIterators
.end();
81 bRet
= ( m_pRowSet
->isInsertRow()
83 m_aIter
->second
.aIterator
== m_pCache
->m_pInsertMatrix
->end()
85 m_aIter
->second
.aIterator
== m_pCache
->m_pMatrix
->end()
91 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */