Print

Print


Commit in lcio/src/cpp/include/IMPL on rio_v00-00
LCRefVec.h+15-21.1.2.2 -> 1.1.2.3
fixed initialization of _havePtr (t!=0)

lcio/src/cpp/include/IMPL
LCRefVec.h 1.1.2.2 -> 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- LCRefVec.h	26 Nov 2009 13:38:27 -0000	1.1.2.2
+++ LCRefVec.h	27 Nov 2009 16:02:33 -0000	1.1.2.3
@@ -5,6 +5,7 @@
 #include "LCIOTypes.h"
 #include "LCEventImpl.h"
 #include <iostream>
+//#include <iomanip>
 #include <vector>
 
 namespace IMPL {
@@ -34,7 +35,7 @@
 
     LCRef(T t) : _ptr(t), 
 		 _ref(0),
-		 _havePtr( true ) {
+		 _havePtr( t != 0 ) {
       // -- need to get current event on loading.... 
       _evt = LCEventImpl::getCurrentEvent() ;
     }
@@ -42,7 +43,7 @@
     const LCRef<T>& operator=(const T& t) {
       _ptr = t ;
       _ref = 0 ;
-      _havePtr = true  ;
+      _havePtr =  ( t != 0 )  ;
       return *this ;
     }
 
@@ -58,6 +59,12 @@
     // conversion to ptr
     operator T&() { 
       
+//       std::cout << " operator T&() - this " << this 
+//  		<< " _havePtr "  << _havePtr 
+//  		<< " _ptr "  << _ptr 
+//  		<< " _ref "  << std::hex << _ref << std::dec
+//  		<< std::endl ;
+
       if( ! _havePtr ) {
 	_havePtr = (_ptr!=0 && _ref==0 ) ;
 	if( ! _havePtr ) {
@@ -65,6 +72,12 @@
 	  _havePtr = true ; 
 	}
       }
+//       std::cout << " operator T&() - this " << this 
+//  		<< " _havePtr "  << _havePtr 
+//  		<< " _ptr "  << _ptr 
+//  		<< " _ref "  << std::hex << _ref << std::dec
+//  		<< std::endl ;
+
       return _ptr ;
     }
 
CVSspam 0.2.8