b8c6e9c4549dc9258585e25757e484029f61ac15
[mussa.git] / alg / sequence_location.hpp
1 #ifndef _SEQUENCE_LOCATION_H_
2 #define _SEQUENCE_LOCATION_H_
3
4 #include <boost/shared_ptr.hpp>
5 #include "alg/sequence.hpp"
6
7 //! convenience structure for holding selected track segments
8 class SequenceLocation {
9   public:
10     typedef size_t size_type;
11     
12     SequenceLocation(boost::shared_ptr<Sequence> s, int l, int r);
13     SequenceLocation(const Sequence& s, int l, int r);
14     SequenceLocation(const SequenceLocation& );
15     SequenceLocation& operator=(const SequenceLocation&);
16
17     //! get the sequence we're selecting from
18     const Sequence& getSequence() const;
19     //! return the selected subsequence
20     Sequence getSelectedSequence() const;
21     void setLeft(int l);
22     int getLeft() const;
23     void setCount(size_type c);
24     size_type getCount() const;
25     //! set one past the right-most base 
26     void setRight(int r);
27     int getRight() const;
28
29     //! return total length of region (alias for getCount())
30     size_type size() const;
31   private:
32     boost::shared_ptr<Sequence> sequence;
33     int left;
34     int right;
35   };
36 #endif