summaryrefslogtreecommitdiff
path: root/cpp/src/qmf/Query.h
diff options
context:
space:
mode:
authorTed Ross <tross@apache.org>2009-09-15 17:45:51 +0000
committerTed Ross <tross@apache.org>2009-09-15 17:45:51 +0000
commit3f0838479df2a5678a6093f34276b9e336af3ded (patch)
treeecceca23bb8b0d37701bb7678cb1d232a8fb4bfc /cpp/src/qmf/Query.h
parent3cf100216bc1e9c7207a3c963d984665d7a5b9a1 (diff)
downloadqpid-python-3f0838479df2a5678a6093f34276b9e336af3ded.tar.gz
QMF Console updated to the point where query (get_object) is supported.
The Ruby binding continues to track the c++ engine progress. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@815416 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qmf/Query.h')
-rw-r--r--cpp/src/qmf/Query.h70
1 files changed, 60 insertions, 10 deletions
diff --git a/cpp/src/qmf/Query.h b/cpp/src/qmf/Query.h
index 78bc6f4ae2..875749862e 100644
--- a/cpp/src/qmf/Query.h
+++ b/cpp/src/qmf/Query.h
@@ -25,26 +25,76 @@
namespace qmf {
+ struct Object;
+ struct QueryElementImpl;
struct QueryImpl;
+ struct QueryExpressionImpl;
+ struct SchemaClassKey;
+
+ enum ValueOper {
+ O_EQ = 1,
+ O_NE = 2,
+ O_LT = 3,
+ O_LE = 4,
+ O_GT = 5,
+ O_GE = 6,
+ O_RE_MATCH = 7,
+ O_RE_NOMATCH = 8
+ };
+
+ struct QueryOperand {
+ virtual ~QueryOperand() {}
+ virtual bool evaluate(const Object* object) const = 0;
+ };
+
+ struct QueryElement : public QueryOperand {
+ QueryElement(const char* attrName, const Value* value, ValueOper oper);
+ QueryElement(QueryElementImpl* impl);
+ virtual ~QueryElement();
+ bool evaluate(const Object* object) const;
+
+ QueryElementImpl* impl;
+ };
+
+ enum ExprOper {
+ E_NOT = 1,
+ E_AND = 2,
+ E_OR = 3,
+ E_XOR = 4
+ };
+
+ struct QueryExpression : public QueryOperand {
+ QueryExpression(ExprOper oper, const QueryOperand* operand1, const QueryOperand* operand2);
+ QueryExpression(QueryExpressionImpl* impl);
+ virtual ~QueryExpression();
+ bool evaluate(const Object* object) const;
+
+ QueryExpressionImpl* impl;
+ };
+
class Query {
public:
- Query();
+ Query(const char* className, const char* packageName);
+ Query(const SchemaClassKey* key);
+ Query(const ObjectId* oid);
Query(QueryImpl* impl);
~Query();
+ void setSelect(const QueryOperand* criterion);
+ void setLimit(uint32_t maxResults);
+ void setOrderBy(const char* attrName, bool decreasing);
+
const char* getPackage() const;
const char* getClass() const;
const ObjectId* getObjectId() const;
- enum Oper {
- OPER_AND = 1,
- OPER_OR = 2
- };
-
- int whereCount() const;
- Oper whereOper() const;
- const char* whereKey() const;
- const Value* whereValue() const;
+ bool haveSelect() const;
+ bool haveLimit() const;
+ bool haveOrderBy() const;
+ const QueryOperand* getSelect() const;
+ uint32_t getLimit() const;
+ const char* getOrderBy() const;
+ bool getDecreasing() const;
QueryImpl* impl;
};