File: TupleList.hpp

package info (click to toggle)
pbseqlib 5.3.5%2Bdfsg-10
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 7,148 kB
  • sloc: cpp: 77,259; python: 331; sh: 103; makefile: 41
file content (65 lines) | stat: -rw-r--r-- 1,153 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#ifndef _BLASR_TUPLE_LIST_HPP_
#define _BLASR_TUPLE_LIST_HPP_

#include <algorithm>
#include <cstdint>
#include <fstream>
#include <iostream>
#include <string>
#include <vector>

#include <pbdata/Types.h>
#include <alignment/tuples/TupleMetrics.hpp>

template <typename T>
class TupleList
{
    int listLength;
    TupleMetrics tm;

public:
    typedef T Tuple;
    std::vector<T> tupleList;

    TupleList();

    void Reset();

    T &operator[](int index);

    void GetTupleMetrics(TupleMetrics &ptm);

    void SetTupleMetrics(TupleMetrics &ptm);

    int size();

    int GetLength();

    int InitFromFile(std::string &fileName);

    void clear();

    int WriteToFile(std::string &fileName);

    //
    // Find one instance of a match.
    //
    int Find(T &tuple);

    //
    // Find the boundaries of all instances of a match.
    //
    void FindAll(T &tuple, typename std::vector<T>::const_iterator &firstPos,
                 typename std::vector<T>::const_iterator &endPos);

    void Append(T &tuple);

    void Insert(T &tuple);

    void Sort();

    void Print();
};

#include "TupleListImpl.hpp"
#endif  // _BLASR_TUPLE_LIST_HPP_