本文整理汇总了C++中params::getInput方法的典型用法代码示例。如果您正苦于以下问题:C++ params::getInput方法的具体用法?C++ params::getInput怎么用?C++ params::getInput使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类params
的用法示例。
在下文中一共展示了params::getInput方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Error
std::shared_ptr<AbstractTable> Loader::load(const params &args) {
AbstractHeader *header = args.getHeader();
AbstractTableFactory *factory = args.getFactory();
AbstractInput *input = args.getInput();
//TODO avoid leakage
if (input == nullptr) {
input = new EmptyInput();
}
if (header == nullptr) {
header = new EmptyHeader();
}
if (factory == nullptr) {
factory = new TableFactory<>();
}
LOG4CXX_DEBUG(logger, "Loading header");
compound_metadata_list *meta = header->load(args);
LOG4CXX_DEBUG(logger, "Header done");
std::shared_ptr<AbstractTable>
result, //initialize empty
table = std::make_shared<MutableVerticalTable>(*meta, nullptr, 0, false, factory, args.getCompressed());
LOG4CXX_DEBUG(logger, "Loading data");
try {
result = input->load(table, meta, args);
} catch (std::exception& e) {
// TODO: Memory management is not exception safe
for (const auto & ml : *meta) {
for (const auto & f : *ml)
delete f;
delete ml;
}
throw Loader::Error(e.what());
}
// Memory Cleanup, this is so dirty here, it makes me shiver
for (auto e : *meta) {
for (auto f: *e)
delete f;
delete e;
}
delete meta;
LOG4CXX_DEBUG(logger, "Data done");
if (!args.getModifiableMutableVerticalTable() && input->needs_store_wrap()) {
std::shared_ptr<Store> s = std::make_shared<Store>(result);
TableMerger *merger = new TableMerger(new LogarithmicMergeStrategy(0), new SequentialHeapMerger(), args.getCompressed());
s->setMerger(merger);
s->merge();
result = s;
}
auto param = args.getInsertOnly();
if (param.InsertOnly) {
std::shared_ptr<AbstractTable> table = std::make_shared<hyrise::storage::SimpleStore>(generateValidityTable(result, param.transaction_id));
return table;
}
if (!args.getModifiableMutableVerticalTable() && args.getReturnsMutableVerticalTable()) {
table = std::dynamic_pointer_cast<Store>(result)->getMainTables()[0];
result = table;
}
if (args.getHeader() == nullptr)
delete header;
if (args.getFactory() == nullptr)
delete factory;
if (args.getInput() == nullptr)
delete input;
return result;
}