[Rcpp-commits] r2112 - in pkg/Rcpp/inst/include/Rcpp: . module
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Wed Sep 15 12:16:57 CEST 2010
Author: romain
Date: 2010-09-15 12:16:57 +0200 (Wed, 15 Sep 2010)
New Revision: 2112
Modified:
pkg/Rcpp/inst/include/Rcpp/Module.h
pkg/Rcpp/inst/include/Rcpp/module/Module_Field.h
pkg/Rcpp/inst/include/Rcpp/module/Module_Property.h
Log:
CppProperty::set and all implementations must include Rcpp::not_compatible in thir throw declaration, because of the use of as, otherwise terminate is called
Modified: pkg/Rcpp/inst/include/Rcpp/Module.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/Module.h 2010-09-15 10:03:13 UTC (rev 2111)
+++ pkg/Rcpp/inst/include/Rcpp/Module.h 2010-09-15 10:16:57 UTC (rev 2112)
@@ -158,7 +158,7 @@
CppProperty(){} ;
virtual SEXP get(Class* ) throw(std::range_error){ throw std::range_error("cannot retrieve property"); }
- virtual void set(Class*, SEXP) throw(std::range_error){ throw std::range_error("cannot set property"); }
+ virtual void set(Class*, SEXP) throw(std::range_error,Rcpp::not_compatible){ throw std::range_error("cannot set property"); }
virtual bool is_readonly(){ return false; }
virtual std::string get_class(){ return ""; }
} ;
Modified: pkg/Rcpp/inst/include/Rcpp/module/Module_Field.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/module/Module_Field.h 2010-09-15 10:03:13 UTC (rev 2111)
+++ pkg/Rcpp/inst/include/Rcpp/module/Module_Field.h 2010-09-15 10:16:57 UTC (rev 2112)
@@ -31,7 +31,7 @@
CppProperty_Getter_Setter( pointer ptr_ ) : ptr(ptr_), class_name(DEMANGLE(PROP)) {}
SEXP get(Class* object) throw(std::range_error){ return Rcpp::wrap( object->*ptr ) ; }
- void set(Class* object, SEXP value) throw(std::range_error){ object->*ptr = Rcpp::as<PROP>( value ) ; }
+ void set(Class* object, SEXP value) throw(std::range_error,Rcpp::not_compatible){ object->*ptr = Rcpp::as<PROP>( value ) ; }
bool is_readonly(){ return false ; }
std::string get_class(){ return class_name; }
@@ -50,7 +50,7 @@
CppProperty_Getter( pointer ptr_ ) : ptr(ptr_), class_name(DEMANGLE(PROP)) {}
SEXP get(Class* object) throw(std::range_error){ return Rcpp::wrap( object->*ptr ) ; }
- void set(Class* object, SEXP value) throw(std::range_error){ throw std::range_error("read only data member") ; }
+ void set(Class* object, SEXP value) throw(std::range_error,Rcpp::not_compatible){ throw std::range_error("read only data member") ; }
bool is_readonly(){ return true ; }
std::string get_class(){ return class_name; }
Modified: pkg/Rcpp/inst/include/Rcpp/module/Module_Property.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/module/Module_Property.h 2010-09-15 10:03:13 UTC (rev 2111)
+++ pkg/Rcpp/inst/include/Rcpp/module/Module_Property.h 2010-09-15 10:16:57 UTC (rev 2112)
@@ -32,7 +32,7 @@
CppProperty_GetMethod( GetMethod getter_ ) : getter(getter_), class_name(DEMANGLE(PROP)){}
SEXP get(Class* object) throw(std::range_error){ return Rcpp::wrap( (object->*getter)() ) ; }
- void set(Class*, SEXP) throw(std::range_error){ throw std::range_error("property is read only") ; }
+ void set(Class*, SEXP) throw(std::range_error,Rcpp::not_compatible){ throw std::range_error("property is read only") ; }
bool is_readonly(){ return true ; }
private:
@@ -51,7 +51,7 @@
CppProperty_GetConstMethod( GetMethod getter_ ) : getter(getter_), class_name(DEMANGLE(PROP)){}
SEXP get(Class* object) throw(std::range_error){ return Rcpp::wrap( (object->*getter)() ) ; }
- void set(Class*, SEXP) throw(std::range_error){ throw std::range_error("property is read only") ; }
+ void set(Class*, SEXP) throw(std::range_error,Rcpp::not_compatible){ throw std::range_error("property is read only") ; }
bool is_readonly(){ return true ; }
private:
@@ -71,7 +71,7 @@
CppProperty_GetPointerMethod( GetMethod getter_ ) : getter(getter_), class_name(DEMANGLE(PROP)){}
SEXP get(Class* object) throw(std::range_error){ return Rcpp::wrap( getter(object) ) ; }
- void set(Class*, SEXP) throw(std::range_error){ throw std::range_error("property is read only") ; }
+ void set(Class*, SEXP) throw(std::range_error,Rcpp::not_compatible){ throw std::range_error("property is read only") ; }
bool is_readonly(){ return true ; }
private:
@@ -93,7 +93,7 @@
SEXP get(Class* object) throw(std::range_error){
return Rcpp::wrap( (object->*getter)() ) ;
}
- void set(Class* object, SEXP value) throw(std::range_error){
+ void set(Class* object, SEXP value) throw(std::range_error,Rcpp::not_compatible){
(object->*setter)(
Rcpp::as< typename Rcpp::traits::remove_const_and_reference< PROP >::type >( value )
) ;
@@ -117,7 +117,7 @@
SEXP get(Class* object) throw(std::range_error){
return Rcpp::wrap( (object->*getter)() ) ;
}
- void set(Class* object, SEXP value) throw(std::range_error){
+ void set(Class* object, SEXP value) throw(std::range_error,Rcpp::not_compatible){
(object->*setter)(
Rcpp::as< typename Rcpp::traits::remove_const_and_reference< PROP >::type >( value )
) ;
@@ -147,7 +147,7 @@
SEXP get(Class* object) throw(std::range_error){
return Rcpp::wrap( (object->*getter)() ) ;
}
- void set(Class* object, SEXP value) throw(std::range_error){
+ void set(Class* object, SEXP value) throw(std::range_error,Rcpp::not_compatible){
setter( object,
Rcpp::as< typename Rcpp::traits::remove_const_and_reference< PROP >::type >( value )
) ;
@@ -172,7 +172,7 @@
SEXP get(Class* object) throw(std::range_error){
return Rcpp::wrap( (object->*getter)() ) ;
}
- void set(Class* object, SEXP value) throw(std::range_error){
+ void set(Class* object, SEXP value) throw(std::range_error,Rcpp::not_compatible){
setter( object,
Rcpp::as< typename Rcpp::traits::remove_const_and_reference< PROP >::type >( value )
) ;
@@ -199,7 +199,7 @@
SEXP get(Class* object) throw(std::range_error){
return Rcpp::wrap( getter(object) ) ;
}
- void set(Class* object, SEXP value) throw(std::range_error){
+ void set(Class* object, SEXP value) throw(std::range_error,Rcpp::not_compatible){
(object->*setter)(
Rcpp::as< typename Rcpp::traits::remove_const_and_reference< PROP >::type >( value )
) ;
@@ -227,7 +227,7 @@
SEXP get(Class* object) throw(std::range_error){
return Rcpp::wrap( getter(object) ) ;
}
- void set(Class* object, SEXP value) throw(std::range_error){
+ void set(Class* object, SEXP value) throw(std::range_error,Rcpp::not_compatible){
setter( object,
Rcpp::as< typename Rcpp::traits::remove_const_and_reference< PROP >::type >( value )
) ;
More information about the Rcpp-commits
mailing list