[Rcpp-commits] r2958 - pkg/Rcpp/inst/include/Rcpp

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Apr 5 19:01:58 CEST 2011


Author: romain
Date: 2011-04-05 19:01:51 +0200 (Tue, 05 Apr 2011)
New Revision: 2958

Modified:
   pkg/Rcpp/inst/include/Rcpp/Module.h
Log:
attacking the module bug, second pass, renaming

Modified: pkg/Rcpp/inst/include/Rcpp/Module.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/Module.h	2011-04-05 16:58:25 UTC (rev 2957)
+++ pkg/Rcpp/inst/include/Rcpp/Module.h	2011-04-05 17:01:51 UTC (rev 2958)
@@ -344,15 +344,15 @@
 	    finalizer_pointer(0), 
 	    specials(0), 
 	    constructors(), 
-	    singleton(0)
+	    class_pointer(0)
 	{
 	    Rcpp::Module* module = getCurrentScope() ;
 		if( ! module->has_class(name_) ){
-			singleton = new self ;
-			singleton->name = name_ ;
-			singleton->docstring = std::string( doc == 0 ? "" : doc );
-			singleton->finalizer_pointer = new finalizer_class ;
-			module->AddClass( name_, singleton ) ;
+			class_pointer = new self ;
+			class_pointer->name = name_ ;
+			class_pointer->docstring = std::string( doc == 0 ? "" : doc );
+			class_pointer->finalizer_pointer = new finalizer_class ;
+			module->AddClass( name_, class_pointer ) ;
 		}
 	}
          
@@ -360,7 +360,7 @@
 	
 	
 	self& AddConstructor( constructor_class* ctor, ValidConstructor valid, const char* docstring = 0 ){
-		singleton->constructors.push_back( new signed_constructor_class( ctor, valid, docstring ) );  
+		class_pointer->constructors.push_back( new signed_constructor_class( ctor, valid, docstring ) );  
 		return *this ;
 	}
 	
@@ -470,17 +470,17 @@
 	
 	
 	self& AddMethod( const char* name_, method_class* m, ValidMethod valid = &yes, const char* docstring = 0){
-		typename map_vec_signed_method::iterator it = singleton->vec_methods.find( name_ ) ; 
-	    if( it == singleton->vec_methods.end() ){
-	        it = singleton->vec_methods.insert( vec_signed_method_pair( name_, new vec_signed_method() ) ).first ;
+		typename map_vec_signed_method::iterator it = class_pointer->vec_methods.find( name_ ) ; 
+	    if( it == class_pointer->vec_methods.end() ){
+	        it = class_pointer->vec_methods.insert( vec_signed_method_pair( name_, new vec_signed_method() ) ).first ;
 	    } 
 		(it->second)->push_back( new signed_method_class(m, valid, docstring ) ) ;
-		if( *name_ == '[' ) singleton->specials++ ;
+		if( *name_ == '[' ) class_pointer->specials++ ;
 		return *this ;
 	}
 	
 	self& AddProperty( const char* name_, prop_class* p){
-		singleton->properties.insert( PROP_PAIR( name_, p ) ) ;
+		class_pointer->properties.insert( PROP_PAIR( name_, p ) ) ;
 		return *this ;
 	}
 
@@ -691,8 +691,8 @@
 private:
     
     void SetFinalizer( finalizer_class* f ){
-        if( singleton->finalizer_pointer ) delete singleton->finalizer ;
-        singleton->finalizer_pointer = f ; 
+        if( class_pointer->finalizer_pointer ) delete class_pointer->finalizer ;
+        class_pointer->finalizer_pointer = f ; 
     }
     
 	map_vec_signed_method vec_methods ;
@@ -701,7 +701,7 @@
 	finalizer_class* finalizer_pointer ;
 	int specials ;
 	vec_signed_constructor constructors ;
-    self* singleton ;
+    self* class_pointer ;
 	
 	class_( ) : class_Base(), vec_methods(), properties(), specials(0) {}; 
 	



More information about the Rcpp-commits mailing list