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


C++ ParameterMap::begin方法代码示例

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


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

示例1: writeRouterModelFile

void ConfigFileWriter::writeRouterModelFile(std::string filename,
                                            NodeSet& ns)
{
    std::fstream out;

    std::set<std::string>::iterator it = ns.modelsUsed().begin();

    if (it != ns.modelsUsed().end())
    {
        out.open(filename.c_str(), std::fstream::out | std::fstream::trunc);
    }

    while (it != ns.modelsUsed().end())
    {
        ParameterMap* parameters = Config::instance().getModelParameterList(*it);
        const Parameter& model = parameters->getParameter("ROUTER-MODEL");
        if (model != Parameter::unknownParameter)
        {
            out << model << std::endl;
            ParameterMap::iterator pit = parameters->begin();
            while (pit != parameters->end())
            {
                if (pit->first != "ROUTER-MODEL")
                    out << pit->second << std::endl;
                pit++;
            }
            out << std::endl;
        }
        it++;
    }
}
开发者ID:LXiong,项目名称:ccn,代码行数:31,代码来源:configFiles.cpp

示例2: init

bool CSVWriter::init(const ParameterMap& params, const Ports<StreamInfo>& inp)
{
	assert(inp.size()==1);
	const StreamInfo& in = inp[0].data;

	string outputFile = getStringParam("File", params);
	m_precision = getIntParam("Precision",params);
	if (m_precision > (BUFSIZE-10)) {
		cerr << "WARNING: precision is too large ! use precision " << BUFSIZE - 10 << endl;
		m_precision = BUFSIZE - 10;
	}

	int res = preparedirs(outputFile.c_str());
	if (res!=0)
		return false;

	m_fout.open(outputFile.c_str(), ios_base::trunc);
	if (!m_fout.is_open() || m_fout.bad())
		return false;

	if (getStringParam("Metadata",params)=="True") {
		// write metadata at the beginnig of the file
		string paramStr = getStringParam("Attrs",params);
		map<string,string> params = decodeAttributeStr(paramStr);
		ostringstream oss;
		for (map<string,string>::const_iterator it=params.begin();it!=params.end();it++)
			oss << "% " << it->first << "=" << it->second << endl;
		m_fout.write(oss.str().c_str(),oss.str().size());
	}

	return true;
}
开发者ID:aasheeshverma,项目名称:hack-the-talk-exotel-master,代码行数:32,代码来源:CSVWriter.cpp

示例3: setParametersAndPossibleActivation

bool SpecificWorker::setParametersAndPossibleActivation(const ParameterMap &prs, bool &reactivated)
{
	printf("<<< setParametersAndPossibleActivation\n");
	// We didn't reactivate the component
	reactivated = false;

	// Update parameters
	params.clear();
	for (ParameterMap::const_iterator it=prs.begin(); it!=prs.end(); it++)
	{
		printf("param:%s   value:%s\n", it->first.c_str(), it->second.value.c_str());
		params[it->first] = it->second;
	}
	printf("----\n");

	try
	{
		action = "";
		for (uint i=0; i<params["action"].value.size(); i++)
		{
			action += params["action"].value[i];
			if (i+2<params["action"].value.size())
			{
				if (params["action"].value[i+1] == '_' and params["action"].value[i+2] == '_')
					break;
			}
		}
		std::transform(action.begin(), action.end(), action.begin(), ::tolower);
		//
		// action = params["action"].value;

		if (action == "graspobject")
		{
			active = true;
		}
		else
		{
			active = true;
		}
	}
	catch (...)
	{
		printf("exception in setParametersAndPossibleActivation %d\n", __LINE__);
		return false;
	}

	// Check if we should reactivate the component
	if (active)
	{
		active = true;
		reactivated = true;
	}

	printf("setParametersAndPossibleActivation >>>\n");

	return true;
}
开发者ID:robocomp,项目名称:robocomp-shelly,代码行数:57,代码来源:specificworker.cpp

示例4: setParametersAndPossibleActivation

