LibreOffice Module dbaccess (master) 1
RowSetCacheIterator.cxx
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
21#include "RowSetCache.hxx"
22#include "RowSetBase.hxx"
23
24using namespace dbaccess;
25
26ORowSetCacheIterator::ORowSetCacheIterator(const ORowSetCacheIterator& _rRH)
27: m_aIter(_rRH.m_aIter)
28, m_pCache(_rRH.m_pCache)
29,m_pRowSet(_rRH.m_pRowSet)
30{
31}
32
33ORowSetCacheIterator::operator ORowSetMatrix::iterator const &()
34{
35 return m_aIter->second.aIterator;
36}
37
39{
40 if(this == &_rRH)
41 return *this;
42
43 m_pCache = _rRH.m_pCache;
44 m_aIter = _rRH.m_aIter;
45 m_pRowSet = _rRH.m_pRowSet;
46
47 return *this;
48}
49
50ORowSetCacheIterator& ORowSetCacheIterator::operator =(const ORowSetMatrix::iterator& _rIter)
51{
52 m_aIter->second.aIterator = _rIter;
53 return *this;
54}
55
57{
58 return *m_aIter->second.aIterator;
59}
60
61ORowSetMatrix::iterator& ORowSetCacheIterator::operator ->()
62{
63 return m_aIter->second.aIterator;
64}
65
66bool ORowSetCacheIterator::operator <(const ORowSetMatrix::iterator& _rRH) const
67{
68 return m_aIter->second.aIterator < _rRH;
69}
70
71bool ORowSetCacheIterator::operator !=(const ORowSetMatrix::iterator& _rRH) const
72{
73 return m_aIter->second.aIterator != _rRH;
74}
75
77{
78 bool bRet = !m_pCache || !m_pRowSet || m_aIter == m_pCache->m_aCacheIterators.end();
79 if ( !bRet )
80 {
81 bRet = ( m_pRowSet->isInsertRow()
82 ?
83 m_aIter->second.aIterator == m_pCache->m_pInsertMatrix->end()
84 :
85 m_aIter->second.aIterator == m_pCache->m_pMatrix->end()
86 );
87 }
88 return bRet;
89}
90
91/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool isInsertRow() const
Definition: RowSetBase.hxx:332
ORowSetCacheMap::iterator m_aIter
ORowSetMatrix::iterator & operator->()
bool operator!=(const ORowSetMatrix::iterator &_rRH) const
ORowSetCacheIterator & operator=(const ORowSetCacheIterator &)
bool operator<(const ORowSetMatrix::iterator &_rRH) const
std::unique_ptr< ORowSetMatrix > m_pMatrix
Definition: RowSetCache.hxx:54
ORowSetCacheMap m_aCacheIterators
Definition: RowSetCache.hxx:57
std::unique_ptr< ORowSetMatrix > m_pInsertMatrix
Definition: RowSetCache.hxx:60
FilterCache * m_pCache