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


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

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


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

示例1: 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

示例2:

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

示例3: value_desc

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

	ValueNode::Handle value_node;
	ValueDesc value_desc(x.find("value_desc")->second.get_value_desc());

	if(value_desc.parent_is_value_node_const() || value_desc.parent_is_linkable_value_node())
		value_node = value_desc.get_value_node();
	else
		value_node = x.find("value_node")->second.get_value_node();
	// Don't allow to unset static to lower and upper boundaries of the WidhtPoint
	if(value_desc.parent_is_linkable_value_node()
		&& value_desc.get_parent_value_node()->get_name()=="composite"
		&& value_desc.get_parent_value_node()->get_type()==ValueBase::TYPE_WIDTHPOINT
		&& (value_desc.get_index()==4 || value_desc.get_index()==5))
		return false;
	// We need a constant value node or a constant layer param.
	return (
			(ValueNode_Const::Handle::cast_dynamic(value_node) &&
			// We need the constant value node to be static.
			ValueNode_Const::Handle::cast_dynamic(value_node)->get_static())
			);
}
开发者ID:aaronaskew,项目名称:synfig,代码行数:26,代码来源:valuenodeconstunsetstatic.cpp

示例4: _parseConfigSettings

//--------------------------------------------------------------------------------//
void LinuxInputManager::_parseConfigSettings( ParamList &paramList )
{
	ParamList::iterator i = paramList.find("WINDOW");
	if( i == paramList.end() ) 
		OIS_EXCEPT( E_InvalidParam, "LinuxInputManager >> No WINDOW!" );

	//TODO 64 bit proof this little conversion xxx wip
	window  = strtoul(i->second.c_str(), 0, 10);

	//--------- Keyboard Settings ------------//
	i = paramList.find("XAutoRepeatOn");
	if( i != paramList.end() )
		if( i->second == "true" )
			useXRepeat = true;

	i = paramList.find("x11_keyboard_grab");
	if( i != paramList.end() )
		if( i->second == "false" )
			grabKeyboard = false;

	//--------- Mouse Settings ------------//
	i = paramList.find("x11_mouse_grab");
	if( i != paramList.end() )
		if( i->second == "false" )
			grabMouse = false;

	i = paramList.find("x11_mouse_hide");
	if( i != paramList.end() )
		if( i->second == "false" )
			hideMouse = false;
}
开发者ID:Ali-il,项目名称:gamekit,代码行数:32,代码来源:LinuxInputManager.cpp

示例5:

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

	if(	x.find("addlayer") == x.end() &&
		x.find("addcanvas") == x.end() &&
		x.find("addvaluedesc") == x.end())
		return false;
	return true;
}
开发者ID:ChillyCider,项目名称:synfig-reloaded,代码行数:12,代码来源:timepointsmove.cpp

示例6: GetModuleHandle

//----------------------------------------------------------------------------
void Win32InputManager::Initialize (ParamList &paramList)
{
	HINSTANCE hInst = 0;
	HRESULT hr;

	ParamList::iterator i = paramList.find("Window");
	if (i == paramList.end()) 
	{
		assertion(false, 
			"Win32InputManager::Win32InputManager >> No HWND found!");
	}

	unsigned __int64 handle = _strtoui64(i->second.c_str(), 0, 10);
	mhWnd = (HWND)handle;

	if (IsWindow(mhWnd) == 0)
	{
		assertion(false, "The sent HWND is not valid!");
	}

	hInst = GetModuleHandle(0);

	hr = DirectInput8Create( hInst, DIRECTINPUT_VERSION, IID_IDirectInput8, 
		(VOID**)&mDirectInput, 0 );
	if (FAILED(hr))
	{
		assertion(false, "Not able to init DirectX8 Input!");
	}

	ParseConfigSettings(paramList);
	EnumerateDevices();
}
开发者ID:manyxu,项目名称:Phoenix3D_2.0,代码行数:33,代码来源:PX2Win32InputManager.cpp

示例7: warning