bool SpecificWorker::setParametersAndPossibleActivation(const ParameterMap &prs, bool &reactivated)
{
	printf("<<< setParametersAndPossibleActivation\n");
	// We didn't reactivate the component
	reactivated = false;

	// Update parameters
	params.clear();
	for (ParameterMap::const_iterator it=prs.begin(); it!=prs.end(); it++)
	{
		params[it->first] = it->second;
	}

	try
	{
		action = params["action"].value;
		std::transform(action.begin(), action.end(), action.begin(), ::tolower);
		//TYPE YOUR ACTION NAME
		if (action == "actionname")
		{
			active = true;
		}
		else
		{
			active = true;
		}
	}
	catch (...)
	{
		printf("exception in setParametersAndPossibleActivation %d\n", __LINE__);
		return false;
	}

	// Check if we should reactivate the component
	if (active)
	{
		active = true;
		reactivated = true;
	}

	printf("setParametersAndPossibleActivation >>>\n");

	return true;
}
开发者ID:robocomp,项目名称:robocomp-agm-basic,代码行数:44,代码来源:specificworker.cpp

示例5: setParametersAndPossibleActivation

bool GenericWorker::setParametersAndPossibleActivation(const ParameterMap &prs, bool &reactivated)
{
	// We didn't reactivate the component
	reactivated = false;

	// Update parameters
	for (ParameterMap::const_iterator it=prs.begin(); it!=prs.end(); it++)
	{
		params[it->first] = it->second;
	}

	try
	{
		// Action
		p.action = createAction(params["action"].value);

		// Fill received plan
		p.plan.clear();
		QStringList actionList = QString::fromStdString(params["plan"].value).split(QRegExp("[()]+"), QString::SkipEmptyParts);
		for (int32_t actionString=0; actionString<actionList.size(); actionString++)
		{
			std::vector<string> elementsVec;
			QStringList elements = actionList[actionString].remove(QChar('\n')).split(QRegExp("\\s+"), QString::SkipEmptyParts);
			for (int32_t elem=0; elem<elements.size(); elem++)
			{
				elementsVec.push_back(elements[elem].toStdString());
			}
			p.plan.push_back(elementsVec);
		}
	}
	catch (...)
	{
		return false;
	}

	// Check if we should reactivate the component
	if (isActive())
	{
		activate(p);
		reactivated = true;
	}

	return true;
}
开发者ID:robocomp,项目名称:robocomp-shelly,代码行数:44,代码来源:genericworker.cpp

示例6: setParametersAndPossibleActivation

bool SpecificWorker::setParametersAndPossibleActivation(const ParameterMap &prs, bool &reactivated)
{
	// We didn't reactivate the component
	reactivated = false;

	// Update parameters
	params.clear();
	for (ParameterMap::const_iterator it=prs.begin(); it!=prs.end(); it++)
	{
		params[it->first] = it->second;
	}

	try
	{
		action = params["action"].value;
		std::transform(action.begin(), action.end(), action.begin(), ::tolower);


		if (action == "findobjectvisually")
		{
			active = true;
		}
		else
		{
			active = true;
		}
	}
	catch (...)
	{
		return false;
	}

	// Check if we should reactivate the component
	if (active)
	{
		active = true;
		reactivated = true;
	}

	return true;
}
开发者ID:robocomp,项目名称:robocomp-ursus-touchgame,代码行数:41,代码来源:specificworker.cpp

示例7: ActorAdd

int LuaBinding::ActorAdd()
{
    const char* actorAlias = NULL;
    Vector2i actorPosition;
    if (!Peek(1, &actorAlias) || !Peek(2, &actorPosition))
    {
        return ERROR_TYPE_PARAMETER;
    }

    const char* actorName = NULL;
    Peek(3, &actorName);

    ParameterMap parameters;
    Peek(4, &parameters);

    IWorldContext* worldContext = System::QueryWorldContext();
    if (worldContext == NULL)
    {
        return ERROR_TYPE_STATE;
    }

    const boost::shared_ptr<Actor> actor = worldContext->AddActor(actorAlias, actorPosition, actorName).lock();
    if (!actor)
    {
        return ERROR_TYPE_STATE;
    }

    const boost::shared_ptr<ActorPropertyScript> property = actor->GetProperty<ActorPropertyScript>().lock();
    if (property)
    {
        for (ParameterMap::iterator iter = parameters.begin(); iter != parameters.end(); ++iter)
        {
            property->SetParameter(iter->first.c_str(), iter->second);
        }
    }

    Push(actor->GetId());
    return 1;
}
开发者ID:FooSoft,项目名称:moonfall,代码行数:39,代码来源:LuaBindingActor.cpp

示例8: printParams

 void printParams(ostream& out, const ParameterMap& params)
 {
   for (ParameterMap::const_iterator pit=params.begin();
       pit!=params.end(); pit++)
     out << " " << pit->first << "=\"" << pit->second << "\"";
 }
开发者ID:Crococode,项目名称:Yaafe,代码行数:6,代码来源:DataFlow.cpp


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