本文整理汇总了C++中ObjectSet::insert方法的典型用法代码示例。如果您正苦于以下问题:C++ ObjectSet::insert方法的具体用法?C++ ObjectSet::insert怎么用?C++ ObjectSet::insert使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObjectSet
的用法示例。
在下文中一共展示了ObjectSet::insert方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: filterData
void filterData(const std::string& filterExpr, Reader& reader)
{
Gto::Reader::Properties& properties = reader.properties();
Gto::Reader::Objects& objects = reader.objects();
for (size_t i=0; i < properties.size(); i++)
{
Gto::Reader::PropertyInfo& p = properties[i];
const Gto::Reader::ComponentInfo* c = p.component;
const Gto::Reader::ObjectInfo* o = c->object;
string name;
name = reader.stringFromId(o->name);
name += ".";
name += reader.stringFromId(c->name);
name += ".";
name += reader.stringFromId(p.name);
if (!fnmatch(filterExpr.c_str(), name.c_str(), 0))
{
filteredProperties.insert(&p);
filteredObjects.insert(o);
}
}
for (size_t i=0; i < objects.size(); i++)
{
Gto::Reader::ObjectInfo* p = &objects[i];
if (filteredObjects.find(p) != filteredObjects.end())
{
reader.accessObject(*p);
}
}
}
示例2: getModifiedObjects
void ObjectModifyingUndoStep::getModifiedObjects(int part_index, ObjectSet& out) const
{
if (part_index == getPartIndex())
{
MapPart* const map_part = map->getPart(part_index);
for (std::vector<int>::const_iterator it = modified_objects.begin(), end = modified_objects.end(); it != end; ++it)
{
Q_ASSERT(*it >= 0 && *it < map_part->getNumObjects());
out.insert(map_part->getObject(*it));
}
}
}
示例3: read_objset
bool read_objset(SerialIn &in, ObjectSet& list, const Config& config) {
#if 0
ObjectList lst;
if (!read_objlist(in, lst, config))
return false;
list.~ObjectSet();
new (&list) ObjectSet(lst.begin(), lst.end());
#else
uint32_t len;
in >= len;
for (size_t i = 0; i != len; ++i) {
rptr<Elf> obj;
if (!read_obj(in, obj, config))
return false;
list.insert(obj);
}
#endif
return in.in_;
}