//--------------------------------------------------------------------------------//
void Win32InputManager::_initialize( ParamList &paramList )
{
    HINSTANCE hInst = 0;
    HRESULT hr;

    //TODO 64 bit proof this little conversion xxx wip
    //First of all, get the Windows Handle and Instance
    ParamList::iterator i = paramList.find("WINDOW");
    if( i == paramList.end() )
        OIS_EXCEPT( E_InvalidParam, "Win32InputManager::Win32InputManager >> No HWND found!" );

#ifdef _MSC_VER
#pragma warning(disable:4312)
#endif
    hWnd  = (HWND)strtoul(i->second.c_str(), 0, 10);
#ifdef _MSC_VER
#pragma warning(default:4312)
#endif

    hInst = GetModuleHandle(0);

    //Create the device
    hr = DirectInput8Create( hInst, DIRECTINPUT_VERSION, IID_IDirectInput8, (VOID**)&mDirectInput, NULL );
    if (FAILED(hr))
        OIS_EXCEPT( E_General, "Win32InputManager::Win32InputManager >> Not able to init DirectX8 Input");

    //Ok, now we have DirectInput, parse whatever extra settings were sent to us
    _parseConfigSettings( paramList );
    _enumerateDevices();
}
开发者ID:pkamenarsky,项目名称:hastegame,代码行数:31,代码来源:Win32InputManager.cpp

示例8: value_desc

bool
Action::ValueNodeDynamicListRemoveSmart::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());
	bool parent_is_dynamic_list(
			value_desc.parent_is_value_node() &&
			ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node())
			);
	if(!parent_is_dynamic_list)
	{
		// Let's check if we are selecting a composite child
		if(value_desc.parent_is_value_node())
		{
			ValueNode::Handle compo(ValueNode_Composite::Handle::cast_dynamic(value_desc.get_parent_value_node()));
			if(compo)
			{
				ValueNode_DynamicList::Handle parent_list=NULL;
				std::set<Node*>::iterator iter;
				// now check if the composite parent is a dynamic list type
				for(iter=compo->parent_set.begin();iter!=compo->parent_set.end();++iter)
					{
						parent_list=ValueNode_DynamicList::Handle::cast_dynamic(*iter);
						if(parent_list)
							break;
					}
				if(parent_list)
					parent_is_dynamic_list=true;
			}
		}
	}
	return (parent_is_dynamic_list);
}
开发者ID:blackwarthog,项目名称:synfig,代码行数:35,代码来源:valuenodedynamiclistremovesmart.cpp

示例9: 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

示例10: String

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

	Layer::Handle layer=x.find("layer")->second.get_layer();
	if(!layer) return false;

	etl::handle<synfig::Layer_PasteCanvas> layer_pastecanvas
		= etl::handle<synfig::Layer_PasteCanvas>::cast_dynamic(layer);
	if (layer_pastecanvas)
	{
		Canvas::Handle canvas = layer_pastecanvas->get_sub_canvas();;
		if (canvas && canvas->is_root())
			return true;
	}

	Layer::Handle layer_import = layer;
	if (layer_import->get_param_list().count("filename") != 0)
	{
		String filename = layer_import->get_param("filename").get(String());
		// TODO: literal "container:"
		if (!filename.empty()
		  && filename.substr(0, String("#").size()) != "#"
	      && layer_import->dynamic_param_list().count("filename") == 0)
			return true;
	}

	return false;
}
开发者ID:ChillyCider,项目名称:synfig-reloaded,代码行数:30,代码来源:layerembed.cpp

示例11: GetModuleHandle

//--------------------------------------------------------------------------------//
void Win32InputManager::_initialize( ParamList &paramList )
{
	HINSTANCE hInst = 0;
	HRESULT hr;


	//First of all, get the Windows Handle and Instance
	ParamList::iterator i = paramList.find("WINDOW");
	if( i == paramList.end() )
		OIS_EXCEPT( E_InvalidParam, "Win32InputManager::Win32InputManager >> No HWND found!" );

	// Get number as 64 bit and then convert. Handles the case of 32 or 64 bit HWND
	unsigned __int64 handle = _strtoui64(i->second.c_str(), 0, 10);
	hWnd  = (HWND)handle;

	if( IsWindow(hWnd) == 0 )
		OIS_EXCEPT( E_General, "Win32InputManager::Win32InputManager >> The sent HWND is not valid!");

	hInst = GetModuleHandle(0);

	//Create the device
	hr = DirectInput8Create( hInst, DIRECTINPUT_VERSION, IID_IDirectInput8, (VOID**)&mDirectInput, NULL );
    if (FAILED(hr))
		OIS_EXCEPT( E_General, "Win32InputManager::Win32InputManager >> Not able to init DirectX8 Input!");

	//Ok, now we have DirectInput, parse whatever extra settings were sent to us
	_parseConfigSettings( paramList );

	// Enumerate devices ...
	_enumerateDevices();
}
开发者ID:Adenory,项目名称:OIS,代码行数:32,代码来源:Win32InputManager.cpp

