本文整理汇总了C++中DynArray::length方法的典型用法代码示例。如果您正苦于以下问题:C++ DynArray::length方法的具体用法?C++ DynArray::length怎么用?C++ DynArray::length使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DynArray
的用法示例。
在下文中一共展示了DynArray::length方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: printbtthreads
void printbtthreads(std::ostream& os, char* msg, DynArray<Thread>& ts){
bool first = true;
for (int i = 0; i < ts.length(); i++){
Thread t = ts[i];
if (t->waitFor != 0){
if (first){ os << iendl << msg << ind; }
first = false;
os << iendl << t->constr->name << " waiting for variable ";
print(os, t->waitFor.ptr());
} else if (t->undefReason != 0){
if (first){ os << iendl << msg << ind; }
first = false;
os << iendl << t->constr->name << " undefined: "
<< iendl << " " << t->undefReason;
if (t->sub != 0)
printbtgoal(os, t->sub->subgoal.ptr());
} else {
switch (t->status){
case ThreadData::SEARCH:
if (first){ os << iendl << msg << ind; }
first = false;
os << iendl << t->constr->name << " suspended for search";
break;
case ThreadData::SUBRESO:
if (first){ os << iendl << msg << ind; }
first = false;
os << iendl << t->constr->name << " waiting for subgoal";
printbtgoal(os, t->sub->subgoal.ptr());
break;
case ThreadData::UNDEFINED:
if (first){ os << iendl << msg << ind; }
first = false;
os << iendl << t->constr->name << " undefined: "
<< iendl << " " << t->undefReason;
if (t->sub != 0)
printbtgoal(os, t->sub->subgoal.ptr());
break;
default:
;
}
}
}
if (!first) os << unind;
}