mirror of https://github.com/CGAL/cgal
Added missing copy constructor && assignmnet
This commit is contained in:
parent
a331ede932
commit
414103f286
|
|
@ -51,12 +51,34 @@ protected:
|
|||
bool m_own_traits; // inidicates whether the kernel should be freed up.
|
||||
|
||||
public:
|
||||
// The pointer to the traits and the flag that indicate ownership should be
|
||||
// replaced with a smart pointer. Meanwhile, the copy constructor and
|
||||
// copy assignment prevent double delition. Notice that once a copy
|
||||
// constructor (assignment) is present, the move constructor (assignment)
|
||||
// is implicitly not generated anyway.
|
||||
|
||||
/*! Default constructor. */
|
||||
Polygon_decomposition_strategy_adapter() :
|
||||
m_traits(nullptr),
|
||||
m_own_traits(false)
|
||||
{ init(); }
|
||||
|
||||
/*! Copy constructor. */
|
||||
Polygon_decomposition_strategy_adapter
|
||||
(const Polygon_decomposition_strategy_adapter& other) :
|
||||
m_traits((other.m_own_traits) ? new Traits_2 : other.m_traits),
|
||||
m_own_traits(other.m_own_traits)
|
||||
{ init(); }
|
||||
|
||||
/*! Copy assignment. */
|
||||
Polygon_decomposition_strategy_adapter&
|
||||
operator=(const Polygon_decomposition_strategy_adapter& other) {
|
||||
m_traits = (other.m_own_traits) ? new Traits_2 : other.m_traits;
|
||||
m_own_traits = other.m_own_traits;
|
||||
init();
|
||||
return *this;
|
||||
}
|
||||
|
||||
/*! Constructor. */
|
||||
Polygon_decomposition_strategy_adapter(const Traits_2& traits) :
|
||||
m_traits(traits),
|
||||
|
|
|
|||
|
|
@ -117,12 +117,34 @@ private:
|
|||
Ccw_in_between_2 f_ccw_in_between;
|
||||
|
||||
public:
|
||||
// The pointer to the kernel and the flag that indicate ownership should be
|
||||
// replaced with a smart pointer. Meanwhile, the copy constructor and
|
||||
// copy assignment prevent double delition. Notice that once a copy
|
||||
// constructor (assignment) is present, the move constructor (assignment)
|
||||
// is implicitly not generated anyway.
|
||||
|
||||
/*! Default constructor. */
|
||||
Minkowski_sum_by_convolution_2() :
|
||||
m_kernel(new Kernel),
|
||||
m_own_kernel(true)
|
||||
{ init(); }
|
||||
|
||||
/*! Copy constructor. */
|
||||
Minkowski_sum_by_convolution_2
|
||||
(const Minkowski_sum_by_convolution_2& other) :
|
||||
m_kernel((other.m_own_kernel) ? new Kernel : other.m_kernel),
|
||||
m_own_kernel(other.m_own_kernel)
|
||||
{ init(); }
|
||||
|
||||
/*! Copy assignment. */
|
||||
Minkowski_sum_by_convolution_2&
|
||||
operator=(const Minkowski_sum_by_convolution_2& other) {
|
||||
m_kernel = (other.m_own_kernel) ? new Kernel : other.m_kernel;
|
||||
m_own_kernel = other.m_own_kernel;
|
||||
init();
|
||||
return *this;
|
||||
}
|
||||
|
||||
/*! Constructor. */
|
||||
Minkowski_sum_by_convolution_2(const Kernel& kernel) :
|
||||
m_kernel(&kernel),
|
||||
|
|
|
|||
|
|
@ -90,6 +90,12 @@ private:
|
|||
Compare_xy_2 f_compare_xy;
|
||||
|
||||
public:
|
||||
// The pointers and the corresponding flags that indicate ownerships should
|
||||
// be replaced with smart pointers. Meanwhile, the copy constructor and
|
||||
// copy assignment prevent double delition. Notice that once a copy
|
||||
// constructor (assignment) is present, the move constructor (assignment)
|
||||
// is implicitly not generated anyway.
|
||||
|
||||
//! Default constructor.
|
||||
Minkowski_sum_by_decomposition_2() :
|
||||
m_decomposition_strategy1(nullptr),
|
||||
|
|
@ -100,6 +106,36 @@ public:
|
|||
m_own_traits(false)
|
||||
{ init(); }
|
||||
|
||||
//! Copy constructor.
|
||||
Minkowski_sum_by_decomposition_2
|
||||
(const Minkowski_sum_by_decomposition_2& other) :
|
||||
m_decomposition_strategy1((other.m_own_strategy1) ?
|
||||
new Decomposition_strategy1 :
|
||||
other.m_decomposition_strategy1),
|
||||
m_decomposition_strategy2((other.m_own_strategy2) ?
|
||||
new Decomposition_strategy2 :
|
||||
other.m_decomposition_strategy2),
|
||||
m_own_strategy1(other.m_own_strategy1),
|
||||
m_own_strategy2(other.m_own_strategy2),
|
||||
m_traits((other.m_own_traits) ? new Traits_2 : other.m_traits),
|
||||
m_own_traits(other.m_own_traits)
|
||||
{ init(); }
|
||||
|
||||
//! Copy assignment.
|
||||
Minkowski_sum_by_decomposition_2&
|
||||
operator=(const Minkowski_sum_by_decomposition_2& other) {
|
||||
m_decomposition_strategy1 = (other.m_own_strategy1) ?
|
||||
new Decomposition_strategy1 : other.m_decomposition_strategy1;
|
||||
m_decomposition_strategy2 = (other.m_own_strategy2) ?
|
||||
new Decomposition_strategy2 : other.m_decomposition_strategy2;
|
||||
m_own_strategy1 = other.m_own_strategy1;
|
||||
m_own_strategy2 = other.m_own_strategy2;
|
||||
m_traits = (other.m_own_traits) ? new Traits_2 : other.m_traits;
|
||||
m_own_traits = other.m_own_traits;
|
||||
init();
|
||||
return *this;
|
||||
}
|
||||
|
||||
//! Constructor.
|
||||
Minkowski_sum_by_decomposition_2(const Decomposition_strategy1& strategy1,
|
||||
const Decomposition_strategy2& strategy2,
|
||||
|
|
|
|||
|
|
@ -100,12 +100,34 @@ private:
|
|||
Equal_2 f_equal;
|
||||
|
||||
public:
|
||||
// The pointer to the traits and the flag that indicate ownership should be
|
||||
// replaced with a smart pointer. Meanwhile, the copy constructor and
|
||||
// copy assignment prevent double delition. Notice that once a copy
|
||||
// constructor (assignment) is present, the move constructor (assignment)
|
||||
// is implicitly not generated anyway.
|
||||
|
||||
/*! Default constructor. */
|
||||
Polygon_vertical_decomposition_2() :
|
||||
m_traits(nullptr),
|
||||
m_own_traits(false)
|
||||
{ init(); }
|
||||
|
||||
/*! Copy constructor. */
|
||||
Polygon_vertical_decomposition_2
|
||||
(const Polygon_vertical_decomposition_2& other) :
|
||||
m_traits((other.m_own_traits) ? new Traits_2 : other.m_traits),
|
||||
m_own_traits(other.m_own_traits)
|
||||
{ init(); }
|
||||
|
||||
/*! Copy assignment. */
|
||||
Polygon_vertical_decomposition_2&
|
||||
operator=(const Polygon_vertical_decomposition_2& other) {
|
||||
m_traits = (other.m_own_traits) ? new Traits_2 : other.m_traits;
|
||||
m_own_traits = other.m_own_traits;
|
||||
init();
|
||||
return *this;
|
||||
}
|
||||
|
||||
/*! Constructor */
|
||||
Polygon_vertical_decomposition_2(const Traits_2& traits) :
|
||||
m_traits(&traits),
|
||||
|
|
|
|||
|
|
@ -106,12 +106,34 @@ private:
|
|||
Ccw_in_between_2 f_ccw_in_between;
|
||||
|
||||
public:
|
||||
// The pointer to the kernel and the flag that indicate ownership should be
|
||||
// replaced with a smart pointer. Meanwhile, the copy constructor and
|
||||
// copy assignment prevent double delition. Notice that once a copy
|
||||
// constructor (assignment) is present, the move constructor (assignment)
|
||||
// is implicitly not generated anyway.
|
||||
|
||||
/*! Default constructor. */
|
||||
Small_side_angle_bisector_decomposition_2() :
|
||||
m_kernel(new Kernel),
|
||||
m_own_kernel(true)
|
||||
{ init(); }
|
||||
|
||||
/*! Copy constructor. */
|
||||
Small_side_angle_bisector_decomposition_2
|
||||
(const Small_side_angle_bisector_decomposition_2& other) :
|
||||
m_kernel((other.m_own_kernel) ? new Kernel : other.m_kernel),
|
||||
m_own_kernel(other.m_own_kernel)
|
||||
{ init(); }
|
||||
|
||||
/*! Copy assignment. */
|
||||
Small_side_angle_bisector_decomposition_2&
|
||||
operator=(const Small_side_angle_bisector_decomposition_2& other) {
|
||||
m_kernel = (other.m_own_kernel) ? new Kernel : other.m_kernel;
|
||||
m_own_kernel = other.m_own_kernel;
|
||||
init();
|
||||
return *this;
|
||||
}
|
||||
|
||||
/*! Constructor. */
|
||||
Small_side_angle_bisector_decomposition_2(const Kernel& kernel) :
|
||||
m_kernel(&kernel),
|
||||
|
|
|
|||
Loading…
Reference in New Issue