All Classes Namespaces Functions Pages
halMappedSegment.h
/*
* Copyright (C) 2013 by Glenn Hickey (hickey@soe.ucsc.edu)
*
* Released under the MIT license, see LICENSE.txt
*/
#ifndef _HALMAPPEDSEGMENT_H
#define _HALMAPPEDSEGMENT_H
#include "halDefs.h"
#include "halSlicedSegment.h"
namespace hal {
class MappedSegment : public virtual SlicedSegment
{
public:
virtual SlicedSegmentConstPtr getSource() const = 0;
virtual bool lessThan(const MappedSegmentConstPtr& other) const = 0;
virtual bool lessThanBySource(const MappedSegmentConstPtr& other) const = 0;
virtual bool equals(const MappedSegmentConstPtr& other) const = 0;
virtual void flip() const = 0;
virtual void fullReverse() const = 0;
virtual MappedSegmentConstPtr copy() const = 0;
virtual bool canMergeRightWith(
const MappedSegmentConstPtr& next,
const std::set<hal_index_t>* cutSet = NULL,
const std::set<hal_index_t>* sourceCutSet = NULL) const = 0;
struct LessSource { bool operator()(const MappedSegmentConstPtr& ms1,
const MappedSegmentConstPtr& ms2) const {
return ms1->lessThanBySource(ms2); }
};
struct Less { bool operator()(const MappedSegmentConstPtr& ms1,
const MappedSegmentConstPtr& ms2) const {
return ms1->lessThan(ms2); }
};
struct EqualTo { bool operator()(const MappedSegmentConstPtr& ms1,
const MappedSegmentConstPtr& ms2) const {
return ms1->equals(ms2); }
};
// NEEDS TO BE ADDED TO SEGMENT INTERFACE
virtual void print(std::ostream& os) const = 0;
protected:
friend class counted_ptr<MappedSegment>;
friend class counted_ptr<const MappedSegment>;
virtual ~MappedSegment() = 0;
};
inline MappedSegment::~MappedSegment() {}
}
namespace std {
template<>
struct less<hal::MappedSegmentConstPtr>
{
bool operator()(const hal::MappedSegmentConstPtr& m1,
const hal::MappedSegmentConstPtr& m2) const
{
return m1->lessThan(m2);
}
};
}
#endif
hal::MappedSegment::lessThanBySource
virtual bool lessThanBySource(const MappedSegmentConstPtr &other) const =0
hal::MappedSegment::canMergeRightWith
virtual bool canMergeRightWith(const MappedSegmentConstPtr &next, const std::set< hal_index_t > *cutSet=NULL, const std::set< hal_index_t > *sourceCutSet=NULL) const =0
hal::MappedSegment::LessSource
Definition: halMappedSegment.h:66
hal::MappedSegment::equals
virtual bool equals(const MappedSegmentConstPtr &other) const =0
hal::MappedSegment::flip
virtual void flip() const =0
hal::MappedSegment::Less
Definition: halMappedSegment.h:73
hal::MappedSegment::lessThan
virtual bool lessThan(const MappedSegmentConstPtr &other) const =0
hal::MappedSegment::copy
virtual MappedSegmentConstPtr copy() const =0
hal::MappedSegment::getSource
virtual SlicedSegmentConstPtr getSource() const =0
hal::MappedSegment::fullReverse
virtual void fullReverse() const =0
hal::MappedSegment
Definition: halMappedSegment.h:23
hal::MappedSegment::print
virtual void print(std::ostream &os) const =0
hal::SlicedSegment
Definition: halSlicedSegment.h:22
hal::MappedSegment::EqualTo
Definition: halMappedSegment.h:79