LibreOffice Module connectivity (master) 1
fanalyzer.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 <file/fcomp.hxx>
23
24namespace connectivity::file
25 {
26 class OConnection;
27 class OSQLAnalyzer final
28 {
29 typedef std::pair< ::rtl::Reference<OPredicateCompiler>,::rtl::Reference<OPredicateInterpreter> > TPredicates;
30
31 std::vector< TPredicates > m_aSelectionEvaluations;
35
36 mutable bool m_bHasSelectionCode;
38
39 static void bindRow(OCodeList& rCodeList,const OValueRefRow& _pRow);
40
41 public:
42 OSQLAnalyzer(OConnection* _pConnection);
44
46 void bindEvaluationRow(OValueRefRow const & _pRow); // Bind an evaluation row to the restriction
50 void bindSelectRow(const OValueRefRow& _pRow);
51
55 void bindParameterRow(OValueRefRow const & _pRow);
56
57 void dispose();
58 void start(OSQLParseNode const * pSQLParseNode);
59 bool hasRestriction() const;
60 bool hasFunctions() const;
61 bool evaluateRestriction() { return m_aInterpreter->start(); }
62 void setSelectionEvaluationResult(OValueRefRow const & _pRow,const std::vector<sal_Int32>& _rColumnMapping);
63 void setOrigColumns(const css::uno::Reference< css::container::XNameAccess>& rCols);
64 static OOperandAttr* createOperandAttr(sal_Int32 _nPos,
65 const css::uno::Reference< css::beans::XPropertySet>& _xCol);
66 };
67
68}
69
70/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
::rtl::Reference< OPredicateCompiler > m_aCompiler
Definition: fanalyzer.hxx:32
void bindParameterRow(OValueRefRow const &_pRow)
binds the row to parameter for the restrictions
OConnection * getConnection() const
Definition: fanalyzer.hxx:45
void setSelectionEvaluationResult(OValueRefRow const &_pRow, const std::vector< sal_Int32 > &_rColumnMapping)
Definition: fanalyzer.cxx:168
std::vector< TPredicates > m_aSelectionEvaluations
Definition: fanalyzer.hxx:31
void bindSelectRow(const OValueRefRow &_pRow)
bind the select columns if they contain a function which needs a row value
Definition: fanalyzer.cxx:124
::rtl::Reference< OPredicateInterpreter > m_aInterpreter
Definition: fanalyzer.hxx:33
std::pair< ::rtl::Reference< OPredicateCompiler >,::rtl::Reference< OPredicateInterpreter > > TPredicates
Definition: fanalyzer.hxx:29
static void bindRow(OCodeList &rCodeList, const OValueRefRow &_pRow)
Definition: fanalyzer.cxx:112
OSQLAnalyzer(OConnection *_pConnection)
Definition: fanalyzer.cxx:34
static OOperandAttr * createOperandAttr(sal_Int32 _nPos, const css::uno::Reference< css::beans::XPropertySet > &_xCol)
Definition: fanalyzer.cxx:139
void setOrigColumns(const css::uno::Reference< css::container::XNameAccess > &rCols)
Definition: fanalyzer.cxx:196
void start(OSQLParseNode const *pSQLParseNode)
Definition: fanalyzer.cxx:49
void bindEvaluationRow(OValueRefRow const &_pRow)
Definition: fanalyzer.cxx:134
std::vector< std::unique_ptr< OCode > > OCodeList
Definition: fcomp.hxx:31