Print

Print


Commit in lcio/src/cpp/include on MAIN
LCRTRelations.h+42-11.5 -> 1.6
added int and float extensions

lcio/src/cpp/include
LCRTRelations.h 1.5 -> 1.6
diff -u -r1.5 -r1.6
--- LCRTRelations.h	30 Nov 2006 11:05:00 -0000	1.5
+++ LCRTRelations.h	30 Nov 2006 14:03:42 -0000	1.6
@@ -81,6 +81,47 @@
   static const bool is_container=false ;
 };
 
+/** Special Extension that allows to write int extensions directly (not through a pointer !). */
+template <class U >
+struct LCIntExtension{  // FIXME: need to check on 64 bit architecture...
+
+  typedef int ptr ;  // base pointer type 
+
+  typedef U tag ;     // this ensures that a new class instance is created for every user extension
+
+  static const int allowed_to_call_ext = 1 ;
+
+  static void clean(void *v) { }
+
+  static ptr init() { 
+    return 0 ; 
+  }
+  static DeleteFPtr deletePtr() { return  &clean ; }  ;
+
+  typedef int& ext_type ;                
+};
+
+
+/** Special Extension that allows to write float extensions directly (not through a pointer !). */
+template <class U >
+
+struct LCFloatExtension{// FIXME: need to check on 64 bit architecture...
+
+  typedef float  ptr ;  // base pointer type 
+  typedef U tag ;     // this ensures that a new class instance is created for every user extension
+  
+  static const int allowed_to_call_ext = 1 ;
+  
+  static void clean(void *v) { }
+
+  static ptr init() { return 0 ; }
+
+  static DeleteFPtr deletePtr() { return  &clean ; }  ;
+
+  typedef float& ext_type ;                 // return value of  ext<>()
+};
+
+
 template <class U, class T , class I=CreationPtrInit<T>, class D=DeletePtr<T> , bool b=1>
 struct LCBaseLinkContainerTraits : public LCBaseTraits<U,T,I,D,b>{
 
@@ -389,7 +430,7 @@
   
   template <class T>
   inline unsigned typeID(){
-    const static unsigned uid  = nextID( T::deletePtr() ) ;
+    static const unsigned uid  = nextID( T::deletePtr() ) ;
 
     return uid ;
   } ;
CVSspam 0.2.8