diff options
| author | Ted Ross <tross@apache.org> | 2010-09-21 21:48:41 +0000 |
|---|---|---|
| committer | Ted Ross <tross@apache.org> | 2010-09-21 21:48:41 +0000 |
| commit | 3cfbdf0e60c94733c0a79e94bdf8627afc6bb2a4 (patch) | |
| tree | e33d57bca9a2c2275e76f882484ac3ea913e83fd /cpp/src/qmf/SchemaMethod.cpp | |
| parent | 449ab0f1062c0eac0234f84556de60436ba2ee9d (diff) | |
| download | qpid-python-3cfbdf0e60c94733c0a79e94bdf8627afc6bb2a4.tar.gz | |
QMFv2 Additions:
- QMFv2 schema encoding completed
- Schema queries handled by the agent and initiated by the console by user request
- Full query support with predicates evaluated on the agent (regex not yet implemented)
- Agent filtering in the console
- Agent aging in the console
- Unit tests
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@999662 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qmf/SchemaMethod.cpp')
| -rw-r--r-- | cpp/src/qmf/SchemaMethod.cpp | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/cpp/src/qmf/SchemaMethod.cpp b/cpp/src/qmf/SchemaMethod.cpp index 7ee6646ec4..e8dcfd2401 100644 --- a/cpp/src/qmf/SchemaMethod.cpp +++ b/cpp/src/qmf/SchemaMethod.cpp @@ -68,10 +68,48 @@ SchemaMethodImpl::SchemaMethodImpl(const string& n, const string& options) : nam } } -SchemaMethodImpl::SchemaMethodImpl(const qpid::types::Variant::Map&) + +SchemaMethodImpl::SchemaMethodImpl(const qpid::types::Variant::Map& map) +{ + Variant::Map::const_iterator iter; + Variant::List::const_iterator lIter; + + iter = map.find("_name"); + if (iter == map.end()) + throw QmfException("SchemaMethod without a _name element"); + name = iter->second.asString(); + + iter = map.find("_desc"); + if (iter != map.end()) + desc = iter->second.asString(); + + iter = map.find("_arguments"); + if (iter != map.end()) { + const Variant::List& argList(iter->second.asList()); + for (lIter = argList.begin(); lIter != argList.end(); lIter++) + addArgument(SchemaProperty(new SchemaPropertyImpl(lIter->asMap()))); + } +} + + +Variant::Map SchemaMethodImpl::asMap() const { + Variant::Map map; + Variant::List argList; + + map["_name"] = name; + + if (!desc.empty()) + map["_desc"] = desc; + + for (list<SchemaProperty>::const_iterator iter = arguments.begin(); iter != arguments.end(); iter++) + argList.push_back(SchemaPropertyImplAccess::get(*iter).asMap()); + map["_arguments"] = argList; + + return map; } + SchemaMethodImpl::SchemaMethodImpl(qpid::management::Buffer& buffer) { Variant::Map::const_iterator iter; |
