summaryrefslogtreecommitdiff
path: root/cpp/src/qmf/engine/QueryImpl.h
diff options
context:
space:
mode:
authorRajith Muditha Attapattu <rajith@apache.org>2011-05-27 15:44:23 +0000
committerRajith Muditha Attapattu <rajith@apache.org>2011-05-27 15:44:23 +0000
commit66765100f4257159622cefe57bed50125a5ad017 (patch)
treea88ee23bb194eb91f0ebb2d9b23ff423e3ea8e37 /cpp/src/qmf/engine/QueryImpl.h
parent1aeaa7b16e5ce54f10c901d75c4d40f9f88b9db6 (diff)
parent88b98b2f4152ef59a671fad55a0d08338b6b78ca (diff)
downloadqpid-python-rajith_jms_client.tar.gz
Creating a branch for experimenting with some ideas for JMS client.rajith_jms_client
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/rajith_jms_client@1128369 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qmf/engine/QueryImpl.h')
-rw-r--r--cpp/src/qmf/engine/QueryImpl.h102
1 files changed, 0 insertions, 102 deletions
diff --git a/cpp/src/qmf/engine/QueryImpl.h b/cpp/src/qmf/engine/QueryImpl.h
deleted file mode 100644
index 8ebe0d932f..0000000000
--- a/cpp/src/qmf/engine/QueryImpl.h
+++ /dev/null
@@ -1,102 +0,0 @@
-#ifndef _QmfEngineQueryImpl_
-#define _QmfEngineQueryImpl_
-
-/*
- * 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
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include "qmf/engine/Query.h"
-#include "qmf/engine/Schema.h"
-#include <string>
-#include <boost/shared_ptr.hpp>
-
-namespace qpid {
- namespace framing {
- class Buffer;
- }
-}
-
-namespace qmf {
-namespace engine {
-
- struct QueryElementImpl {
- QueryElementImpl(const std::string& a, const Value* v, ValueOper o) : attrName(a), value(v), oper(o) {}
- ~QueryElementImpl() {}
- bool evaluate(const Object* object) const;
-
- std::string attrName;
- const Value* value;
- ValueOper oper;
- };
-
- struct QueryExpressionImpl {
- QueryExpressionImpl(ExprOper o, const QueryOperand* operand1, const QueryOperand* operand2) : oper(o), left(operand1), right(operand2) {}
- ~QueryExpressionImpl() {}
- bool evaluate(const Object* object) const;
-
- ExprOper oper;
- const QueryOperand* left;
- const QueryOperand* right;
- };
-
- struct QueryImpl {
- // Constructors mapped to public
- QueryImpl(const std::string& c, const std::string& p) : packageName(p), className(c), select(0), resultLimit(0) {}
- QueryImpl(const SchemaClassKey* key) : packageName(key->getPackageName()), className(key->getClassName()), select(0), resultLimit(0) {}
- QueryImpl(const ObjectId* oid) : oid(new ObjectId(*oid)), select(0), resultLimit(0) {}
-
- // Factory constructors
- QueryImpl(qpid::framing::Buffer& buffer);
-
- ~QueryImpl() {};
- static Query* factory(qpid::framing::Buffer& buffer);
-
- void setSelect(const QueryOperand* criterion) { select = criterion; }
- void setLimit(uint32_t maxResults) { resultLimit = maxResults; }
- void setOrderBy(const std::string& attrName, bool decreasing) {
- orderBy = attrName; orderDecreasing = decreasing;
- }
-
- const std::string& getPackage() const { return packageName; }
- const std::string& getClass() const { return className; }
- const ObjectId* getObjectId() const { return oid.get(); }
-
- bool haveSelect() const { return select != 0; }
- bool haveLimit() const { return resultLimit > 0; }
- bool haveOrderBy() const { return !orderBy.empty(); }
- const QueryOperand* getSelect() const { return select; }
- uint32_t getLimit() const { return resultLimit; }
- const std::string& getOrderBy() const { return orderBy; }
- bool getDecreasing() const { return orderDecreasing; }
-
- void encode(qpid::framing::Buffer& buffer) const;
- bool singleAgent() const { return oid.get() != 0; }
- uint32_t agentBank() const { return singleAgent() ? oid->getAgentBank() : 0; }
-
- std::string packageName;
- std::string className;
- boost::shared_ptr<ObjectId> oid;
- const QueryOperand* select;
- uint32_t resultLimit;
- std::string orderBy;
- bool orderDecreasing;
- };
-}
-}
-
-#endif