本文整理汇总了C++中BlockModel::error方法的典型用法代码示例。如果您正苦于以下问题:C++ BlockModel::error方法的具体用法?C++ BlockModel::error怎么用?C++ BlockModel::error使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BlockModel
的用法示例。
在下文中一共展示了BlockModel::error方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: construct
Model* construct (const Block& context, const symbol key,
const FrameModel& frame) const
{
BlockModel block (context, frame, key);
if (!frame.check (context))
return NULL;
try
{ return builder.make (block); }
catch (const std::string& err)
{ block.error ("Build failed: " + err); }
catch (const char *const err)
{ block.error ("Build failure: " + std::string (err)); }
return NULL;
}
示例2: RubiscoNdist
rubiscoNdist_expr (const BlockModel& al)
: RubiscoNdist (al),
f_photo (al.number ("f_photo")),
expr (Librarian::build_item<Number> (al, "value")),
scope (__FUNCTION__)
{
scope.add_item (new ExchangeNumber (LAI_symbol, Attribute::None(),
"Leaf area index"));
scope.add_item (new ExchangeNumber (distance_from_top_symbol, "cm",
"Distance from top of canopy"));
scope.add_item (new ExchangeNumber (relative_LAI_symbol, Attribute::None(),
"Relative leaf area index"));
scope.add_item (new ExchangeNumber (relative_distance_from_top_symbol, Attribute::None(),
"Relative distance from top of canopy"));
scope.add_item (new ExchangeNumber (DS_symbol, Attribute::None(),
"Development stage"));
scope.done ();
expr->initialize (al.units (), scope, al.msg());
if (!expr->check_dim (al.units (), scope, Attribute::Fraction (), al.msg()))
al.error("Invalid expression of rubisco expr");
}