本文整理汇总了C++中scoped_ptr::getInitialRead方法的典型用法代码示例。如果您正苦于以下问题:C++ scoped_ptr::getInitialRead方法的具体用法?C++ scoped_ptr::getInitialRead怎么用?C++ scoped_ptr::getInitialRead使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类scoped_ptr
的用法示例。
在下文中一共展示了scoped_ptr::getInitialRead方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: errs
void Z3BaseSolverImpl::extractModel(const std::vector<const Array*> &objects,
std::vector<std::vector<unsigned char> > &values) {
z3::model model = solver_.get_model();
#if 0 // TODO: Turn into proper debug logging
std::stringstream model_ss;
model_ss << solver_ << '\n';
model_ss << model; model_ss.flush();
errs() << "[Z3][Debug] Model: " << '\n' << model_ss.str() << '\n';
#endif
values.reserve(objects.size());
for (std::vector<const Array*>::const_iterator it = objects.begin(),
ie = objects.end(); it != ie; ++it) {
const Array *array = *it;
std::vector<unsigned char> data;
#if 0 // TODO: Turn into proper debug logging
errs() << "[Z3][Debug] Array name: " << array->name << '\n';
#endif
data.reserve(array->size);
for (unsigned offset = 0; offset < array->size; ++offset) {
z3::expr value_ast = model.eval(
builder_->getInitialRead(array, offset), true);
unsigned value_num;
#if 0 // TODO: Turn into proper debug logging
std::stringstream ss;
ss << builder_->getInitialRead(array, offset) << " // " << value_ast; ss.flush();
errs() << "[Z3][Debug] Initial read eval: " << ss.str() << '\n';
#endif
Z3_bool conv_result = Z3_get_numeral_uint(context_, value_ast,
&value_num);
assert(conv_result == Z3_TRUE && "Could not convert value");
assert(value_num < (1 << 8*sizeof(unsigned char))
&& "Invalid model value");
data.push_back((unsigned char)value_num);
}
values.push_back(data);
}
}