-
Notifications
You must be signed in to change notification settings - Fork 0
/
GenomePosition.h
executable file
·49 lines (36 loc) · 1.14 KB
/
GenomePosition.h
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
#ifndef GENOMEPOSITION_H
#define GENOMEPOSITION_H
#include <iostream>
class GenomePosition
{
public:
GenomePosition(int referenceId, const std::string& referenceName, int position);
GenomePosition() : GenomePosition(-1, "NA", 0) {}
int GetReferenceId() const { return referenceId; }
std::string GetReferenceName() const { return referenceName; }
int GetPosition() const { return position; }
bool operator == (const GenomePosition &other) const
{
return referenceId == other.referenceId &&
referenceName == other.referenceName &&
position == other.position;
}
GenomePosition& operator += (int x)
{
position += x;
return *this;
}
GenomePosition& operator -= (int x)
{
*this += -x;
return *this;
}
friend std::ostream &operator <<(std::ostream& stream, const GenomePosition& gPos);
private:
int referenceId;
std::string referenceName;
int position;
};
const GenomePosition operator + (const GenomePosition& one, int x);
const GenomePosition operator - (const GenomePosition& one, int x);
#endif // GENOMEPOSITION_H