本文整理汇总了C++中list::const_iterator::get方法的典型用法代码示例。如果您正苦于以下问题:C++ const_iterator::get方法的具体用法?C++ const_iterator::get怎么用?C++ const_iterator::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类list::const_iterator
的用法示例。
在下文中一共展示了const_iterator::get方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initList
void ValueImpl::initList(const List& fl)
{
for (List::const_iterator iter = fl.begin();
iter != fl.end(); iter++) {
const FieldValue& fvalue(*iter->get());
uint8_t amqType = fvalue.getType();
if (amqType == 0x32) {
Value* subval(new Value(TYPE_UINT64));
subval->setUint64(fvalue.get<int64_t>());
appendToList(subval);
} else if ((amqType & 0xCF) == 0x02) {
Value* subval(new Value(TYPE_UINT32));
switch (amqType) {
case 0x02 : subval->setUint(fvalue.get<int>()); break; // uint8
case 0x12 : subval->setUint(fvalue.get<int>()); break; // uint16
case 0x22 : subval->setUint(fvalue.get<int>()); break; // uint32
}
appendToList(subval);
} else if (amqType == 0x31) { // int64
Value* subval(new Value(TYPE_INT64));
subval->setInt64(fvalue.get<int64_t>());
appendToList(subval);
} else if ((amqType & 0xCF) == 0x01) { // 0x01:int8, 0x11:int16, 0x21:int32
Value* subval(new Value(TYPE_INT32));
subval->setInt((int32_t)fvalue.get<int>());
appendToList(subval);
} else if (amqType == 0x85 || amqType == 0x95) {
Value* subval(new Value(TYPE_LSTR));
subval->setString(fvalue.get<string>().c_str());
appendToList(subval);
} else if (amqType == 0x23 || amqType == 0x33) {
Value* subval(new Value(TYPE_DOUBLE));
subval->setDouble(fvalue.get<double>());
appendToList(subval);
} else if (amqType == 0xa8) {
FieldTable subFt;
bool valid = qpid::framing::getEncodedValue<FieldTable>(*iter, subFt);
if (valid) {
Value* subval(new Value(TYPE_MAP));
subval->impl->initMap(subFt);
appendToList(subval);
}
} else if (amqType == 0xa9) {
List subList;
bool valid = qpid::framing::getEncodedValue<List>(*iter, subList);
if (valid) {
Value *subVal(new Value(TYPE_LIST));
subVal->impl->initList(subList);
appendToList(subVal);
}
} else if (amqType == 0x08) {
Value* subval(new Value(TYPE_BOOL));
subval->setBool(fvalue.get<int>() ? true : false);
appendToList(subval);
} else {
QPID_LOG(error, "Unable to decode unsupported AMQP typecode =" << amqType);
}
}
}
示例2: find
Factory* find (std::string const& name) const
{
for (List::const_iterator iter (m_list.begin ());
iter != m_list.end (); ++iter)
if ((*iter)->getName().compareIgnoreCase (name) == 0)
return iter->get();
return nullptr;
}