Commit 179ae31f authored by Mathieu Giraud's avatar Mathieu Giraud

core/kmeraffect.{h,cpp}: now there is a length, getLength()

parent 980c050d
......@@ -225,16 +225,19 @@ ostream &operator<<(ostream &os, const KmerAffect &kmer) {
KmerStringAffect::KmerStringAffect() {
label = "";
strand = 0;
length = 0;
}
KmerStringAffect::KmerStringAffect(const KmerStringAffect &ksa):
label(ksa.label),strand(ksa.strand){}
label(ksa.label),strand(ksa.strand),length(ksa.length){}
KmerStringAffect::KmerStringAffect(const string &label,
int strand) {
int strand,
unsigned char length) {
this->label = label;
this->strand = strand;
this->length = length;
}
KmerStringAffect &KmerStringAffect::operator+=(const KmerStringAffect &kmer) {
......@@ -257,6 +260,7 @@ KmerStringAffect &KmerStringAffect::operator+=(const KmerStringAffect &kmer) {
KmerStringAffect &KmerStringAffect::operator=(const KmerStringAffect &ka) {
label = ka.label;
strand = ka.strand;
length = ka.length;
return *this;
}
......@@ -272,6 +276,10 @@ string KmerStringAffect::getLabel() const {
return label;
}
unsigned char KmerStringAffect::getLength() const {
return length;
}
KmerStringAffect KmerStringAffect::getUnknown() {
return KSA_UNKNOWN;
}
......
......@@ -236,6 +236,7 @@ class KmerStringAffect {
public:
string label;
int strand;
unsigned char length;
/**
* Construct an unknown affectation.
......@@ -245,9 +246,8 @@ public:
KmerStringAffect(const KmerStringAffect &);
/**
* Construct an affectation as stated by the parameters
* @post affect_strand(affect) == strand AND affect_char(affect) == kmer[0]
*/
KmerStringAffect(const string &label, int strand=1);
KmerStringAffect(const string &label, int strand=1, unsigned char length=0);
/**
* Add another affectation to the current one.
* @post The current affectation is not modified if the parameter is the same
......@@ -283,6 +283,11 @@ public:
*/
string getLabel() const;
/**
* @return the length of such an affectation
*/
unsigned char getLength() const;
/**
* @return the unknown affectation
*/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment