本文整理汇总了C++中StringMap::at方法的典型用法代码示例。如果您正苦于以下问题:C++ StringMap::at方法的具体用法?C++ StringMap::at怎么用?C++ StringMap::at使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StringMap
的用法示例。
在下文中一共展示了StringMap::at方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setup
void IoGPIO::setup(const StringMap & settings)
{
Io::setup(settings);
setOutputPin(std::atoi(settings.at("ios.GPIO.pin").c_str()));
setPeriods(std::atoi(settings.at("ios.GPIO.periods").c_str()));
setPeriodTime(std::atoi(settings.at("ios.GPIO.periodTime").c_str()));
}
示例2: setup
void RectangleExpositor::setup(const StringMap & settings)
{
Expositor::setup(settings);
int x1 = std::atoi(settings.at("expositors.Rectangle.region.x1").c_str());
int y1 = std::atoi(settings.at("expositors.Rectangle.region.y1").c_str());
int x2 = std::atoi(settings.at("expositors.Rectangle.region.x2").c_str());
int y2 = std::atoi(settings.at("expositors.Rectangle.region.y2").c_str());
setCoordinates(x1, y1, x2, y2);
}
示例3: setup
void IoTCP::setup(const StringMap & settings)
{
Io::setup(settings);
// ----------------------------------
// TODO: set server credentials
setIp(settings.at("ios.TCPSocket.server").c_str());
setPort(std::atoi(settings.at("ios.TCPSocket.port").c_str()));
setMessage(settings.at("ios.TCPSocket.message").c_str());
}
示例4: setup
void IoGPIO::setup(const StringMap & settings)
{
Io::setup(settings);
setOutputPin(std::atoi(settings.at("ios.GPIO.pin").c_str()));
setPeriods(std::atoi(settings.at("ios.GPIO.periods").c_str()));
setPeriodTime(std::atoi(settings.at("ios.GPIO.periodTime").c_str()));
// -------------
// Set throttler
throttle.setRate(std::stoi(settings.at("ios.GPIO.throttler")));
}
示例5: setup
void IoWebhook::setup(const StringMap & settings)
{
Io::setup(settings);
// --------------------------
// Get name from instance
std::string instanceName = settings.at("name");
setInstanceName(instanceName);
// -------
// Get url
setUrl(settings.at("ios.Webhook.url").c_str());
}
示例6: readMeiqueConfig
int MeiqueCache::readMeiqueConfig(lua_State* L)
{
MeiqueCache* self = getSelf(L);
StringMap opts;
readLuaTable(L, lua_gettop(L), opts);
lua_pop(L, 1);
try {
self->m_sourceDir = OS::normalizeDirPath(opts.at("sourceDir"));
self->m_buildType = opts.at("buildType") == "debug" ? Debug : Release;
self->m_compilerId = opts.at("compiler");
self->m_installPrefix = opts["installPrefix"];
} catch (std::out_of_range&) {
luaError(L, MEIQUECACHE " file corrupted or created by a old version of meique.");
}
return 0;
}
示例7: setup
void IoDisk::setup(const StringMap & settings)
{
Io::setup(settings);
// --------------------------
// Get name from instance
std::string instanceName = settings.at("name");
setInstanceName(instanceName);
// -------------------------------------------------------------
// Filemanager is mapped to a directory and is used by an image
// to save to the correct directory.
setFileFormat(settings.at("ios.Disk.fileFormat"));
m_fileManager.setBaseDirectory(settings.at("ios.Disk.directory"));
}
示例8: setup
void Sequence::setup(const StringMap & settings)
{
setMinimumChanges(std::atoi(settings.at("heuristics.Sequence.minimumChanges").c_str()));
setSequenceDuration(std::atoi(settings.at("heuristics.Sequence.minimumDuration").c_str()));
setNoMotionDelayTime(std::atoi(settings.at("heuristics.Sequence.noMotionDelayTime").c_str()));
}