本文整理汇总了C++中ParameterMap::end方法的典型用法代码示例。如果您正苦于以下问题:C++ ParameterMap::end方法的具体用法?C++ ParameterMap::end怎么用?C++ ParameterMap::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParameterMap
的用法示例。
在下文中一共展示了ParameterMap::end方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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++;
}
}
示例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;
}
示例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;
}
示例4: ParseValue
// Called to parse a RCSS keyword declaration.
bool PropertyParserKeyword::ParseValue(Property& property, const String& value, const ParameterMap& parameters) const
{
ParameterMap::const_iterator iterator = parameters.find(value);
if (iterator == parameters.end())
return false;
property.value = Variant((*iterator).second);
property.unit = Property::KEYWORD;
return true;
}
示例5: setParameters
void OutputFormat::setParameters(const std::string& outDir,
const ParameterMap& formatParams)
{
m_outDir = outDir;
m_params.clear();
ParameterDescriptorList pList = getParameters();
for (ParameterDescriptorList::iterator it=pList.begin();
it!=pList.end(); it++) {
ParameterMap::const_iterator pIt = formatParams.find(it->m_identifier);
if (pIt!=formatParams.end()) {
m_params[it->m_identifier] = pIt->second;
} else {
m_params[it->m_identifier] = it->m_defaultValue;
}
}
}
示例6: 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;
}
示例7: 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;
}
示例8: getStringParam
std::string Component::getStringParam(const std::string& id, const ParameterMap& params)
{
ParameterMap::const_iterator it=params.find(id);
if (it!=params.end()) {
if (it->second.size()==0) {
cerr << "ERROR: parameter " << id << " is empty !" << endl;
return EMPTY_STRING;
}
return it->second;
}
ParameterDescriptorList pList = getParameterDescriptorList();
for (ParameterDescriptorList::const_iterator descIt=pList.begin();
descIt!=pList.end(); descIt++)
{
if (descIt->m_identifier==id)
return descIt->m_defaultValue;
}
cerr << "ERROR: no parameter " << id << " for component " << getIdentifier() << " !" << endl;
return EMPTY_STRING;
}
示例9: 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;
}
示例10: 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, ¶meters);
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;
}
示例11: printParams
void printParams(ostream& out, const ParameterMap& params)
{
for (ParameterMap::const_iterator pit=params.begin();
pit!=params.end(); pit++)
out << " " << pit->first << "=\"" << pit->second << "\"";
}