示例12:

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

	Layer::Handle layer=x.find("layer")->second.get_layer();
	if(!layer) return false;

	etl::handle<synfig::Layer_PasteCanvas> layer_pastecanvas
		= etl::handle<synfig::Layer_PasteCanvas>::cast_dynamic(layer);
	if (layer_pastecanvas)
	{
		Canvas::Handle canvas = layer_pastecanvas->get_sub_canvas();;
		if (canvas && canvas->is_root())
			return true;
	}

	Layer::Handle layer_import = layer;
	if (layer_import->get_param_list().count("filename") != 0)
	{
		String filename = layer_import->get_param("filename").get(String());
		if ( !CanvasFileNaming::is_embeded(filename)
	      && !layer_import->dynamic_param_list().count("filename") )
			return true;
	}

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

示例13: value_desc

bool
Action::ValueDescDisconnect::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());

    // don't allow Bone ValueNodes to be disconnected
    if(getenv("SYNFIG_DISALLOW_BONE_DISCONNECT") &&
            value_desc.is_value_node() &&
            ValueNode_Bone::Handle::cast_dynamic(value_desc.get_value_node()))
        return false;
    // don't allow the Index parameter of the Duplicate layer to be disconnected
    if(value_desc.parent_is_layer() && value_desc.get_layer()->get_name() == "duplicate" && value_desc.get_param_name() == "index")
        return false;
    if(!value_desc.parent_is_canvas() && value_desc.is_value_node() && value_desc.get_value_node()->rcount()>1)
        return true;
    if(value_desc.is_const())
        return false;
    if(value_desc.is_value_node() && ValueNode_Const::Handle::cast_dynamic(value_desc.get_value_node()))
        return false;
    // don't allow Duplicate ValueNodes in the Children dialog to be disconnected
    if(value_desc.is_value_node() &&
            ValueNode_Duplicate::Handle::cast_dynamic(value_desc.get_value_node()) &&
            !value_desc.parent_is_layer() &&
            !value_desc.parent_is_value_node())
        return false;
    return true;
}
开发者ID:jottoprimo,项目名称:synfig,代码行数:30,代码来源:valuedescdisconnect.cpp

示例14: _parseConfigSettings

//--------------------------------------------------------------------------------//
void MacInputManager::_parseConfigSettings( ParamList &paramList )
{
    // Some carbon apps are running in a window, however full screen apps
	// do not have a window, so we need to account for that too.
	ParamList::iterator i = paramList.find("WINDOW");
	if(i != paramList.end())
	{
		mWindow = (WindowRef)strtoul(i->second.c_str(), 0, 10);
		if(mWindow == 0)
		{
			mWindow = NULL;
			mEventTargetRef = GetApplicationEventTarget();
		}
		else
		{
			//mEventTargetRef = GetWindowEventTarget(mWindow);
			mEventTargetRef = GetApplicationEventTarget();
		}
    }
	else
	{
		// else get the main active window.. user might not have access to it through some
		// graphics libraries, if that fails then try at the application level.
		mWindow = ActiveNonFloatingWindow();
		if(mWindow == NULL)
		{
			mEventTargetRef = GetApplicationEventTarget();
		}
		else
		{
			//mEventTargetRef = GetWindowEventTarget(mWindow);
			mEventTargetRef = GetApplicationEventTarget();
		}
	}
	
	if(mEventTargetRef == NULL)
		OIS_EXCEPT( E_General, "MacInputManager::_parseConfigSettings >> Unable to find a window or event target" );
    
    // Keyboard
    if(paramList.find("MacAutoRepeatOn") != paramList.end())
	{
        if(paramList.find("MacAutoRepeatOn")->second == "true")
		{
            mUseRepeat = true;
        }
    }
}
开发者ID:0302zq,项目名称:libgdx,代码行数:48,代码来源:MacInputManager.cpp

示例15:

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


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