本文整理汇总了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;
}
示例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;
}
示例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())
);
}
示例4: _parseConfigSettings
//--------------------------------------------------------------------------------//
void LinuxInputManager::_parseConfigSettings( ParamList ¶mList )
{
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;
}
示例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;
}
示例6: GetModuleHandle
//----------------------------------------------------------------------------
void Win32InputManager::Initialize (ParamList ¶mList)
{
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();
}
示例7: warning
//--------------------------------------------------------------------------------//
void Win32InputManager::_initialize( ParamList ¶mList )
{
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();
}
示例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);
}
示例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;
}
示例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;
}
示例11: GetModuleHandle
//--------------------------------------------------------------------------------//
void Win32InputManager::_initialize( ParamList ¶mList )
{
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();
}
示例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;
}
示例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;
}
示例14: _parseConfigSettings
//--------------------------------------------------------------------------------//
void MacInputManager::_parseConfigSettings( ParamList ¶mList )
{
// 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;
}
}
}
示例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")));
}