halapi
hierarchichalalignmentformatapi
 All Classes Namespaces Functions Pages
halSlicedSegment.h
1 /*
2  * Copyright (C) 2013 by Glenn Hickey (hickey@soe.ucsc.edu)
3  *
4  * Released under the MIT license, see LICENSE.txt
5  */
6 
7 #ifndef _HALSLICEDSEGMENT_H
8 #define _HALSLICEDSEGMENT_H
9 
10 #include "halDefs.h"
11 #include "halSegment.h"
12 
13 namespace hal {
14 
15 class MappedSegment;
16 
22 class SlicedSegment : public virtual Segment
23 {
24 public:
25 
27  virtual void toReverse() const = 0;
28 
37  virtual void toReverseInPlace() const = 0;
38 
42  virtual hal_offset_t getStartOffset() const = 0;
43 
47  virtual hal_offset_t getEndOffset() const = 0;
48 
52  virtual void slice(hal_offset_t startOffset = 0,
53  hal_offset_t endOffset = 0) const = 0;
54 
55 
57  virtual bool getReversed() const = 0;
58 
59 
60 protected:
61  friend class counted_ptr<SlicedSegment>;
62  friend class counted_ptr<const SlicedSegment>;
63  virtual ~SlicedSegment() = 0;
64 };
65 
66 inline SlicedSegment::~SlicedSegment() {}
67 
68 inline bool operator<(SlicedSegmentConstPtr segmentIt,
69  hal_index_t genomePos)
70 {
71  return segmentIt->leftOf(genomePos);
72 }
73 
74 inline bool operator>(SlicedSegmentConstPtr segmentIt,
75  hal_index_t genomePos)
76 {
77  return segmentIt->rightOf(genomePos);
78 }
79 
80 }
81 #endif
Definition: halSegment.h:21
virtual hal_offset_t getEndOffset() const =0
virtual bool getReversed() const =0
virtual hal_offset_t getStartOffset() const =0
virtual void toReverseInPlace() const =0
virtual void toReverse() const =0
Definition: halSlicedSegment.h:22
virtual void slice(hal_offset_t startOffset=0, hal_offset_t endOffset=0) const =0