diff options
author | Ted Ross <tross@apache.org> | 2009-09-18 20:15:15 +0000 |
---|---|---|
committer | Ted Ross <tross@apache.org> | 2009-09-18 20:15:15 +0000 |
commit | c8fa5fa308f6ad9be22612568ace703777fbb6d9 (patch) | |
tree | 148275652ac2572ef4bb0863736a337a5d1617e2 /qpid/cpp/src/qmf/QueryImpl.cpp | |
parent | d3c07faea48e2dbd57cf27fac2d9940ca6456a69 (diff) | |
download | qpid-python-c8fa5fa308f6ad9be22612568ace703777fbb6d9.tar.gz |
Refactored the QMF engine to adhere to the following rules regarding
the pimpl (Pointer to Implementation) pattern:
1) Impl classes have constructors matching the public constructors
2) Additional Impl constructors are accessed through a static factory function
3) All linkages to objects are to the public object
4) If a back-link (from Impl to public) is needed, the Impl class must be
derived from boost::noncopyable
5) All public classes have non-default copy constructors that make a copy of the
Impl class
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@816770 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/qmf/QueryImpl.cpp')
-rw-r--r-- | qpid/cpp/src/qmf/QueryImpl.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/qpid/cpp/src/qmf/QueryImpl.cpp b/qpid/cpp/src/qmf/QueryImpl.cpp index f75a9aa5d5..c10bfb7018 100644 --- a/qpid/cpp/src/qmf/QueryImpl.cpp +++ b/qpid/cpp/src/qmf/QueryImpl.cpp @@ -45,6 +45,12 @@ QueryImpl::QueryImpl(Buffer& buffer) // TODO } +Query* QueryImpl::factory(Buffer& buffer) +{ + QueryImpl* impl(new QueryImpl(buffer)); + return new Query(impl); +} + void QueryImpl::encode(Buffer& buffer) const { FieldTable ft; @@ -69,14 +75,17 @@ QueryElement::QueryElement(const char* attrName, const Value* value, ValueOper o QueryElement::QueryElement(QueryElementImpl* i) : impl(i) {} QueryElement::~QueryElement() { delete impl; } bool QueryElement::evaluate(const Object* object) const { return impl->evaluate(object); } + QueryExpression::QueryExpression(ExprOper oper, const QueryOperand* operand1, const QueryOperand* operand2) : impl(new QueryExpressionImpl(oper, operand1, operand2)) {} QueryExpression::QueryExpression(QueryExpressionImpl* i) : impl(i) {} QueryExpression::~QueryExpression() { delete impl; } bool QueryExpression::evaluate(const Object* object) const { return impl->evaluate(object); } + Query::Query(const char* className, const char* packageName) : impl(new QueryImpl(className, packageName)) {} Query::Query(const SchemaClassKey* key) : impl(new QueryImpl(key)) {} Query::Query(const ObjectId* oid) : impl(new QueryImpl(oid)) {} Query::Query(QueryImpl* i) : impl(i) {} +Query::Query(const Query& from) : impl(new QueryImpl(*(from.impl))) {} Query::~Query() { delete impl; } void Query::setSelect(const QueryOperand* criterion) { impl->setSelect(criterion); } void Query::setLimit(uint32_t maxResults) { impl->setLimit(maxResults); } |