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


C++ ParamList::count方法代码示例

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


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

示例1:

bool
Action::ValueDescConnect::is_candidate(const ParamList &x)
{
    if(candidate_check(get_param_vocab(),x))
    {
        // don't show the option of connecting to an existing Index parameter of the Duplicate layer
        if(x.count("dest"))
        {
            ValueDesc value_desc=x.find("dest")->second.get_value_desc();

            if (value_desc.parent_is_layer() &&
                    value_desc.get_layer()->get_name() == "duplicate" &&
                    value_desc.get_param_name() == "index")
                return false;
        }

        if(x.count("src"))
        {
            ValueDesc value_desc=x.find("dest")->second.get_value_desc();
            ValueNode::Handle value_node=x.find("src")->second.get_value_node();
            if(value_desc.get_value_type()==value_node->get_type())
                return true;
        }
        return true;
    }
    return false;
}
开发者ID:BakaMANIA,项目名称:synfig,代码行数:27,代码来源:valuedescconnect.cpp

示例2: n

bool
Action::candidate_check(const ParamVocab& param_vocab, const ParamList& param_list)
{
	ParamVocab::const_iterator iter;

	for(iter=param_vocab.begin();iter!=param_vocab.end();++iter)
	{
		int n(param_list.count(iter->get_name()));

//		if(n && !iter->get_mutual_exclusion().empty() && param_list.count(iter->get_mutual_exclusion()))
//			return false;

		if(!n && !iter->get_mutual_exclusion().empty() && param_list.count(iter->get_mutual_exclusion()))
			continue;

		if(iter->get_user_supplied() || iter->get_optional())
			continue;

		if(n==0)
			return false;
		if(n==1 && iter->get_requires_multiple())
			return false;
		if(n>1 && !iter->get_supports_multiple())
			return false;

		if(iter->get_type()!=param_list.find(iter->get_name())->second.get_type())
			return false;
	}
	return true;
}
开发者ID:ChillyCider,项目名称:synfig-reloaded,代码行数:30,代码来源:action_param.cpp

示例3: value_desc

bool
Action::ValueDescConnect::is_candidate(const ParamList &x)
{
	if(candidate_check(get_param_vocab(),x))
	{
	    ValueDesc value_desc(x.find("dest")->second.get_value_desc());
	    ValueNode::Handle value_node(x.find("src")->second.get_value_node());

	    //! forbid recursive linking (fix #48)
	    if (value_desc.parent_is_value_node())
	    {
	        ValueNode* vn = dynamic_cast<ValueNode*>(value_node.get());
	        if (vn && vn->is_descendant(value_desc.get_parent_value_node()))
	            return false;
	    }


		// don't show the option of connecting to an existing Index parameter of the Duplicate layer
		if(x.count("dest"))
		{
			if (value_desc.parent_is_layer() &&
				value_desc.get_layer()->get_name() == "duplicate" &&
				value_desc.get_param_name() == "index")
				return false;
		}

		if(x.count("src"))
		{
			if(value_desc.get_value_type()==value_node->get_type())
				return true;
		}
		return true;
	}
	return false;
}
开发者ID:blackwarthog,项目名称:synfig,代码行数:35,代码来源:valuedescconnect.cpp

示例4:

/*! Writes the param of the given \a params to \a dbg. */
QDebug operator<<(QDebug dbg, const ParamList &params)
{
    dbg.nospace() << "ParamList (count:" << params.count() << ")" << endl;
    for (int i = 0; i < params.count(); i++ ) {
        dbg.nospace() << "     " << i << ": " << params.at(i) << endl;
    }

    return dbg.space();
}
开发者ID:defc0n1,项目名称:guh,代码行数:10,代码来源:param.cpp

示例5:

bool
Action::WaypointAdd::is_candidate(const ParamList &x)
{
	return (candidate_check(get_param_vocab(),x) &&
			// We need an animated valuenode.
			ValueNode_Animated::Handle::cast_dynamic(x.find("value_node")->second.get_value_node()) &&
			// We need either a waypoint or a time.
			(x.count("waypoint") || x.count("time")));
}
开发者ID:breaklyn,项目名称:synfig-osx,代码行数:9,代码来源:waypointadd.cpp

示例6: value_desc

bool
Action::ActivepointSetSmart::is_candidate(const ParamList &x)
{
	if (!candidate_check(get_param_vocab(),x))
		return false;

	ValueDesc value_desc(x.find("value_desc")->second.get_value_desc());

	return (value_desc.parent_is_value_node() &&
			// We need a dynamic list.
			ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node()) &&
			// We need either an activepoint or a time.
			(x.count("activepoint") || x.count("time")));
}
开发者ID:ChillyCider,项目名称:synfig-reloaded,代码行数:14,代码来源:activepointsetsmart.cpp

示例7: value_desc

bool
Action::ActivepointSetOff::is_candidate(const ParamList &x)
{
    if (!candidate_check(get_param_vocab(),x))
        return false;

    ValueDesc value_desc(x.find("value_desc")->second.get_value_desc());

    if (!(value_desc.parent_is_value_node() &&
            // We need a dynamic list.
            ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node())))
        return false;

    Canvas::Handle canvas(x.find("canvas")->second.get_canvas());

    // We are only a candidate if this canvas is animated.
    return (canvas->rend_desc().get_time_start() != canvas->rend_desc().get_time_end() &&
            // We need either an activepoint or a time.
            (x.count("activepoint") || x.count("time")));
}
开发者ID:breaklyn,项目名称:synfig-osx,代码行数:20,代码来源:activepointsetoff.cpp

示例8:

bool
Action::LayerMakeBLine::is_candidate_for_make_bline(const ParamList &x, const char **possible_layer_names, size_t possible_layer_names_count)
{
	if(!candidate_check(get_param_vocab(),x))
		return false;

	if(x.count("layer") == 1)
	{
		const Param &param = x.find("layer")->second;
		if(param.get_type() == Param::TYPE_LAYER
		&& param.get_layer()
		&& param.get_layer()->dynamic_param_list().count("bline") == 1)
		{
			for(size_t i = 0; i < possible_layer_names_count; i++)
				if (param.get_layer()->get_name() == possible_layer_names[i])
					return true;
		}
	}

	return false;
}
开发者ID:blackwarthog,项目名称:synfig,代码行数:21,代码来源:layermakebline.cpp


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