From c17a1b2f6d369743440a06452ca0589bf8368c0a Mon Sep 17 00:00:00 2001 From: Marc Glisse Date: Sat, 14 May 2011 13:38:01 +0000 Subject: [PATCH] forgot to svn add --- .../CGAL/Kernel_d/Wrapper/Vector_rc_d.h | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 NewKernel_d/include/CGAL/Kernel_d/Wrapper/Vector_rc_d.h diff --git a/NewKernel_d/include/CGAL/Kernel_d/Wrapper/Vector_rc_d.h b/NewKernel_d/include/CGAL/Kernel_d/Wrapper/Vector_rc_d.h new file mode 100644 index 00000000000..d8aa326ef08 --- /dev/null +++ b/NewKernel_d/include/CGAL/Kernel_d/Wrapper/Vector_rc_d.h @@ -0,0 +1,98 @@ +#ifndef CGAL_WRAPPER_VECTOR_RC_D_H +#define CGAL_WRAPPER_VECTOR_RC_D_H + +#include +#include +#include +#include +#include +#include +#include +#ifndef CGAL_CXX0X +#include +#endif +#include + +// no need for a fancy interface here, people can use the Vector_d wrapper on +// top. + +namespace CGAL { + +template +class Vector_rc_d +{ + typedef typename R_::Kernel_base Kbase; + typedef typename Kbase::template Construct::type CPBase; + typedef typename Kbase::template Compute::type CCBase; + + typedef Vector_rc_d Self; + BOOST_STATIC_ASSERT((boost::is_same::value)); + +public: + typedef R_ R; + + typedef Tag_true Is_wrapper; + typedef typename R_::Default_ambient_dimension Ambient_dimension; + typedef Dimension_tag<0> Feature_dimension; + + typedef typename R_::Vector_cartesian_const_iterator Cartesian_const_iterator; + typedef typename Kbase::Vector Rep; + typedef Handle_for Data; + +private: + Data data; +public: + + const Rep& rep() const + { + return CGAL::get(data); + } + +#ifdef CGAL_CXX0X + template::type...>,std::tuple >::value>::type> explicit Vector_rc_d(U&&...u) + : Rep(Eval_functor(),CPBase(),std::forward(u)...){} + + template explicit Vector_rc_d(Eval_functor&&,F&&f,U&&...u) + : Rep(Eval_functor(),std::forward(f),std::forward(u)...){} + + // try not to use these + Vector_rc_d(Rep const& v) : data(v) {} + Vector_rc_d(Rep& v) : data(static_cast(v)) {} + Vector_rc_d(Rep&& v) : data(std::move(v)) {} + + // this one should be implicit + Vector_rc_d(Null_vector const& v) + : data(Eval_functor(),CPBase(),v) {} + Vector_rc_d(Null_vector& v) + : data(Eval_functor(),CPBase(),v) {} + Vector_rc_d(Null_vector&& v) + : data(Eval_functor(),CPBase(),std::move(v)) {} + +#else + + Vector_rc_d() : data(Eval_functor(),CPBase()) {} + + Vector_rc_d(Rep const& v) : data(v) {} // try not to use it + +#define CODE(Z,N,_) template \ + explicit Vector_rc_d(BOOST_PP_ENUM_BINARY_PARAMS(N,T,const&t)) \ + : data(Eval_functor(),CPBase(),BOOST_PP_ENUM_PARAMS(N,t)) {} \ + \ + template \ + Vector_rc_d(Eval_functor,F const& f,BOOST_PP_ENUM_BINARY_PARAMS(N,T,const&t)) \ + : data(Eval_functor(),f,BOOST_PP_ENUM_PARAMS(N,t)) {} + + BOOST_PP_REPEAT_FROM_TO(1,11,CODE,_) +#undef CODE + + // this one should be implicit + Vector_rc_d(Null_vector const& v) + : data(Eval_functor(),CPBase(),v) {} + +#endif + +}; + +} //namespace CGAL + +#endif // CGAL_WRAPPER_VECTOR_RC_D_H