当前位置: 首页>>代码示例>>C++>>正文


C++ Objects::insert方法代码示例

本文整理汇总了C++中Objects::insert方法的典型用法代码示例。如果您正苦于以下问题:C++ Objects::insert方法的具体用法?C++ Objects::insert怎么用?C++ Objects::insert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Objects的用法示例。


在下文中一共展示了Objects::insert方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1:

Objects
instances(World* world, const URISet& types)
{
	LilvNode* rdf_type = lilv_new_uri(
		world->lilv_world(), LILV_NS_RDF "type");

	Objects result;
	for (const auto& t : types) {
		LilvNode*  type    = lilv_new_uri(world->lilv_world(), t.c_str());
		LilvNodes* objects = lilv_world_find_nodes(
			world->lilv_world(), NULL, rdf_type, type);
		LILV_FOREACH(nodes, o, objects) {
			const LilvNode* object = lilv_nodes_get(objects, o);
			if (!lilv_node_is_uri(object)) {
				continue;
			}
			const std::string label = RDFS::label(world, object);
			result.insert(
				std::make_pair(label,
				               Raul::URI(lilv_node_as_string(object))));
		}
		lilv_node_free(type);
	}

	lilv_node_free(rdf_type);
	return result;
}
开发者ID:ventosus,项目名称:ingen,代码行数:27,代码来源:RDFS.cpp

示例2: set

        /** \brief
        Force the pointer for the object in store to be a specific pointer.

        This can be useful for singleton values.
        These usually must be removed from the store explicitly.

        \pre No object with this value is already in the store.
        */
        void set (std::shared_ptr <Value const> pointer) {
            // The value must not be in the store yet.
            assert (objects_.find (*pointer,
                boost::hash <Value>(), EqualToWeakPtr()) == objects_.end());

            objects_.insert (std::move (pointer));
        }
开发者ID:guker,项目名称:flipsta,代码行数:15,代码来源:sole.hpp

示例3:

void
Store::remove(const iterator top, Objects& removed)
{
	if (top != end()) {
		const iterator descendants_end = find_descendants_end(top);
		removed.insert(top, descendants_end);
		erase(top, descendants_end);
	}
}
开发者ID:ventosus,项目名称:ingen,代码行数:9,代码来源:Store.cpp

示例4: newElement

        // Rvalue reference.
        std::shared_ptr <Value const> get (Value && value) {
            auto existing = objects_.find (value,
                boost::hash <Value>(), EqualToWeakPtr());
            if (existing != objects_.end())
                return existing->get();

            // The value is not in the store yet; insert it.
            auto sole = SoleType::construct (*this, std::move (value));
            Pointer newElement (sole);
            objects_.insert (std::move (newElement));

            return sole;
        }
开发者ID:guker,项目名称:flipsta,代码行数:14,代码来源:sole.hpp

示例5: add

	// called in Stored constructor
	// assignes new unique ID and back iterator
	virtual ID add(Target * object)
	{
		assert(generator);
		if(!valid(object->id()))	
			object->localID=generator->generate(object);
		else if(contains(object->id()))
		{
			assert(false);
		}
		objects.insert(std::make_pair(object->id(),object));	
		Objects::iterator it=objects.find(object->id());
		object->back=it;
		onAdd(object);		// raise onAdd event.
		return object->id();
	}
开发者ID:FrostHand,项目名称:frosttools,代码行数:17,代码来源:testIdManagers.cpp


注:本文中的Objects::insert方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。