本文整理汇总了C++中SamFile::IsEOF方法的典型用法代码示例。如果您正苦于以下问题:C++ SamFile::IsEOF方法的具体用法?C++ SamFile::IsEOF怎么用?C++ SamFile::IsEOF使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SamFile
的用法示例。
在下文中一共展示了SamFile::IsEOF方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: process
bool BamProcessor::process ()
{
if (!infile_.ReadHeader (sam_header_))
ers << "Unable to read SAM header" << Throw;
else
info << "Header read" << std::endl;
if (outfile_.IsOpen ())
{
if (!outfile_.WriteHeader (sam_header_))
ers << "Unable to write header data" << Throw;
else
info << "Header written" << std::endl;
}
// set up signal handlers
sighandler_t sighandler_int, sighandler_term, sighandler_hup;
// set INT handler to int_handler if interrupting is not disabled allready
if ((sighandler_int = signal (SIGINT, int_handler)) == SIG_IGN)
signal (SIGINT, SIG_IGN), sighandler_int = NULL;
// set HUP handler to nothing
sighandler_hup = signal (SIGHUP, SIG_IGN);
// set TERM handler to int_handler if terminating is not disabled allready
if ((sighandler_term = signal (SIGTERM, int_handler)) == SIG_IGN)
signal (SIGTERM, SIG_IGN), sighandler_term = NULL;
begtime_ = time (NULL);
while (!infile_.IsEOF () && !interrupted)
{
if (limit_ && proc_cnt_ >= limit_)
{
info << limit_ << " records processed. Limit reached." << std::endl;
break;
}
if (read_cnt_ == skip_)
timer_.mark ();
infile_.ReadRecord (sam_header_, rec_);
++ read_cnt_;
if (read_cnt_-1 >= skip_)
{
if (!processRecord ())
++ fail_cnt_;
++ proc_cnt_;
if (outfile_.IsOpen ())
outfile_.WriteRecord (sam_header_, rec_);
}
if (timer_ ())
{
info << "\r" << read_cnt_;
if (proc_cnt_ != read_cnt_)
info << " rd " << proc_cnt_;
info << " pr ";
if (realigned_cnt_ != proc_cnt_)
info << realigned_cnt_ << " al (" << (double (realigned_cnt_) * 100 / proc_cnt_) << "%) ";
info << modified_cnt_ << " mod (" << (double (modified_cnt_) * 100 / proc_cnt_) << "%) ";
if (pos_adjusted_cnt_)
info << pos_adjusted_cnt_ << " sh (" << (double (pos_adjusted_cnt_) * 100 / modified_cnt_) << "% mod) ";
info << "in " << timer_.tot_elapsed () << " sec (" << std::setprecision (3) << std::fixed << timer_.speed () << " r/s)" << std::flush;
}
}
if (interrupted)
{
errlog << "\nProcessing interrupted by ";
switch (signal_received)
{
case SIGTERM:
errlog << "TERM signal";
break;
case SIGINT:
errlog << "user's request";
break;
default:
errlog << "receipt of signal " << signal_received;
}
errlog << std::endl;
}
// restore signal handlers
if (sighandler_term)
signal (SIGTERM, sighandler_term);
if (sighandler_int)
signal (SIGINT, sighandler_int);
if (sighandler_hup)
signal (SIGHUP, sighandler_hup);
return 0;
}