本文整理汇总了C++中IResource::GetArray方法的典型用法代码示例。如果您正苦于以下问题:C++ IResource::GetArray方法的具体用法?C++ IResource::GetArray怎么用?C++ IResource::GetArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IResource
的用法示例。
在下文中一共展示了IResource::GetArray方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CHECK
IResource *ResourceSet::GetInternalArrayResource(vm::Object *obj) {
CHECK(vm::ArrayWrapper::IsIntArray(obj));
auto it = array_resources_.find(obj);
if (it != array_resources_.end()) {
return it->second;
}
vm::IntArray *memory = vm::ArrayWrapper::GetIntArray(obj);
int address_bits;
for (address_bits = 0; (1 << address_bits) < (int)memory->GetLength();
++address_bits) {
// do nothing here.
}
int data_bits = numeric::Width::GetWidth(memory->GetWidth());
IResource *res =
DesignTool::CreateArrayResource(tab_, address_bits, data_bits, false, true);
if (memory->GetLength() > 0) {
IDesign *design = tab_->GetModule()->GetDesign();
IArrayImage *image = new IArrayImage(design);
design->array_images_.push_back(image);
for (int i = 0; i < memory->GetLength(); ++i) {
image->values_.push_back(numeric::Numeric::GetInt(memory->Read(i)));
}
res->GetArray()->SetArrayImage(image);
}
array_resources_[obj] = res;
return res;
}