Store Sequence sequence location in a shared_ptr class
[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 // FIXME: Deprecate! SeqSpan and/or Sequence should replace sequence location
8 //! convenience structure for holding selected track segments
9 class SequenceLocation {
10   public:
11     typedef size_t size_type;
12     
13     SequenceLocation(boost::shared_ptr<Sequence> s, int l, int r);
14     SequenceLocation(const Sequence& s, int l, int r);
15     SequenceLocation(const SequenceLocation& );
16     SequenceLocation& operator=(const SequenceLocation&);
17
18     //! get the sequence we're selecting from
19     const Sequence& getSequence() const;
20     //! return the selected subsequence
21     Sequence getSelectedSequence() const;
22     void setLeft(int l);
23     int getLeft() const;
24     void setCount(size_type c);
25     size_type getCount() const;
26     //! set one past the right-most base 
27     void setRight(int r);
28     int getRight() const;
29
30     //! return total length of region (alias for getCount())
31     size_type size() const;
32   private:
33     boost::shared_ptr<Sequence> sequence;
34     int left;
35     int right;
36   };
37 #endif