本文整理汇总了C++中Printer::print_topline方法的典型用法代码示例。如果您正苦于以下问题:C++ Printer::print_topline方法的具体用法?C++ Printer::print_topline怎么用?C++ Printer::print_topline使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Printer
的用法示例。
在下文中一共展示了Printer::print_topline方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: print_report
int print_report(FILE *fp, __u64 begin, __u64 end, __u32 interval,
char *filename, __u64 topline,
list<MsgTypes> *filter_types,
DeviceFilter &dev_filter, Collapser &col,
Printer &printer)
{
int frames_printed = 0;
bool first_time = true;
time_t t;
int rc = 0;
Frameset frameset(&col);
Framer framer(begin, end, interval,
filter_types, &dev_filter,
filename, &rc);
if (rc)
return -1;
if (topline && printer.print_csv()) {
fprintf(stderr, "%s: Warning: Cannot use '-t' with CSV mode,"
" ignoring\n", toolname);
topline = 0;
}
verbose_msg("print report for:\n");
t = (time_t)begin;
verbose_msg(" begin : %s", ctime(&t));
t = (time_t)end;
verbose_msg(" end : %s", (end == UINT64_MAX ? "-\n" : ctime(&t)));
verbose_msg(" interval : %lu\n", (long unsigned int)interval);
verbose_msg(" topline : %llu\n", (long long unsigned int)topline);
verbose_msg(" csv mode : %d\n", printer.print_csv());
while ( (rc = framer.get_next_frameset(frameset, true)) == 0 ) {
vverbose_msg("printing frameset %d\n", frames_printed);
if (first_time || (topline && frames_printed % topline == 0)) {
first_time = false;
printer.print_topline(fp);
}
if (printer.print_frame(fp, frameset, dev_filter) < 0)
return -1;
++frames_printed;
}
if (rc > 0)
return frames_printed;
return rc;
}