35 #ifndef MULTOVL_REGION_HEADER
36 #define MULTOVL_REGION_HEADER
53 #include "boost/operators.hpp"
54 #include "boost/serialization/access.hpp"
55 #include "boost/serialization/string.hpp"
56 #include "boost/serialization/version.hpp"
57 #include "boost/serialization/split_member.hpp"
66 boost::less_than_comparable< Region,
67 boost::equality_comparable<Region> >
73 _first(0), _last(0), _length(0),
89 Region(
unsigned int f,
unsigned int l,
90 char s,
const std::string& nm);
99 void set_coords(
unsigned int f,
unsigned int l);
106 std::string
name(
const std::string& nm);
111 const unsigned int&
first()
const {
return _first; }
114 const unsigned int&
last()
const {
return _last; }
117 const unsigned int&
length()
const {
return _length; }
123 const char&
strand()
const {
return _strand; }
126 const std::string&
name()
const {
return _name; }
153 unsigned int _first, _last, _length;
158 friend class boost::serialization::access;
159 template <
class Archive>
160 void save(Archive& ar,
const unsigned int version)
const
162 ar << _first << _last
166 template <
class Archive>
167 void load(Archive& ar,
const unsigned int version)
175 BOOST_SERIALIZATION_SPLIT_MEMBER()
180 #endif // MULTOVL_REGION_HEADER
const unsigned int & first() const
Returns the first coordinate.
Definition: region.hh:111
bool operator<(const Region &rhs) const
bool is_empty() const
Zero-length regions are considered empty.
Definition: region.hh:120
Region()
Inits to empty (makes sense when using as input buffer)
Definition: region.hh:72
Instances of the Region class represent regions on a sequence. They have first and last coordinates...
Definition: region.hh:65
bool operator==(const Region &rhs) const
Definition: region.hh:137
const std::string & name() const
Returns the name of the region.
Definition: region.hh:126
const char & strand() const
Returns the strand information.
Definition: region.hh:123
void set_coords(unsigned int f, unsigned int l)
bool equal_pos(const Region &rhs) const
Definition: region.hh:130
virtual ~Region()
empty virtual dtor
Definition: region.hh:93
std::string name(const std::string &nm)
const unsigned int & last() const
Returns the last coordinate.
Definition: region.hh:114
const unsigned int & length() const
Returns the length.
Definition: region.hh:117
void strand(char s)
Sets the strand.