本文整理汇总了C++中ConfigSet::addBuilder方法的典型用法代码示例。如果您正苦于以下问题:C++ ConfigSet::addBuilder方法的具体用法?C++ ConfigSet::addBuilder怎么用?C++ ConfigSet::addBuilder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConfigSet
的用法示例。
在下文中一共展示了ConfigSet::addBuilder方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
DoctypeFixture *addDocType(const std::string &name, bool isGlobal = false) {
DocumenttypesConfigBuilder::Documenttype dt;
dt.bodystruct = -1270491200;
dt.headerstruct = 306916075;
dt.id = idcounter--;
dt.name = name;
dt.version = 0;
documenttypesBuilder.documenttype.push_back(dt);
ProtonConfigBuilder::Documentdb db;
db.inputdoctypename = name;
db.configid = configId + "/" + name;
db.global = isGlobal;
protonBuilder.documentdb.push_back(db);
DoctypeFixture::UP fixture = std::make_unique<DoctypeFixture>();
set.addBuilder(db.configid, &fixture->attributesBuilder);
set.addBuilder(db.configid, &fixture->rankProfilesBuilder);
set.addBuilder(db.configid, &fixture->rankingConstantsBuilder);
set.addBuilder(db.configid, &fixture->indexschemaBuilder);
set.addBuilder(db.configid, &fixture->summaryBuilder);
set.addBuilder(db.configid, &fixture->summarymapBuilder);
set.addBuilder(db.configid, &fixture->juniperrcBuilder);
set.addBuilder(db.configid, &fixture->importedFieldsBuilder);
return dbConfig.emplace(std::make_pair(name, std::move(fixture))).first->second.get();
}
示例2: ConfigTestFixture
ConfigTestFixture(const std::string & id)
: configId(id),
protonBuilder(),
documenttypesBuilder(),
filedistBuilder(),
bucketspacesBuilder(),
dbConfig(),
set(),
context(new ConfigContext(set)),
idcounter(-1)
{
set.addBuilder(configId, &protonBuilder);
set.addBuilder(configId, &documenttypesBuilder);
set.addBuilder(configId, &filedistBuilder);
set.addBuilder(configId, &bucketspacesBuilder);
addDocType("_alwaysthere_");
}