本文整理汇总了C++中list::const_iterator类的典型用法代码示例。如果您正苦于以下问题:C++ const_iterator类的具体用法?C++ const_iterator怎么用?C++ const_iterator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了const_iterator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: connectPeerEndpoints
void connectPeerEndpoints (std::vector <IPAddress> const& list)
{
typedef std::vector <IPAddress> List;
for (List::const_iterator iter (list.begin());
iter != list.end(); ++iter)
peerConnect (iter->withPort (0), iter->port());
}
示例3: 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;
}
示例4: getFileNameSuffix
docstring BranchList::getFileNameSuffix() const
{
docstring result;
List::const_iterator it = list.begin();
for (; it != list.end(); ++it) {
if (it->isSelected() && it->hasFileNameSuffix())
result += "-" + it->branch();
}
return support::subst(result, from_ascii("/"), from_ascii("_"));
}
示例5: WriteMessageBody
int ReportVisualSensorCapabilities::WriteMessageBody(Packet& packet) const
{
unsigned int startPos = packet.GetWritePos();
UShort count = (UShort)mSensorList.size();
List::const_iterator sensor = mSensorList.begin();
packet.Write(count);
while(sensor != mSensorList.end())
{
sensor->WriteMessageBody(packet);
sensor++;
}
return packet.GetWritePos() - startPos;
}
示例6: PrintMessageBody
void SetAnalogVideoSensorConfigurations::PrintMessageBody() const
{
std::cout << "Sensor Count: " << mSensorList.size() << std::endl;
UShort count = (UShort)mSensorList.size();
List::const_iterator sensor = mSensorList.begin();
while(sensor != mSensorList.end())
{
std::cout << "<Sensor>" << std::endl;
sensor->PrintSensorFields();
std::cout << "</Sensor>" << std::endl;
sensor++;
}
}
示例7: PrintMessageBody
void QueryRangeSensorCapabilities::PrintMessageBody() const
{
std::cout << "Sensor Count: " << mSensorList.size() << std::endl;
UShort count = (UShort)mSensorList.size();
List::const_iterator sensor = mSensorList.begin();
while(sensor != mSensorList.end())
{
std::cout << "<Sensor>" << std::endl;
sensor->PrintSensorFields();
std::cout << "</Sensor>" << std::endl;
sensor++;
}
}
示例8: printf
void
triggers::print (const std::string & seqname) const
{
printf("sequence '%s' triggers:\n", seqname.c_str());
for (List::const_iterator i = m_triggers.begin(); i != m_triggers.end(); ++i)
{
printf
(
" tick_start = %ld; tick_end = %ld; offset = %ld; selected = %s\n",
i->tick_start(), i->tick_end(), i->offset(),
bool_string(i->selected())
);
}
}
示例9: WriteMessageBody
int QueryStillImageSensorConfigurations::WriteMessageBody(Packet& packet) const
{
UInt startPos = packet.GetWritePos();
UShort count = (UShort)mSensorList.size();
List::const_iterator stillImageSensorConfigurations = mSensorList.begin();
packet.Write(count);
while(stillImageSensorConfigurations != mSensorList.end())
{
packet.Write(stillImageSensorConfigurations->GetSensorId()); //required
packet.Write(stillImageSensorConfigurations->GetPresenceVector()); //required
stillImageSensorConfigurations++;
}
return packet.GetWritePos() - startPos;
}
示例10: WriteMessageBody
int QueryRangeSensorCapabilities::WriteMessageBody(Packet& packet) const
{
UInt startPos = packet.GetWritePos();
UShort count = (UShort)mSensorList.size();
List::const_iterator sensor = mSensorList.begin();
packet.Write(count);
while(sensor != mSensorList.end())
{
packet.Write(sensor->GetSensorId()); //required
packet.Write(sensor->GetPresenceVector()); //required
sensor++;
}
return packet.GetWritePos() - startPos;
}
示例11: WriteMessageBody
int SetAnalogVideoSensorConfigurations::WriteMessageBody(Packet& packet) const
{
UInt startPos = packet.GetWritePos();
Byte requestId = mRequestId;
UShort count = (UShort)mSensorList.size();
List::const_iterator sensor = mSensorList.begin();
packet.Write(requestId);
packet.Write(count);
while(sensor != mSensorList.end())
{
sensor->WriteMessageBody(packet);
sensor++;
}
return packet.GetWritePos() - startPos;
}
示例12: WriteMessageBody
int QueryVisualSensorConfigurations::WriteMessageBody(Packet& packet) const
{
UInt startPos = packet.GetWritePos();
UShort count = (UShort)mSensorList.size();
List::const_iterator visualSensorConfiguration = mSensorList.begin();
packet.Write(count);
while(visualSensorConfiguration != mSensorList.end())
{
packet.Write(visualSensorConfiguration->GetSensorID()); //required
packet.Write(visualSensorConfiguration->GetPresenceVector()); //required
visualSensorConfiguration++;
}
return packet.GetWritePos() - startPos;
}
示例13: IsLargeDataSet
bool ReportVisualSensorCapabilities::IsLargeDataSet(const UInt maxPayloadSize) const
{
//Quick Check to possibly avoid the time consuming loop (assume worst case of all fields supported)
if(maxPayloadSize > (BYTE_SIZE * 10 + USHORT_SIZE * 6 + UINT_SIZE * 2) * mSensorList.size())
{
return false;
}
UInt currentSize = 0;
List::const_iterator iter = mSensorList.begin();
while(iter != mSensorList.end())
{
currentSize += iter->GetSize();
iter++;
}
return currentSize > maxPayloadSize;
}
示例14: while
std::ostream & OptionChecker::str_s(std::ostream & os) const
{
os << this->checker_name() << '(';
str_type sep = "";
if(! this->_options.empty())
{
List::const_iterator i = this->_options.begin();
os << i->grepr(ReprType::CONFIGSPEC);
sep = ", ";
while(++i != this->_options.end())
{
os << sep << i->grepr(ReprType::CONFIGSPEC);
}
}
if(this->_has_default)
{
os << sep << "default=";
this->_default.grepr_s(os, ReprType::CONFIGSPEC);
}
os << ')';
return os;
}
示例15: highestInRange
FontSize FontList::highestInRange(pos_type startpos, pos_type endpos,
FontSize def_size) const
{
if (list_.empty())
return def_size;
List::const_iterator end_it = fontIterator(endpos);
const_iterator const end = list_.end();
if (end_it != end)
++end_it;
List::const_iterator cit = fontIterator(startpos);
FontSize maxsize = FONT_SIZE_TINY;
for (; cit != end_it; ++cit) {
FontSize size = cit->font().fontInfo().size();
if (size == FONT_SIZE_INHERIT)
size = def_size;
if (size > maxsize && size <= FONT_SIZE_HUGER)
maxsize = size;
}
return maxsize;
}