本文整理汇总了C++中ParamList::end方法的典型用法代码示例。如果您正苦于以下问题:C++ ParamList::end方法的具体用法?C++ ParamList::end怎么用?C++ ParamList::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParamList
的用法示例。
在下文中一共展示了ParamList::end方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _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;
}
示例2:
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;
}
示例3: par_dec_list
/**
* Function representing <par_dec_list> prods
*/
ParamList* RecursiveDescentParser::par_dec_list() {
ParamList* retVal = NULL;
if(errorCondition) return retVal;
if(token == TK_INT || token == TK_CHAR)
{
#if DEBUG_PARSER
std::cout << "<par_dec_list> --> <type><par_spec><par_dec_list_prime>;<par_dec_list>\n";
#endif
Type t = type();
VariableEntry* va = par_spec(t);
retVal = par_dec_list_prime(t);
retVal->push_front(va);
match(TK_SEMICOLON);
ParamList* pList = par_dec_list();
retVal->splice(retVal->end(), *pList);
delete(pList);
}
else if(token == TK_LEFT_BRACE)
{
#if DEBUG_PARSER
std::cout << "<par_dec_list> --> e\n";
#endif
retVal = new ParamList();
}
else
{
errorHandler();
}
return retVal;
}
示例4: 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();
}
示例5: if
//--------------------------------------------------------------------------------//
void Win32InputManager::_parseConfigSettings( ParamList ¶mList )
{
//Here we pick up settings such as a device's cooperation mode
std::map<std::string, DWORD> temp;
temp["DISCL_BACKGROUND"] = DISCL_BACKGROUND;
temp["DISCL_EXCLUSIVE"] = DISCL_EXCLUSIVE;
temp["DISCL_FOREGROUND"] = DISCL_FOREGROUND;
temp["DISCL_NONEXCLUSIVE"] = DISCL_NONEXCLUSIVE;
temp["DISCL_NOWINKEY"] = DISCL_NOWINKEY;
//Check for pairs: ie. ("w32_keyboard","DISCL_NOWINKEY")("w32_keyboard","DISCL_FOREGROUND")
ParamList::iterator i = paramList.begin(), e = paramList.end();
for( ; i != e; ++i )
{
if( i->first == "w32_keyboard" )
kbSettings |= temp[i->second];
else if( i->first == "w32_mouse" )
mouseSettings |= temp[i->second];
else if( i->first == "w32_joystick" )
joySettings |= temp[i->second];
}
if( kbSettings == 0 ) kbSettings = DISCL_FOREGROUND | DISCL_EXCLUSIVE;
if( mouseSettings == 0 ) mouseSettings = DISCL_FOREGROUND | DISCL_EXCLUSIVE;
if( joySettings == 0 ) joySettings = DISCL_FOREGROUND | DISCL_EXCLUSIVE;
}
示例6: if
//----------------------------------------------------------------------------
void Win32InputManager::ParseConfigSettings (ParamList ¶mList)
{
std::map<std::string, DWORD> temp;
temp["DISCL_BACKGROUND"] = DISCL_BACKGROUND;
temp["DISCL_EXCLUSIVE"] = DISCL_EXCLUSIVE;
temp["DISCL_FOREGROUND"] = DISCL_FOREGROUND;
temp["DISCL_NONEXCLUSIVE"] = DISCL_NONEXCLUSIVE;
temp["DISCL_NOWINKEY"] = DISCL_NOWINKEY;
ParamList::iterator it = paramList.begin();
for (; it!=paramList.end(); it++)
{
if (it->first == "Win32Keyboard")
{
mKeyboardSettings |= temp[it->second];
}
else if (it->first == "Win32Mouse")
{
mMouseSettings |= temp[it->second];
}
}
if (0 == mKeyboardSettings)
{
mKeyboardSettings
= DISCL_FOREGROUND | DISCL_NONEXCLUSIVE | DISCL_NOWINKEY;
}
if (0 == mMouseSettings)
{
mMouseSettings = DISCL_FOREGROUND | DISCL_NONEXCLUSIVE;
}
}
示例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: 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();
}
示例9: _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;
}
}
}
示例10: readParamsFile
RobotInterface::ParamList RobotInterface::XMLReader::Private::readParamsTag(TiXmlElement *paramsElem)
{
const std::string &valueStr = paramsElem->ValueStr();
if (valueStr.compare("params") != 0) {
SYNTAX_ERROR(paramsElem->Row()) << "Expected \"params\". Found" << valueStr;
}
std::string filename;
if (paramsElem->QueryStringAttribute("file", &filename) == TIXML_SUCCESS) {
// yDebug() << "Found params file [" << filename << "]";
#ifdef WIN32
std::replace(filename.begin(), filename.end(), '/', '\\');
filename = path + "\\" + filename;
#else // WIN32
filename = path + "/" + filename;
#endif //WIN32
return readParamsFile(filename);
}
std::string robotName;
if (paramsElem->QueryStringAttribute("robot", &robotName) != TIXML_SUCCESS) {
SYNTAX_WARNING(paramsElem->Row()) << "\"params\" element should contain the \"robot\" attribute";
}
if (robotName != robot.name()) {
SYNTAX_WARNING(paramsElem->Row()) << "Trying to import a file for the wrong robot. Found" << robotName << "instead of" << robot.name();
}
unsigned int build;
#if TINYXML_UNSIGNED_INT_BUG
if (paramsElem->QueryUnsignedAttribute("build", &build()) != TIXML_SUCCESS) {
// No build attribute. Assuming build="0"
SYNTAX_WARNING(paramsElem->Row()) << "\"params\" element should contain the \"build\" attribute [unsigned int]. Assuming 0";
}
#else
int tmp;
if (paramsElem->QueryIntAttribute("build", &tmp) != TIXML_SUCCESS || tmp < 0) {
// No build attribute. Assuming build="0"
SYNTAX_WARNING(paramsElem->Row()) << "\"params\" element should contain the \"build\" attribute [unsigned int]. Assuming 0";
tmp = 0;
}
build = (unsigned)tmp;
#endif
if (build != robot.build()) {
SYNTAX_WARNING(paramsElem->Row()) << "Import a file for a different robot build. Found" << build << "instead of" << robot.build();
}
ParamList params;
for (TiXmlElement* childElem = paramsElem->FirstChildElement(); childElem != 0; childElem = childElem->NextSiblingElement()) {
ParamList childParams = readParams(childElem);
for (ParamList::const_iterator it = childParams.begin(); it != childParams.end(); ++it) {
params.push_back(*it);
}
}
return params;
}
示例11:
void
Action::Base::set_param_list(const ParamList ¶m_list)
{
ParamList::const_iterator iter;
for(iter=param_list.begin();iter!=param_list.end();++iter)
set_param(iter->first,iter->second);
}
示例12: _initialize
void AndroidInputManager::_initialize( ParamList ¶mList )
{
ParamList::iterator i = paramList.find("WINDOW");
if(i != paramList.end())
{
size_t whandle = strtoul(i->second.c_str(), 0, 10);
}
//TODO: setup window
}
示例13: paramsAsProperty
yarp::os::Property paramsAsProperty() const
{
ParamList p = RobotInterface::mergeDuplicateGroups(params);
std::string s;
s += "(device " + type + ")";
for (RobotInterface::ParamList::const_iterator it = p.begin(); it != p.end(); ++it) {
const RobotInterface::Param ¶m = *it;
s += " (" + param.name() + " " + param.value() + ")";
}
return yarp::os::Property(s.c_str());
}
示例14:
bool
Action::LayerResetPose::is_candidate(const ParamList &x)
{
if(!candidate_check(get_param_vocab(),x))
return false;
for(ParamList::const_iterator i = x.find("layer"); i != x.end() && i->first == "layer"; ++i)
if (i->second.get_type()==Param::TYPE_LAYER
&& i->second.get_layer()->get_name() == "skeleton_deformation")
return true;
return false;
}
示例15:
RobotInterface::ParamList RobotInterface::XMLReader::Private::readParamListTag(TiXmlElement* paramListElem)
{
if (paramListElem->ValueStr().compare("paramlist") != 0) {
SYNTAX_ERROR(paramListElem->Row()) << "Expected \"paramlist\". Found" << paramListElem->ValueStr();
}
ParamList params;
Param mainparam;
if (paramListElem->QueryStringAttribute("name", &mainparam.name()) != TIXML_SUCCESS) {
SYNTAX_ERROR(paramListElem->Row()) << "\"paramlist\" element should contain the \"name\" attribute";
}
params.push_back(mainparam);
// yDebug() << "Found paramlist [" << params.at(0).name() << "]";
for (TiXmlElement* childElem = paramListElem->FirstChildElement(); childElem != 0; childElem = childElem->NextSiblingElement()) {
if (childElem->ValueStr().compare("elem") != 0) {
SYNTAX_ERROR(childElem->Row()) << "Expected \"elem\". Found" << childElem->ValueStr();
}
Param childParam;
if (childElem->QueryStringAttribute("name", &childParam.name()) != TIXML_SUCCESS) {
SYNTAX_ERROR(childElem->Row()) << "\"elem\" element should contain the \"name\" attribute";
}
const char *valueText = childElem->GetText();
if (!valueText) {
SYNTAX_ERROR(childElem->Row()) << "\"elem\" element should have a value [ \"name\" = " << childParam.name() << "]";
}
childParam.value() = valueText;
params.push_back(childParam);
}
if (params.empty()) {
SYNTAX_ERROR(paramListElem->Row()) << "\"paramlist\" cannot be empty";
}
// +1 skips the first element, that is the main param
for (ParamList::iterator it = params.begin() + 1; it != params.end(); ++it) {
Param ¶m = *it;
params.at(0).value() += (params.at(0).value().empty() ? "(" : " ") + param.name();
}
params.at(0).value() += ")";
// yDebug() << params;
return params;
}