RCPP_MODULE(play){
class_<Point>("Point")
.constructor<double,double>()
.field( "x", &Point::x)
.field( "y", &Point::y)
;
class_<Shape>( "Shape" )
.constructor<Point>()
.method( "area", &Shape::area )
.method( "contains", &Shape::contains )
;
class_<Circle>( "Circle" )
.derives<Shape>("Shape" )
.constructor<Point,double>()
.field( "r", &Circle::radius )
;
class_<Rectangle>( "Rectangle" )
.derives<Shape>("Shape" )
.constructor<Point,double,double>()
.field( "h", &Rectangle::height )
.field( "w", &Rectangle::width )
;
};