Files
libreoffice/connectivity/source/inc/file/fcomp.hxx

115 lines
4.6 KiB
C++
Raw Normal View History

2010-10-27 13:11:31 +01:00
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2012-06-12 22:04:38 +01:00
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
2014-04-18 18:41:08 +02:00
#ifndef INCLUDED_CONNECTIVITY_SOURCE_INC_FILE_FCOMP_HXX
#define INCLUDED_CONNECTIVITY_SOURCE_INC_FILE_FCOMP_HXX
2000-09-18 15:18:56 +00:00
#include <file/fcode.hxx>
#include <file/filedllapi.hxx>
2000-09-18 15:18:56 +00:00
#include <list>
namespace connectivity
{
class OSQLParseNode;
namespace file
{
class OCode;
class OOperand;
class OSQLAnalyzer;
typedef std::vector<std::unique_ptr<OCode>> OCodeList;
2000-09-18 15:18:56 +00:00
class OPredicateCompiler final : public ::salhelper::SimpleReferenceObject
2000-09-18 15:18:56 +00:00
{
friend class OPredicateInterpreter;
friend class OSQLAnalyzer;
OCodeList m_aCodeList;
css::uno::Reference< css::container::XNameAccess> m_orgColumns; // in filecurs this are the filecolumns
2000-09-18 15:18:56 +00:00
OSQLAnalyzer* m_pAnalyzer;
2001-04-10 07:51:30 +00:00
sal_Int32 m_nParamCounter;
2000-09-18 15:18:56 +00:00
public:
OPredicateCompiler(OSQLAnalyzer* pAnalyzer);
virtual ~OPredicateCompiler() override;
2000-11-03 12:49:39 +00:00
void dispose();
2000-09-18 15:18:56 +00:00
void start(connectivity::OSQLParseNode const * pSQLParseNode);
OOperand* execute(connectivity::OSQLParseNode const * pPredicateNode);
2000-09-18 15:18:56 +00:00
void Clean();
bool isClean() const {return m_aCodeList.empty();}
bool hasCode() const {return !isClean();}
void setOrigColumns(const css::uno::Reference< css::container::XNameAccess>& rCols) { m_orgColumns = rCols; }
const css::uno::Reference< css::container::XNameAccess>& getOrigColumns() const { return m_orgColumns; }
private:
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
void execute_COMPARE(connectivity::OSQLParseNode const * pPredicateNode);
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
void execute_LIKE(connectivity::OSQLParseNode const * pPredicateNode);
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
void execute_BETWEEN(connectivity::OSQLParseNode const * pPredicateNode);
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
void execute_ISNULL(connectivity::OSQLParseNode const * pPredicateNode);
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
OOperand* execute_Operand(connectivity::OSQLParseNode const * pPredicateNode);
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
void execute_Fold(OSQLParseNode const * pPredicateNode);
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
void executeFunction(OSQLParseNode const * pPredicateNode);
2000-09-18 15:18:56 +00:00
};
CWS-TOOLING: integrate CWS dbaperf1 2009-04-02 09:12:25 +0200 oj r270372 : CWS-TOOLING: rebase CWS dbaperf1 to trunk@270033 (milestone: DEV300:m45) 2009-03-17 10:20:34 +0100 oj r269577 : add parameter 2009-03-17 10:20:05 +0100 oj r269576 : add parameter 2009-03-12 12:32:24 +0100 oj r269387 : add missing ++ 2009-03-11 12:53:35 +0100 oj r269315 : compile error 2009-03-06 08:52:11 +0100 oj r268968 : #i99264# remove duplicate code 2009-03-06 08:20:08 +0100 oj r268966 : add missingheader 2009-03-06 08:17:41 +0100 oj r268965 : add header 2009-03-06 08:15:07 +0100 oj r268964 : #i99708# remove duplicate code 2009-03-06 07:24:11 +0100 oj r268963 : #i99708# remove duplicate code 2009-03-06 07:22:24 +0100 oj r268962 : #i99708# use tenary operator 2009-03-06 07:19:21 +0100 oj r268961 : remove unused rtl_logs 2009-03-06 07:15:55 +0100 oj r268960 : #i99708# extract getLength from for loop 2009-03-06 07:15:35 +0100 oj r268959 : #i99708# extract getLength from for loop 2009-03-06 07:14:57 +0100 oj r268958 : remove unused rtl_logs 2009-03-06 07:13:01 +0100 oj r268957 : insert DBG_ helper 2009-03-06 07:12:17 +0100 oj r268956 : remove unused rtl_logs 2009-03-06 07:10:26 +0100 oj r268955 : remove unused rtl_logs 2009-03-06 07:04:51 +0100 oj r268954 : #i99708# use tenary operator 2009-03-05 12:04:46 +0100 oj r268895 : comment RTL_LOG out 2009-03-05 09:05:07 +0100 oj r268874 : add rtl logfile 2009-03-04 14:21:18 +0100 oj r268828 : #i99708# make static inplace and some method calls in for loop removed 2009-03-04 14:20:34 +0100 oj r268827 : #i99708# impl double check pattern for getInfohelper 2009-03-02 09:31:42 +0100 oj r268636 : add rtl logfile 2009-03-02 08:18:37 +0100 oj r268633 : add rtl logfile 2009-02-27 11:22:16 +0100 oj r268570 : #i99709# change algorithm for marking objects 2009-02-27 11:17:04 +0100 oj r268568 : #i99708# some improvements to load forms, controls faster and replacement of size() call with !empty() which is much faster 2009-02-24 10:09:35 +0100 sb r268383 : #i99290# no longer care to set a sensible context class loader for native threads attached to the VM 2009-02-23 13:44:04 +0100 oj r268354 : #i76606# seekrow changes 2009-02-23 12:27:30 +0100 oj r268349 : deleted 2009-02-20 15:14:23 +0100 oj r268325 : #i76606# some code changes 2009-02-19 14:15:25 +0100 oj r268284 : #i76606# use of simple prep stmt instead of full blown rowset, when source and dest connection are the same use insert into ... ( select ... ) 2009-02-19 11:27:55 +0100 oj r268265 : #i76606# insert some RTL_LOG and setObject impl 2009-02-18 14:45:37 +0100 oj r268222 : #i99363# insert RTL_LOG 2009-02-18 14:45:18 +0100 oj r268221 : #i99363# insert RTL_LOG 2009-02-18 11:14:54 +0100 oj r268207 : #i99363# call some impl_ methods to avoid duplicate cechCache calls 2009-02-18 11:10:47 +0100 oj r268206 : #i99363# make isCount inline 2009-02-18 10:33:22 +0100 oj r268203 : #i99363# use bookmarkable if available and inserted some RTL_LOG 2009-02-18 10:32:57 +0100 oj r268202 : #i99363# use bookmarkable if available and inserted some RTL_LOG 2009-02-17 07:29:05 +0100 oj r267843 : #i96897# remove some dll public 2009-02-16 15:01:04 +0100 oj r267816 : #i96897# remove some dll public 2009-02-16 14:25:53 +0100 oj r267810 : #i99264# remove duplicate code 2009-02-16 14:25:33 +0100 oj r267809 : #i99264# remove duplicate code 2009-02-16 14:24:59 +0100 oj r267808 : #i99264# remove duplicate code 2009-02-13 10:56:17 +0100 oj r267703 : #i99191# comment the contextclassloader 2009-02-13 10:32:40 +0100 oj r267700 : reduce call to resultset meta data 2009-02-13 10:27:31 +0100 oj r267699 : reduce call to resultset meta data 2009-02-13 10:27:08 +0100 oj r267698 : reduce call to resultset meta data
2009-04-23 10:42:05 +00:00
class OPredicateInterpreter :
2010-10-15 12:10:06 -05:00
public ::salhelper::SimpleReferenceObject
2000-09-18 15:18:56 +00:00
{
OCodeStack m_aStack;
2010-10-15 12:10:06 -05:00
::rtl::Reference<OPredicateCompiler> m_rCompiler;
2000-09-18 15:18:56 +00:00
public:
2010-10-15 12:10:06 -05:00
OPredicateInterpreter(const ::rtl::Reference<OPredicateCompiler>& rComp) : m_rCompiler(rComp){}
virtual ~OPredicateInterpreter() override;
2000-09-18 15:18:56 +00:00
bool evaluate(OCodeList& rCodeList);
void evaluateSelection(OCodeList& rCodeList, ORowSetValueDecoratorRef const & _rVal);
bool start()
{
return evaluate(m_rCompiler->m_aCodeList);
}
void startSelection(ORowSetValueDecoratorRef const & _rVal)
2000-09-18 15:18:56 +00:00
{
evaluateSelection(m_rCompiler->m_aCodeList,_rVal);
2000-09-18 15:18:56 +00:00
}
2000-09-18 15:18:56 +00:00
};
}
}
2014-04-18 18:41:08 +02:00
#endif // INCLUDED_CONNECTIVITY_SOURCE_INC_FILE_FCOMP_HXX
2000-09-18 15:18:56 +00:00
2010-10-27 13:11:31 +01:00
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */