本文整理汇总了C++中qpid::types::variant::Map::find方法的典型用法代码示例。如果您正苦于以下问题:C++ Map::find方法的具体用法?C++ Map::find怎么用?C++ Map::find使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类qpid::types::variant::Map
的用法示例。
在下文中一共展示了Map::find方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: doMethod
void Parent::doMethod (string& methodName, const ::qpid::types::Variant::Map& inMap, ::qpid::types::Variant::Map& outMap, const string& userId)
{
Manageable::status_t status = Manageable::STATUS_UNKNOWN_METHOD;
std::string text;
if (methodName == "create_child") {
ArgsParentCreate_child ioArgs;
::qpid::types::Variant::Map::const_iterator _i;
if ((_i = inMap.find("name")) != inMap.end()) {
ioArgs.i_name = (_i->second).getString();
} else {
ioArgs.i_name = "";
}
bool allow = coreObject->AuthorizeMethod(METHOD_CREATE_CHILD, ioArgs, userId);
if (allow)
status = coreObject->ManagementMethod (METHOD_CREATE_CHILD, ioArgs, text);
else
status = Manageable::STATUS_FORBIDDEN;
outMap["_status_code"] = (uint32_t) status;
outMap["_status_text"] = ::qpid::management::Manageable::StatusText(status, text);
outMap["childRef"] = ::qpid::types::Variant(ioArgs.o_childRef);
return;
}
outMap["_status_code"] = (uint32_t) status;
outMap["_status_text"] = Manageable::StatusText(status, text);
}
示例2: mapDecodeValues
void Parent::mapDecodeValues (const ::qpid::types::Variant::Map& _map)
{
::qpid::types::Variant::Map::const_iterator _i;
Mutex::ScopedLock mutex(accessLock);
if ((_i = _map.find("name")) != _map.end()) {
name = (_i->second).getString();
} else {
name = "";
}
}
示例3: mapDecodeValues
void Journal::mapDecodeValues (const ::qpid::types::Variant::Map& _map)
{
::qpid::types::Variant::Map::const_iterator _i;
Mutex::ScopedLock mutex(accessLock);
if ((_i = _map.find("queueRef")) != _map.end()) {
queueRef = _i->second;
}
if ((_i = _map.find("name")) != _map.end()) {
name = (_i->second).getString();
}
if ((_i = _map.find("directory")) != _map.end()) {
directory = (_i->second).getString();
}
if ((_i = _map.find("bdbDir")) != _map.end()) {
bdbDir = (_i->second).getString();
}
if ((_i = _map.find("num_jfiles")) != _map.end()) {
num_jfiles = _i->second;
}
}
示例4: mapDecodeValues
void TestObject::mapDecodeValues (const ::qpid::types::Variant::Map& _map)
{
::qpid::types::Variant::Map::const_iterator _i;
Mutex::ScopedLock mutex(accessLock);
if ((_i = _map.find("string1")) != _map.end()) {
string1 = (_i->second).getString();
} else {
string1 = "";
}
if ((_i = _map.find("bool1")) != _map.end()) {
bool1 = _i->second;
} else {
bool1 = false;
}
if ((_i = _map.find("map1")) != _map.end()) {
map1 = (_i->second).asMap();
} else {
map1 = ::qpid::types::Variant::Map();
}
}
示例5: mapDecodeValues
void Acl::mapDecodeValues (const ::qpid::types::Variant::Map& _map)
{
::qpid::types::Variant::Map::const_iterator _i;
Mutex::ScopedLock mutex(accessLock);
if ((_i = _map.find("brokerRef")) != _map.end()) {
brokerRef = _i->second;
} else {
brokerRef = ::qpid::management::ObjectId();
}
if ((_i = _map.find("policyFile")) != _map.end()) {
policyFile = (_i->second).getString();
} else {
policyFile = "";
}
if ((_i = _map.find("enforcingAcl")) != _map.end()) {
enforcingAcl = _i->second;
} else {
enforcingAcl = false;
}
if ((_i = _map.find("transferAcl")) != _map.end()) {
transferAcl = _i->second;
} else {
transferAcl = false;
}
if ((_i = _map.find("lastAclLoad")) != _map.end()) {
lastAclLoad = _i->second;
} else {
lastAclLoad = 0;
}
if ((_i = _map.find("maxConnections")) != _map.end()) {
maxConnections = _i->second;
} else {
maxConnections = 0;
}
if ((_i = _map.find("maxConnectionsPerIp")) != _map.end()) {
maxConnectionsPerIp = _i->second;
} else {
maxConnectionsPerIp = 0;
}
if ((_i = _map.find("maxConnectionsPerUser")) != _map.end()) {
maxConnectionsPerUser = _i->second;
} else {
maxConnectionsPerUser = 0;
}
}
示例6: mapDecodeValues
void Queue::mapDecodeValues (const ::qpid::types::Variant::Map& _map)
{
::qpid::types::Variant::Map::const_iterator _i;
Mutex::ScopedLock mutex(accessLock);
bool _found;
if ((_i = _map.find("vhostRef")) != _map.end()) {
vhostRef = _i->second;
} else {
vhostRef = ::qpid::management::ObjectId();
}
if ((_i = _map.find("name")) != _map.end()) {
name = (_i->second).getString();
} else {
name = "";
}
if ((_i = _map.find("durable")) != _map.end()) {
durable = _i->second;
} else {
durable = false;
}
if ((_i = _map.find("autoDelete")) != _map.end()) {
autoDelete = _i->second;
} else {
autoDelete = false;
}
if ((_i = _map.find("exclusive")) != _map.end()) {
exclusive = _i->second;
} else {
exclusive = false;
}
if ((_i = _map.find("arguments")) != _map.end()) {
arguments = (_i->second).asMap();
} else {
arguments = ::qpid::types::Variant::Map();
}
_found = false;
if ((_i = _map.find("altExchange")) != _map.end()) {
altExchange = _i->second;
_found = true;
} else {
altExchange = ::qpid::management::ObjectId();
}
if (_found) {
presenceMask[presenceByte_altExchange] |= presenceMask_altExchange;
}
}
示例7: createObject
bool Interconnects::createObject(Broker& broker, const std::string& type, const std::string& name, const qpid::types::Variant::Map& properties,
const std::string& /*userId*/, const std::string& /*connectionId*/)
{
if (type == DOMAIN_TYPE) {
qpid::sys::ScopedLock<qpid::sys::Mutex> l(lock);
DomainMap::iterator i = domains.find(name);
if (i == domains.end()) {
boost::shared_ptr<Domain> domain(new Domain(name, properties, broker));
domains[name] = domain;
if (domain->isDurable()) broker.getStore().create(*domain);
return true;
} else {
return false;
}
} else if (type == INCOMING_TYPE || type == OUTGOING_TYPE) {
QPID_LOG(notice, "Creating interconnect " << name << ", " << properties);
boost::shared_ptr<Domain> domain;
{
qpid::sys::ScopedLock<qpid::sys::Mutex> l(lock);
qpid::types::Variant::Map::const_iterator p = properties.find(DOMAIN_TYPE);
if (p != properties.end()) {
std::string domainName = p->second;
DomainMap::iterator i = domains.find(domainName);
if (i != domains.end()) {
domain = i->second;
} else {
throw qpid::Exception(QPID_MSG("No such domain: " << domainName));
}
} else {
throw qpid::Exception(QPID_MSG("Domain must be specified"));
}
}
domain->connect(type == INCOMING_TYPE, name, properties, *context);
return true;
} else {
return false;
}
}
示例8: doMethod
void Broker::doMethod (string& methodName, const ::qpid::types::Variant::Map& inMap, ::qpid::types::Variant::Map& outMap, const string& userId)
{
Manageable::status_t status = Manageable::STATUS_UNKNOWN_METHOD;
std::string text;
if (methodName == "echo") {
ArgsBrokerEcho ioArgs;
::qpid::types::Variant::Map::const_iterator _i;
if ((_i = inMap.find("sequence")) != inMap.end()) {
ioArgs.io_sequence = _i->second;
} else {
ioArgs.io_sequence = 0;
}
if ((_i = inMap.find("body")) != inMap.end()) {
ioArgs.io_body = (_i->second).getString();
} else {
ioArgs.io_body = "";
}
bool allow = coreObject->AuthorizeMethod(METHOD_ECHO, ioArgs, userId);
if (allow)
status = coreObject->ManagementMethod (METHOD_ECHO, ioArgs, text);
else
status = Manageable::STATUS_FORBIDDEN;
outMap["_status_code"] = (uint32_t) status;
outMap["_status_text"] = ::qpid::management::Manageable::StatusText(status, text);
outMap["sequence"] = ::qpid::types::Variant(ioArgs.io_sequence);
outMap["body"] = ::qpid::types::Variant(ioArgs.io_body);
return;
}
if (methodName == "connect") {
ArgsBrokerConnect ioArgs;
::qpid::types::Variant::Map::const_iterator _i;
if ((_i = inMap.find("host")) != inMap.end()) {
ioArgs.i_host = (_i->second).getString();
} else {
ioArgs.i_host = "";
}
if ((_i = inMap.find("port")) != inMap.end()) {
ioArgs.i_port = _i->second;
} else {
ioArgs.i_port = 0;
}
if ((_i = inMap.find("durable")) != inMap.end()) {
ioArgs.i_durable = _i->second;
} else {
ioArgs.i_durable = false;
}
if ((_i = inMap.find("authMechanism")) != inMap.end()) {
ioArgs.i_authMechanism = (_i->second).getString();
} else {
ioArgs.i_authMechanism = "";
}
if ((_i = inMap.find("username")) != inMap.end()) {
ioArgs.i_username = (_i->second).getString();
} else {
ioArgs.i_username = "";
}
if ((_i = inMap.find("password")) != inMap.end()) {
ioArgs.i_password = (_i->second).getString();
} else {
ioArgs.i_password = "";
}
if ((_i = inMap.find("transport")) != inMap.end()) {
ioArgs.i_transport = (_i->second).getString();
} else {
ioArgs.i_transport = "";
}
bool allow = coreObject->AuthorizeMethod(METHOD_CONNECT, ioArgs, userId);
if (allow)
status = coreObject->ManagementMethod (METHOD_CONNECT, ioArgs, text);
else
status = Manageable::STATUS_FORBIDDEN;
outMap["_status_code"] = (uint32_t) status;
outMap["_status_text"] = ::qpid::management::Manageable::StatusText(status, text);
return;
}
if (methodName == "queueMoveMessages") {
ArgsBrokerQueueMoveMessages ioArgs;
::qpid::types::Variant::Map::const_iterator _i;
if ((_i = inMap.find("srcQueue")) != inMap.end()) {
ioArgs.i_srcQueue = (_i->second).getString();
} else {
ioArgs.i_srcQueue = "";
}
if ((_i = inMap.find("destQueue")) != inMap.end()) {
ioArgs.i_destQueue = (_i->second).getString();
} else {
ioArgs.i_destQueue = "";
}
if ((_i = inMap.find("qty")) != inMap.end()) {
ioArgs.i_qty = _i->second;
} else {
ioArgs.i_qty = 0;
}
if ((_i = inMap.find("filter")) != inMap.end()) {
ioArgs.i_filter = (_i->second).asMap();
} else {
//.........这里部分代码省略.........
示例9: mapDecodeValues
void Broker::mapDecodeValues (const ::qpid::types::Variant::Map& _map)
{
::qpid::types::Variant::Map::const_iterator _i;
Mutex::ScopedLock mutex(accessLock);
bool _found;
if ((_i = _map.find("name")) != _map.end()) {
name = (_i->second).getString();
} else {
name = "";
}
if ((_i = _map.find("systemRef")) != _map.end()) {
systemRef = _i->second;
} else {
systemRef = ::qpid::management::ObjectId();
}
if ((_i = _map.find("port")) != _map.end()) {
port = _i->second;
} else {
port = 0;
}
if ((_i = _map.find("workerThreads")) != _map.end()) {
workerThreads = _i->second;
} else {
workerThreads = 0;
}
if ((_i = _map.find("connBacklog")) != _map.end()) {
connBacklog = _i->second;
} else {
connBacklog = 0;
}
if ((_i = _map.find("stagingThreshold")) != _map.end()) {
stagingThreshold = _i->second;
} else {
stagingThreshold = 0;
}
if ((_i = _map.find("mgmtPublish")) != _map.end()) {
mgmtPublish = _i->second;
} else {
mgmtPublish = false;
}
if ((_i = _map.find("mgmtPubInterval")) != _map.end()) {
mgmtPubInterval = _i->second;
} else {
mgmtPubInterval = 0;
}
if ((_i = _map.find("version")) != _map.end()) {
version = (_i->second).getString();
} else {
version = "";
}
_found = false;
if ((_i = _map.find("dataDir")) != _map.end()) {
dataDir = (_i->second).getString();
_found = true;
} else {
dataDir = "";
}
if (_found) {
presenceMask[presenceByte_dataDir] |= presenceMask_dataDir;
}
}
示例10: doMethod
void Queue::doMethod (string& methodName, const ::qpid::types::Variant::Map& inMap, ::qpid::types::Variant::Map& outMap, const string& userId)
{
Manageable::status_t status = Manageable::STATUS_UNKNOWN_METHOD;
std::string text;
if (methodName == "purge") {
ArgsQueuePurge ioArgs;
::qpid::types::Variant::Map::const_iterator _i;
if ((_i = inMap.find("request")) != inMap.end()) {
ioArgs.i_request = _i->second;
} else {
ioArgs.i_request = 0;
}
if ((_i = inMap.find("filter")) != inMap.end()) {
ioArgs.i_filter = (_i->second).asMap();
} else {
ioArgs.i_filter = ::qpid::types::Variant::Map();
}
bool allow = coreObject->AuthorizeMethod(METHOD_PURGE, ioArgs, userId);
if (allow)
status = coreObject->ManagementMethod (METHOD_PURGE, ioArgs, text);
else
status = Manageable::STATUS_FORBIDDEN;
outMap["_status_code"] = (uint32_t) status;
outMap["_status_text"] = ::qpid::management::Manageable::StatusText(status, text);
return;
}
if (methodName == "reroute") {
ArgsQueueReroute ioArgs;
::qpid::types::Variant::Map::const_iterator _i;
if ((_i = inMap.find("request")) != inMap.end()) {
ioArgs.i_request = _i->second;
} else {
ioArgs.i_request = 0;
}
if ((_i = inMap.find("useAltExchange")) != inMap.end()) {
ioArgs.i_useAltExchange = _i->second;
} else {
ioArgs.i_useAltExchange = false;
}
if ((_i = inMap.find("exchange")) != inMap.end()) {
ioArgs.i_exchange = (_i->second).getString();
} else {
ioArgs.i_exchange = "";
}
if ((_i = inMap.find("filter")) != inMap.end()) {
ioArgs.i_filter = (_i->second).asMap();
} else {
ioArgs.i_filter = ::qpid::types::Variant::Map();
}
bool allow = coreObject->AuthorizeMethod(METHOD_REROUTE, ioArgs, userId);
if (allow)
status = coreObject->ManagementMethod (METHOD_REROUTE, ioArgs, text);
else
status = Manageable::STATUS_FORBIDDEN;
outMap["_status_code"] = (uint32_t) status;
outMap["_status_text"] = ::qpid::management::Manageable::StatusText(status, text);
return;
}
outMap["_status_code"] = (uint32_t) status;
outMap["_status_text"] = Manageable::StatusText(status, text);
}
示例11: doMethod
void Acl::doMethod (string& methodName, const ::qpid::types::Variant::Map& inMap, ::qpid::types::Variant::Map& outMap, const string& userId)
{
Manageable::status_t status = Manageable::STATUS_UNKNOWN_METHOD;
std::string text;
if (methodName == "reloadACLFile") {
::qpid::management::ArgsNone ioArgs;
bool allow = coreObject->AuthorizeMethod(METHOD_RELOADACLFILE, ioArgs, userId);
if (allow)
status = coreObject->ManagementMethod (METHOD_RELOADACLFILE, ioArgs, text);
else
status = Manageable::STATUS_FORBIDDEN;
outMap["_status_code"] = (uint32_t) status;
outMap["_status_text"] = ::qpid::management::Manageable::StatusText(status, text);
return;
}
if (methodName == "Lookup") {
ArgsAclLookup ioArgs;
::qpid::types::Variant::Map::const_iterator _i;
if ((_i = inMap.find("userId")) != inMap.end()) {
ioArgs.i_userId = (_i->second).getString();
} else {
ioArgs.i_userId = "";
}
if ((_i = inMap.find("action")) != inMap.end()) {
ioArgs.i_action = (_i->second).getString();
} else {
ioArgs.i_action = "";
}
if ((_i = inMap.find("object")) != inMap.end()) {
ioArgs.i_object = (_i->second).getString();
} else {
ioArgs.i_object = "";
}
if ((_i = inMap.find("objectName")) != inMap.end()) {
ioArgs.i_objectName = (_i->second).getString();
} else {
ioArgs.i_objectName = "";
}
if ((_i = inMap.find("propertyMap")) != inMap.end()) {
ioArgs.i_propertyMap = (_i->second).asMap();
} else {
ioArgs.i_propertyMap = ::qpid::types::Variant::Map();
}
bool allow = coreObject->AuthorizeMethod(METHOD_LOOKUP, ioArgs, userId);
if (allow)
status = coreObject->ManagementMethod (METHOD_LOOKUP, ioArgs, text);
else
status = Manageable::STATUS_FORBIDDEN;
outMap["_status_code"] = (uint32_t) status;
outMap["_status_text"] = ::qpid::management::Manageable::StatusText(status, text);
outMap["result"] = ::qpid::types::Variant(ioArgs.o_result);
return;
}
if (methodName == "LookupPublish") {
ArgsAclLookupPublish ioArgs;
::qpid::types::Variant::Map::const_iterator _i;
if ((_i = inMap.find("userId")) != inMap.end()) {
ioArgs.i_userId = (_i->second).getString();
} else {
ioArgs.i_userId = "";
}
if ((_i = inMap.find("exchangeName")) != inMap.end()) {
ioArgs.i_exchangeName = (_i->second).getString();
} else {
ioArgs.i_exchangeName = "";
}
if ((_i = inMap.find("routingKey")) != inMap.end()) {
ioArgs.i_routingKey = (_i->second).getString();
} else {
ioArgs.i_routingKey = "";
}
bool allow = coreObject->AuthorizeMethod(METHOD_LOOKUPPUBLISH, ioArgs, userId);
if (allow)
status = coreObject->ManagementMethod (METHOD_LOOKUPPUBLISH, ioArgs, text);
else
status = Manageable::STATUS_FORBIDDEN;
outMap["_status_code"] = (uint32_t) status;
outMap["_status_text"] = ::qpid::management::Manageable::StatusText(status, text);
outMap["result"] = ::qpid::types::Variant(ioArgs.o_result);
return;
}
outMap["_status_code"] = (uint32_t) status;
outMap["_status_text"] = Manageable::StatusText(status, text);
}
示例12: mapDecodeValues
void Connection::mapDecodeValues (const ::qpid::types::Variant::Map& _map)
{
::qpid::types::Variant::Map::const_iterator _i;
Mutex::ScopedLock mutex(accessLock);
bool _found;
if ((_i = _map.find("vhostRef")) != _map.end()) {
vhostRef = _i->second;
} else {
vhostRef = ::qpid::management::ObjectId();
}
if ((_i = _map.find("address")) != _map.end()) {
address = (_i->second).getString();
} else {
address = "";
}
if ((_i = _map.find("incoming")) != _map.end()) {
incoming = _i->second;
} else {
incoming = false;
}
if ((_i = _map.find("SystemConnection")) != _map.end()) {
SystemConnection = _i->second;
} else {
SystemConnection = false;
}
if ((_i = _map.find("userProxyAuth")) != _map.end()) {
userProxyAuth = _i->second;
} else {
userProxyAuth = false;
}
if ((_i = _map.find("federationLink")) != _map.end()) {
federationLink = _i->second;
} else {
federationLink = false;
}
if ((_i = _map.find("authIdentity")) != _map.end()) {
authIdentity = (_i->second).getString();
} else {
authIdentity = "";
}
_found = false;
if ((_i = _map.find("remoteProcessName")) != _map.end()) {
remoteProcessName = (_i->second).getString();
_found = true;
} else {
remoteProcessName = "";
}
if (_found) {
presenceMask[presenceByte_remoteProcessName] |= presenceMask_remoteProcessName;
}
_found = false;
if ((_i = _map.find("remotePid")) != _map.end()) {
remotePid = _i->second;
_found = true;
} else {
remotePid = 0;
}
if (_found) {
presenceMask[presenceByte_remotePid] |= presenceMask_remotePid;
}
_found = false;
if ((_i = _map.find("remoteParentPid")) != _map.end()) {
remoteParentPid = _i->second;
_found = true;
} else {
remoteParentPid = 0;
}
if (_found) {
presenceMask[presenceByte_remoteParentPid] |= presenceMask_remoteParentPid;
}
if ((_i = _map.find("shadow")) != _map.end()) {
shadow = _i->second;
} else {
shadow = false;
}
if ((_i = _map.find("saslMechanism")) != _map.end()) {
saslMechanism = (_i->second).getString();
} else {
saslMechanism = "";
}
if ((_i = _map.find("saslSsf")) != _map.end()) {
saslSsf = _i->second;
} else {
saslSsf = 0;
}
}