本文整理汇总了C++中IResource::GetParams方法的典型用法代码示例。如果您正苦于以下问题:C++ IResource::GetParams方法的具体用法?C++ IResource::GetParams怎么用?C++ IResource::GetParams使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IResource
的用法示例。
在下文中一共展示了IResource::GetParams方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
IResource *ResourceSet::GetImportedResource(vm::Method *method) {
synth::ResourceParams *dparams =
method->parse_tree_->imported_resource_;
string name = dparams->GetResourceName();
for (IResource *res : imported_resources_) {
iroha::ResourceParams *iparams = res->GetParams();
if (iparams->GetEmbeddedModuleName() == name) {
return res;
}
}
string fn = dparams->GetCopyFileName();
IResource *res =
DesignTool::CreateEmbedResource(tab_, name, fn);
iroha::ResourceParams *iparams = res->GetParams();
vector<string> args;
fe::VarDeclSet *a = method->parse_tree_->args_;
if (a) {
for (fe::VarDecl *vd : a->decls) {
args.push_back(sym_cstr(vd->name_expr->sym_));
IValueType vt;
if (vd->type == sym_bool) {
vt.SetWidth(0);
} else {
vt.SetWidth(numeric::Width::GetWidth(vd->width));
}
res->input_types_.push_back(vt);
}
}
iparams->SetValues(resource::kEmbeddedModuleArgs, args);
args.clear();
args.push_back("req");
iparams->SetValues(resource::kEmbeddedModuleReq, args);
string ack = dparams->GetAckPinName();
if (!ack.empty()) {
args.clear();
args.push_back(ack);
iparams->SetValues(resource::kEmbeddedModuleAck, args);
}
return res;
}