diff options
| author | Ted Ross <tross@apache.org> | 2011-01-10 14:06:16 +0000 |
|---|---|---|
| committer | Ted Ross <tross@apache.org> | 2011-01-10 14:06:16 +0000 |
| commit | 120ea440ef9d048d3bb31e6118027f5c9e890fca (patch) | |
| tree | 34e14880765c6b79c77c4fb24e834b8d67260149 /cpp/src/qmf/DataImpl.h | |
| parent | 598e5eacac716a9a3a812e9cf72b14bde57ed45a (diff) | |
| download | qpid-python-120ea440ef9d048d3bb31e6118027f5c9e890fca.tar.gz | |
Updates to the C++ implementation of QMFv2:
1) Consolidated string constants for the protocol into a definition file.
2) Added hooks for subscription handling.
3) Added checks to validate properties and arguments against the schema (if there is a schema).
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1057199 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qmf/DataImpl.h')
| -rw-r--r-- | cpp/src/qmf/DataImpl.h | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/cpp/src/qmf/DataImpl.h b/cpp/src/qmf/DataImpl.h index 38b62791fc..4ac3197da0 100644 --- a/cpp/src/qmf/DataImpl.h +++ b/cpp/src/qmf/DataImpl.h @@ -24,8 +24,10 @@ #include "qpid/RefCounted.h" #include "qmf/Data.h" #include "qmf/SchemaId.h" +#include "qmf/Schema.h" #include "qmf/DataAddr.h" #include "qmf/Agent.h" +#include "qmf/AgentSubscription.h" #include "qpid/types/Variant.h" namespace qmf { @@ -37,18 +39,21 @@ namespace qmf { DataImpl(const qpid::types::Variant::Map&, const Agent&); qpid::types::Variant::Map asMap() const; DataImpl() {} + void addSubscription(boost::shared_ptr<AgentSubscription>); + void delSubscription(uint64_t); + qpid::types::Variant::Map publishSubscription(uint64_t); + const Schema& getSchema() const { return schema; } // // Methods from API handle // - DataImpl(const SchemaId& s) : schemaId(s) {} - void setSchema(const SchemaId& s) { schemaId = s; } + DataImpl(const Schema& s) : schema(s) {} void setAddr(const DataAddr& a) { dataAddr = a; } - void setProperty(const std::string& k, const qpid::types::Variant& v) { properties[k] = v; } + void setProperty(const std::string& k, const qpid::types::Variant& v); void overwriteProperties(const qpid::types::Variant::Map& m); - bool hasSchema() const { return schemaId.isValid(); } + bool hasSchema() const { return schemaId.isValid() || schema.isValid(); } bool hasAddr() const { return dataAddr.isValid(); } - const SchemaId& getSchemaId() const { return schemaId; } + const SchemaId& getSchemaId() const { if (schema.isValid()) return schema.getSchemaId(); else return schemaId; } const DataAddr& getAddr() const { return dataAddr; } const qpid::types::Variant& getProperty(const std::string& k) const; const qpid::types::Variant::Map& getProperties() const { return properties; } @@ -56,7 +61,14 @@ namespace qmf { const Agent& getAgent() const { return agent; } private: + struct Subscr { + boost::shared_ptr<AgentSubscription> subscription; + qpid::types::Variant::Map deltas; + }; + std::map<uint64_t, boost::shared_ptr<Subscr> > subscriptions; + SchemaId schemaId; + Schema schema; DataAddr dataAddr; qpid::types::Variant::Map properties; Agent agent; |
