+ pass Args by const-ref
This commit is contained in:
parent
7eb8d175da
commit
6190cf22f1
1 changed files with 12 additions and 12 deletions
|
@ -76,7 +76,7 @@ struct converter_traits
|
|||
typedef T0 geometry_type;
|
||||
typedef geometry_type conv_type;
|
||||
template <typename Args>
|
||||
static void setup(geometry_type & geom, Args & args)
|
||||
static void setup(geometry_type & geom, Args const& args)
|
||||
{
|
||||
throw "BOOM!";
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ struct converter_traits<T,mapnik::smooth_tag>
|
|||
typedef typename agg::conv_smooth_poly1_curve<geometry_type> conv_type;
|
||||
|
||||
template <typename Args>
|
||||
static void setup(geometry_type & geom, Args & args)
|
||||
static void setup(geometry_type & geom, Args const& args)
|
||||
{
|
||||
geom.smooth_value(boost::fusion::at_c<2>(args).smooth());
|
||||
}
|
||||
|
@ -103,7 +103,7 @@ struct converter_traits<T, mapnik::clip_line_tag>
|
|||
typedef typename agg::conv_clip_polyline<geometry_type> conv_type;
|
||||
|
||||
template <typename Args>
|
||||
static void setup(geometry_type & geom, Args & args)
|
||||
static void setup(geometry_type & geom, Args const& args)
|
||||
{
|
||||
typename boost::mpl::at<Args,boost::mpl::int_<0> >::type const& box = boost::fusion::at_c<0>(args);
|
||||
geom.clip_box(box.minx(),box.miny(),box.maxx(),box.maxy());
|
||||
|
@ -118,7 +118,7 @@ struct converter_traits<T, mapnik::dash_tag>
|
|||
typedef typename agg::conv_dash<geometry_type> conv_type;
|
||||
|
||||
template <typename Args>
|
||||
static void setup(geometry_type & geom, Args & args)
|
||||
static void setup(geometry_type & geom, Args const& args)
|
||||
{
|
||||
typename boost::mpl::at<Args,boost::mpl::int_<2> >::type const& sym = boost::fusion::at_c<2>(args);
|
||||
double scale_factor = boost::fusion::at_c<5>(args);
|
||||
|
@ -142,7 +142,7 @@ struct converter_traits<T, mapnik::stroke_tag>
|
|||
typedef typename agg::conv_stroke<geometry_type> conv_type;
|
||||
|
||||
template <typename Args>
|
||||
static void setup(geometry_type & geom, Args & args)
|
||||
static void setup(geometry_type & geom, Args const& args)
|
||||
{
|
||||
typename boost::mpl::at<Args,boost::mpl::int_<2> >::type const& sym = boost::fusion::at_c<2>(args);
|
||||
stroke const& stroke_ = sym.get_stroke();
|
||||
|
@ -161,7 +161,7 @@ struct converter_traits<T,mapnik::clip_poly_tag>
|
|||
typedef typename agg::conv_clip_polygon<geometry_type> conv_type;
|
||||
|
||||
template <typename Args>
|
||||
static void setup(geometry_type & geom, Args & args)
|
||||
static void setup(geometry_type & geom, Args const& args)
|
||||
{
|
||||
typename boost::mpl::at<Args,boost::mpl::int_<0> >::type const& box = boost::fusion::at_c<0>(args);
|
||||
geom.clip_box(box.minx(),box.miny(),box.maxx(),box.maxy());
|
||||
|
@ -176,7 +176,7 @@ struct converter_traits<T,mapnik::transform_tag>
|
|||
typedef coord_transform2<CoordTransform, geometry_type> conv_type;
|
||||
|
||||
template <typename Args>
|
||||
static void setup(geometry_type & geom, Args & args)
|
||||
static void setup(geometry_type & geom, Args const& args)
|
||||
{
|
||||
typename boost::mpl::at<Args,boost::mpl::int_<3> >::type const& tr = boost::fusion::at_c<3>(args);
|
||||
typename boost::mpl::at<Args,boost::mpl::int_<4> >::type const& prj_trans = boost::fusion::at_c<4>(args);
|
||||
|
@ -215,7 +215,7 @@ struct converter_traits<T,mapnik::offset_transform_tag>
|
|||
typedef offset_converter<geometry_type> conv_type;
|
||||
|
||||
template <typename Args>
|
||||
static void setup(geometry_type & geom, Args & args)
|
||||
static void setup(geometry_type & geom, Args const& args)
|
||||
{
|
||||
typename boost::mpl::at<Args,boost::mpl::int_<2> >::type const& sym = boost::fusion::at_c<2>(args);
|
||||
geom.set_offset(sym.offset());
|
||||
|
@ -226,7 +226,7 @@ template <bool>
|
|||
struct converter_fwd
|
||||
{
|
||||
template <typename Base, typename T0,typename T1,typename T2, typename Iter,typename End>
|
||||
static void forward(Base& base, T0 & geom,T1 & args)
|
||||
static void forward(Base& base, T0 & geom,T1 const& args)
|
||||
{
|
||||
typedef T0 geometry_type;
|
||||
typedef T2 conv_tag;
|
||||
|
@ -241,7 +241,7 @@ template <>
|
|||
struct converter_fwd<true>
|
||||
{
|
||||
template <typename Base, typename T0,typename T1,typename T2, typename Iter,typename End>
|
||||
static void forward(Base& base, T0 & geom,T1 & args)
|
||||
static void forward(Base& base, T0 & geom,T1 const& args)
|
||||
{
|
||||
base.template dispatch<Iter,End>(geom, typename boost::is_same<Iter,End>::type());
|
||||
}
|
||||
|
@ -254,7 +254,7 @@ struct dispatcher
|
|||
typedef A args_type;
|
||||
typedef C conv_types;
|
||||
|
||||
dispatcher(args_type args)
|
||||
dispatcher(args_type const& args)
|
||||
: args_(args)
|
||||
{
|
||||
std::memset(&vec_[0], 0, sizeof(unsigned)*vec_.size());
|
||||
|
@ -296,7 +296,7 @@ struct dispatcher
|
|||
}
|
||||
|
||||
boost::array<unsigned, boost::mpl::size<conv_types>::value> vec_;
|
||||
args_type args_;
|
||||
args_type args_;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue