Exemple #1
0
  bool Reader::next(Overlap** dst, const ReadSet& reads) {
    if (!has_next()) {
      return false;
    }

    while (next_type() != OVERLAP) {
      skip_next();
      if (!has_next()) {
        return false;
      }
    }

    return overlap_from_buff(dst, reads);
  }
Exemple #2
0
  bool Reader::next(Read** dst) {
    if (!has_next()) {
      return false;
    }

    while (next_type() != READ) {
      //cerr << "WRONG TYPE" << endl;
      skip_next();
      if (!has_next()) {
        return false;
      }
    }

    //cout << "READ " << buff << endl;
    return read_from_buff(dst);
  }
Exemple #3
0
static int reset_counters(void)
{
    struct gcov_info *info;

    for ( info = info_list ; info; info = info->next )
    {
        const struct gcov_ctr_info *ctr;
        int type;

        /* reset counters */
        ctr = info->counts;
        for ( type = -1; next_type(info, &type) < XENCOV_COUNTERS; ++ctr )
            memset(ctr->values, 0, ctr->num * sizeof(ctr->values[0]));
    }

    return 0;
}
Exemple #4
0
static int write_gcov(write_iter_t *iter)
{
    struct gcov_info *info;
    int ret;

    /* reset offset */
    iter->write_offset = 0;

    /* dump all files */
    for ( info = info_list ; info; info = info->next )
    {
        const struct gcov_ctr_info *ctr;
        int type;
        size_t size_fn = sizeof(struct gcov_fn_info);

        align_iter(iter);
        chk(write32(iter, XENCOV_TAG_FILE));
        chk(write32(iter, info->version));
        chk(write32(iter, info->stamp));
        chk(write_string(iter, info->filename));

        /* dump counters */
        ctr = info->counts;
        for ( type = -1; next_type(info, &type) < XENCOV_COUNTERS; ++ctr )
        {
            align_iter(iter);
            chk(write32(iter, XENCOV_TAG_COUNTER(type)));
            chk(write32(iter, ctr->num));
            chk(write_raw(iter, ctr->values,
                          ctr->num * sizeof(ctr->values[0])));

            size_fn += sizeof(unsigned);
        }

        /* dump all functions together */
        align_iter(iter);
        chk(write32(iter, XENCOV_TAG_FUNC));
        chk(write32(iter, info->n_functions));
        chk(write_raw(iter, info->functions, info->n_functions * size_fn));
    }

    /* stop tag */
    align_iter(iter);
    chk(write32(iter, XENCOV_TAG_END));
    return 0;
}
Exemple #5
0
 next_type  operator,(Scalar const & value)
 {
     m(I, J) = value;
     return next_type(m);
 }