make marker placement methods noncopyable, movable

This commit is contained in:
Jiri Drbalek 2014-10-27 12:45:06 +00:00
parent 69fc93d87a
commit 000c2713ed
5 changed files with 36 additions and 2 deletions

View file

@ -37,6 +37,10 @@ public:
{
}
markers_interior_placement(markers_interior_placement && rhs)
: markers_point_placement<Locator, Detector>(std::move(rhs))
{}
bool get_point(double &x, double &y, double &angle, bool ignore_placement)
{
if (this->done_)

View file

@ -52,6 +52,19 @@ public:
rewind();
}
markers_line_placement(markers_line_placement && rhs)
: markers_point_placement<Locator, Detector>(std::move(rhs)),
last_x(std::move(rhs.last_x)),
last_y(std::move(rhs.last_y)),
next_x(std::move(rhs.next_x)),
next_y(std::move(rhs.next_y)),
spacing_(std::move(rhs.spacing_)),
marker_width_(std::move(rhs.marker_width_)),
error_(std::move(rhs.error_)),
spacing_left_(std::move(rhs.spacing_left_)),
marker_nr_(std::move(rhs.marker_nr_))
{}
void rewind()
{
this->locator_.rewind(0);

View file

@ -41,7 +41,7 @@ struct markers_placement_params
};
template <typename Locator, typename Detector>
class markers_point_placement
class markers_point_placement : noncopyable
{
public:
markers_point_placement(Locator &locator, Detector &detector, markers_placement_params const& params)
@ -53,6 +53,14 @@ public:
rewind();
}
markers_point_placement(markers_point_placement && rhs)
: locator_(rhs.locator_),
detector_(rhs.detector_),
params_(rhs.params_),
done_(rhs.done_)
{}
// Start again at first marker. Returns the same list of markers only works when they were NOT added to the detector.
void rewind()
{

View file

@ -36,6 +36,10 @@ public:
{
}
markers_vertex_first_placement(markers_vertex_first_placement && rhs)
: markers_point_placement<Locator, Detector>(std::move(rhs))
{}
bool get_point(double &x, double &y, double &angle, bool ignore_placement)
{
if (this->done_)

View file

@ -32,7 +32,12 @@ class markers_vertex_last_placement : public markers_point_placement<Locator, De
{
public:
markers_vertex_last_placement(Locator &locator, Detector &detector, markers_placement_params const& params)
: markers_point_placement<Locator, Detector>(locator, detector, params) {}
: markers_point_placement<Locator, Detector>(locator, detector, params)
{}
markers_vertex_last_placement(markers_vertex_last_placement && rhs)
: markers_point_placement<Locator, Detector>(std::move(rhs))
{}
bool get_point(double &x, double &y, double &angle, bool ignore_placement)
{