diff options
| author | Ted Ross <tross@apache.org> | 2009-09-15 17:45:51 +0000 |
|---|---|---|
| committer | Ted Ross <tross@apache.org> | 2009-09-15 17:45:51 +0000 |
| commit | 1e0e8ae7d1792f1deff8089d4c26075b9a142cdd (patch) | |
| tree | 982fc02c3faaef6c7a361af531a39837c42c1884 /qpid/cpp/src/qmf/Query.h | |
| parent | c9346545c9fa32a1e124d1842a91ad1b4588e29a (diff) | |
| download | qpid-python-1e0e8ae7d1792f1deff8089d4c26075b9a142cdd.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@815416 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/qmf/Query.h')
| -rw-r--r-- | qpid/cpp/src/qmf/Query.h | 70 |
1 files changed, 60 insertions, 10 deletions
diff --git a/qpid/cpp/src/qmf/Query.h b/qpid/cpp/src/qmf/Query.h index 78bc6f4ae2..875749862e 100644 --- a/qpid/cpp/src/qmf/Query.h +++ b/qpid/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; }; |
