本文整理汇总了C++中ParametersMap类的典型用法代码示例。如果您正苦于以下问题:C++ ParametersMap类的具体用法?C++ ParametersMap怎么用?C++ ParametersMap使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ParametersMap类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: trails
ParametersMap HikingTrailSearchFunction::run(
std::ostream& stream,
const Request& request
) const {
ParametersMap pm;
HikingTrailTableSync::SearchResult trails(
HikingTrailTableSync::Search(Env::GetOfficialEnv(), _searchName)
);
BOOST_FOREACH(
HikingTrailTableSync::SearchResult::value_type& trail,
trails
){
boost::shared_ptr<ParametersMap> itemMap(new ParametersMap);
itemMap->insert(Request::PARAMETER_OBJECT_ID, trail->getKey());
pm.insert(DATA_HIKING_TRAIL, itemMap);
}
示例2: while
ParametersMap SQLService::run(
std::ostream& stream,
const Request& request
) const {
ParametersMap pm;
DBResultSPtr rows = DBModule::GetDB()->execQuery(_query);
while(rows->next ())
{
boost::shared_ptr<ParametersMap> rowPM(new ParametersMap);
Record::FieldNames fieldNames(rows->getFieldNames());
BOOST_FOREACH(const string& fieldName, fieldNames)
{
rowPM->insert(fieldName, rows->getText(fieldName));
}
pm.insert(TAG_RECORD, rowPM);
}
示例3: functionMap
ParametersMap Request::_getParametersMap(
) const {
ParametersMap result;
// Function
if (_function.get())
{
result.insert(Request::PARAMETER_SERVICE, _function->getFactoryKey());
ParametersMap::Map functionMap(_function->_getParametersMap().getMap());
for (ParametersMap::Map::const_iterator it = functionMap.begin(); it != functionMap.end(); ++it)
result.insert(it->first, it->second);
}
// Action name and parameters
if (_action.get())
{
result.insert(Request::PARAMETER_ACTION, _action->getFactoryKey());
ParametersMap::Map actionMap(_action->getParametersMap().getMap());
for (ParametersMap::Map::const_iterator it = actionMap.begin(); it != actionMap.end(); ++it)
result.insert(it->first, it->second);
result.insert(Request::PARAMETER_ACTION_WILL_CREATE_OBJECT, _actionWillCreateObject);
}
// Object ID
if (_actionCreatedId)
result.insert(Request::PARAMETER_OBJECT_ID, *_actionCreatedId);
// No redirection
if(!_redirectAfterAction)
{
result.insert(Request::PARAMETER_NO_REDIRECT_AFTER_ACTION, 1);
}
if(!_actionErrorMessage.empty())
{
result.insert(Request::PARAMETER_ACTION_FAILED, true);
result.insert(Request::PARAMETER_ERROR_MESSAGE, _actionErrorMessage);
}
return result;
}
示例4: getParametersMap
ParametersMap StopAreaTransferAddAction::getParametersMap() const
{
ParametersMap map;
if(_from.get())
{
map.insert(PARAMETER_FROM_ID, _from->getKey());
}
if(_to.get())
{
map.insert(PARAMETER_TO_ID, _to->getKey());
}
if(!_duration)
{
map.insert(PARAMETER_DURATION, StopAreaTableSync::FORBIDDEN_DELAY_SYMBOL);
}
else if(!_duration->is_not_a_date_time())
{
map.insert(PARAMETER_DURATION, _duration->total_seconds() / 60);
}
return map;
}
示例5: _getImportableUpdateParametersMap
void BaseImportableUpdateAction::_getImportableUpdateParametersMap(
ParametersMap& map
) const {
// Data source links
if(_dataSourceLinks)
{
map.insert(
PARAMETER_DATA_SOURCE_LINKS,
DataSourceLinks::Serialize(*_dataSourceLinks)
);
}
}
示例6: getParametersMap
ParametersMap FreeDRTAreaUpdateAction::getParametersMap() const
{
ParametersMap map;
if(_area.get())
{
map.insert(PARAMETER_AREA_ID, _area->getKey());
}
if(_name)
{
map.insert(PARAMETER_NAME, *_name);
}
if(_cities)
{
map.insert(PARAMETER_CITIES, FreeDRTAreaTableSync::SerializeCities(*_cities));
}
if(_stopAreas)
{
map.insert(PARAMETER_STOP_AREAS, FreeDRTAreaTableSync::SerializeStopAreas(*_stopAreas));
}
if(_line && _line->get())
{
map.insert(PARAMETER_COMMERCIAL_LINE_ID, (*_line)->getKey());
}
return map;
}
示例7: MapOptimizer
MapOptimizer() :
mapFrameId_("map"),
odomFrameId_("odom"),
globalOptimization_(true),
optimizeFromLastNode_(false),
mapToOdom_(rtabmap::Transform::getIdentity()),
transformThread_(0)
{
ros::NodeHandle nh;
ros::NodeHandle pnh("~");
double epsilon = 0.0;
bool robust = true;
bool slam2d =false;
int strategy = 0; // 0=TORO, 1=g2o, 2=GTSAM
int iterations = 100;
bool ignoreVariance = false;
pnh.param("map_frame_id", mapFrameId_, mapFrameId_);
pnh.param("odom_frame_id", odomFrameId_, odomFrameId_);
pnh.param("iterations", iterations, iterations);
pnh.param("ignore_variance", ignoreVariance, ignoreVariance);
pnh.param("global_optimization", globalOptimization_, globalOptimization_);
pnh.param("optimize_from_last_node", optimizeFromLastNode_, optimizeFromLastNode_);
pnh.param("epsilon", epsilon, epsilon);
pnh.param("robust", robust, robust);
pnh.param("slam_2d", slam2d, slam2d);
pnh.param("strategy", strategy, strategy);
UASSERT(iterations > 0);
ParametersMap parameters;
parameters.insert(ParametersPair(Parameters::kOptimizerStrategy(), uNumber2Str(strategy)));
parameters.insert(ParametersPair(Parameters::kOptimizerEpsilon(), uNumber2Str(epsilon)));
parameters.insert(ParametersPair(Parameters::kOptimizerIterations(), uNumber2Str(iterations)));
parameters.insert(ParametersPair(Parameters::kOptimizerRobust(), uBool2Str(robust)));
parameters.insert(ParametersPair(Parameters::kOptimizerSlam2D(), uBool2Str(slam2d)));
parameters.insert(ParametersPair(Parameters::kOptimizerVarianceIgnored(), uBool2Str(ignoreVariance)));
optimizer_ = Optimizer::create(parameters);
double tfDelay = 0.05; // 20 Hz
bool publishTf = true;
pnh.param("publish_tf", publishTf, publishTf);
pnh.param("tf_delay", tfDelay, tfDelay);
mapDataTopic_ = nh.subscribe("mapData", 1, &MapOptimizer::mapDataReceivedCallback, this);
mapDataPub_ = nh.advertise<rtabmap_ros::MapData>(nh.resolveName("mapData")+"_optimized", 1);
mapGraphPub_ = nh.advertise<rtabmap_ros::MapGraph>(nh.resolveName("mapData")+"Graph_optimized", 1);
if(publishTf)
{
ROS_INFO("map_optimizer will publish tf between frames \"%s\" and \"%s\"", mapFrameId_.c_str(), odomFrameId_.c_str());
ROS_INFO("map_optimizer: map_frame_id = %s", mapFrameId_.c_str());
ROS_INFO("map_optimizer: odom_frame_id = %s", odomFrameId_.c_str());
ROS_INFO("map_optimizer: tf_delay = %f", tfDelay);
transformThread_ = new boost::thread(boost::bind(&MapOptimizer::publishLoop, this, tfDelay));
}
}
示例8: GetNumericParameter
bool SetWindowRectCommandHandler::GetNumericParameter(
const ParametersMap& command_parameters,
const std::string& argument_name,
int* argument_value,
std::string* error_message) {
ParametersMap::const_iterator parameter_iterator = command_parameters.find(argument_name);
if (parameter_iterator != command_parameters.end()) {
if (!parameter_iterator->second.isNumeric()) {
*error_message = argument_name + " must be a numeric parameter.";
return false;
}
int value = parameter_iterator->second.asInt();
if (value < 0) {
*error_message = argument_name + " must be a numeric parameter greater than zero.";
return false;
}
*argument_value = value;
return true;
}
return true;
}
示例9: if
ParametersMap VehicleInformationsService::run(
std::ostream& stream,
const Request& request
) const {
ParametersMap map;
// Informations about the vehicle
if(_vehicle.get())
{
_vehicle->toParametersMap(map, true);
}
else if(VehicleModule::GetCurrentVehiclePosition().getVehicle())
{
VehicleModule::GetCurrentVehiclePosition().getVehicle()->toParametersMap(map, true);
}
// Position of the vehicle
if(!_vehicle.get())
{
// Current vehicle position
VehicleModule::GetCurrentVehiclePosition().toParametersMap(map, true);
// Journey
VehicleModule::GetCurrentJourney().toParametersMap(map);
// Ignition
map.insert(TAG_IGNITION, VehicleModule::getIgnition());
// Screens
boost::shared_ptr<ParametersMap> screenMap(new ParametersMap);
BOOST_FOREACH(const VehicleModule::VehicleScreensMap::value_type& item, VehicleModule::GetVehicleScreens())
{
// Insert a submap for each screen
boost::shared_ptr<ParametersMap> subScreenMap(new ParametersMap);
item.second.toParametersMap(*subScreenMap, true);
screenMap->insert(TAG_SCREEN, subScreenMap);
}
示例10: setupUi
void ParametersToolBox::setupUi(const ParametersMap & parameters)
{
parameters_ = parameters;
QWidget * currentItem = 0;
QStringList groups;
for(ParametersMap::const_iterator iter=parameters.begin();
iter!=parameters.end();
++iter)
{
QStringList splitted = QString::fromStdString(iter->first).split('/');
QString group = splitted.first();
QString name = splitted.last();
if(currentItem == 0 || currentItem->objectName().compare(group) != 0)
{
groups.push_back(group);
QScrollArea * area = new QScrollArea(this);
stackedWidget_->addWidget(area);
currentItem = new QWidget();
currentItem->setObjectName(group);
QVBoxLayout * layout = new QVBoxLayout(currentItem);
layout->setSizeConstraint(QLayout::SetMinimumSize);
layout->setContentsMargins(0,0,0,0);
layout->setSpacing(0);
area->setWidget(currentItem);
addParameter(layout, iter->first, iter->second);
}
else
{
addParameter((QVBoxLayout*)currentItem->layout(), iter->first, iter->second);
}
}
comboBox_->addItems(groups);
connect(comboBox_, SIGNAL(currentIndexChanged(int)), stackedWidget_, SLOT(setCurrentIndex(int)));
updateParametersVisibility();
}
示例11: __repeatImpl
void JoinEnumLoop::__repeatImpl(LoopFunction* func)
{
ParametersMap* parametersMap = func->getParameters();
tCurrentBranch = 0;
for (tIndex = 0; tIndex < tValueVector.size(); ++tIndex) {
parametersMap->putNumber(tKey, tValueVector[tIndex]);
Loop* currentLoop = tInnerLoops[tIndex];
if (currentLoop != NULL){
currentLoop->setCallerLoop(this);
currentLoop->__repeatImpl(func);
} else if (tInnerLoop != NULL) {
tInnerLoop->setCallerLoop(this);
tInnerLoop->__repeatImpl(func);
} else {
func->execute(this);
}
// It will not call to Loop::repeat__Base
++tCurrentBranch;
}
}
示例12: _setFromParametersMap
void JunctionUpdateAction::_setFromParametersMap(const ParametersMap& map)
{
if(map.isDefined(PARAMETER_JUNCTION_ID))
{
try
{
_junction = JunctionTableSync::GetEditable(map.get<RegistryKeyType>(PARAMETER_JUNCTION_ID), *_env);
}
catch (ObjectNotFoundException<Junction>&)
{
throw ActionException("No such junction");
}
}
else
{
_junction = boost::shared_ptr<Junction>(new Junction);
}
if(map.isDefined(PARAMETER_FROM_ID))
{
try
{
_from = StopPointTableSync::GetEditable(map.get<RegistryKeyType>(PARAMETER_FROM_ID), *_env);
}
catch(ObjectNotFoundException<StopPoint>&)
{
throw ActionException("No such from stop point");
}
}
if(map.isDefined(PARAMETER_TO_ID))
{
try
{
_to = StopPointTableSync::GetEditable(map.get<RegistryKeyType>(PARAMETER_TO_ID), *_env);
}
catch(ObjectNotFoundException<StopPoint>&)
{
throw ActionException("No such to stop point");
}
}
if(map.isDefined(PARAMETER_LENGTH))
{
_length = map.get<double>(PARAMETER_LENGTH);
}
if(map.isDefined(PARAMETER_TIME))
{
_duration = minutes(map.get<long>(PARAMETER_TIME));
}
if(map.isDefined(PARAMETER_BIDIRECTIONAL))
{
_bidirectional = map.getDefault<bool>(PARAMETER_BIDIRECTIONAL);
}
}
示例13: getParametersMap
ParametersMap HikingTrailUpdateAction::getParametersMap() const
{
ParametersMap map;
if(_trail.get())
{
map.insert(PARAMETER_TRAIL_ID, _trail->getKey());
map.insert(PARAMETER_DURATION, _duration);
map.insert(PARAMETER_NAME, _name);
map.insert(PARAMETER_MAP, _map);
map.insert(PARAMETER_PROFILE, _profile);
map.insert(PARAMETER_URL, _url);
}
return map;
}
示例14: parseParameters
void BayesFilter::parseParameters(const ParametersMap & parameters)
{
ParametersMap::const_iterator iter;
if((iter=parameters.find(Parameters::kBayesVirtualPlacePriorThr())) != parameters.end())
{
this->setVirtualPlacePrior(std::atof((*iter).second.c_str()));
}
if((iter=parameters.find(Parameters::kBayesPredictionLC())) != parameters.end())
{
this->setPredictionLC((*iter).second);
}
if((iter=parameters.find(Parameters::kBayesFullPredictionUpdate())) != parameters.end())
{
_fullPredictionUpdate = uStr2Bool((*iter).second.c_str());
}
}
示例15: run
ParametersMap VersionService::run(
std::ostream& stream,
const Request& request
) const {
ParametersMap map;
map.insert(ATTR_VERSION, ServerModule::VERSION);
map.insert(ATTR_REVISION, ServerModule::REVISION);
map.insert(ATTR_BUILD_DATE, ServerModule::BUILD_DATE);
std::vector<std::string> urlVector;
boost::algorithm::split(urlVector, ServerModule::SYNTHESE_URL, boost::is_any_of("/"));
if (urlVector.size() > 0)
{
if (urlVector.at(urlVector.size()-1) == "trunk")
map.insert(ATTR_BRANCH, urlVector.at(urlVector.size()-1));
else if (urlVector.size() > 1)
map.insert(ATTR_BRANCH, urlVector.at(urlVector.size()-2) + "/" + urlVector.at(urlVector.size()-1));
}
else
map.insert(ATTR_BRANCH, "");
return map;
}