Index: trunk/SophyaPI/PIext/Makefile
===================================================================
--- trunk/SophyaPI/PIext/Makefile	(revision 1223)
+++ trunk/SophyaPI/PIext/Makefile	(revision 1224)
@@ -4,5 +4,5 @@
  
 all: $(LIB)libPIext.a
-$(LIB)libPIext.a : $(OBJ)basexecut.o $(OBJ)nobjmgr.o $(OBJ)nomgadapter.o $(OBJ)nomgfdadapter.o $(OBJ)nomhistadapter.o $(OBJ)nomimagadapter.o $(OBJ)nomskymapadapter.o $(OBJ)nomspecrespadapter.o $(OBJ)nomtmatvecadapter.o $(OBJ)pawexecut.o $(OBJ)piacmd.o $(OBJ)piafitting.o $(OBJ)pigfd1.o $(OBJ)pigfd2.o $(OBJ)pihisto.o $(OBJ)pihisto2d.o $(OBJ)piinit.o $(OBJ)pintup3d.o $(OBJ)pintuple.o $(OBJ)pipodrw.o $(OBJ)pisiadw.o $(OBJ)pistdimgapp.o $(OBJ)pitvmaad.o $(OBJ)servnobjm.o
+$(LIB)libPIext.a : $(OBJ)basexecut.o $(OBJ)cxxexecutor.o $(OBJ)nobjmgr.o $(OBJ)nomgadapter.o $(OBJ)nomgfdadapter.o $(OBJ)nomhistadapter.o $(OBJ)nomimagadapter.o $(OBJ)nomskymapadapter.o $(OBJ)nomspecrespadapter.o $(OBJ)nomtmatvecadapter.o $(OBJ)pawexecut.o $(OBJ)piacmd.o $(OBJ)piafitting.o $(OBJ)pigfd1.o $(OBJ)pigfd2.o $(OBJ)pihisto.o $(OBJ)pihisto2d.o $(OBJ)piinit.o $(OBJ)pintup3d.o $(OBJ)pintuple.o $(OBJ)pipodrw.o $(OBJ)pisiadw.o $(OBJ)pistdimgapp.o $(OBJ)pitvmaad.o $(OBJ)servnobjm.o
 	$(AR) $(ARFLAGS)  $@ $? 
 ifeq ($(CXX),cxx)
@@ -11,5 +11,5 @@
  
 clean:
-	rm -f $(OBJ)basexecut.o $(OBJ)nobjmgr.o $(OBJ)nomgadapter.o $(OBJ)nomgfdadapter.o $(OBJ)nomhistadapter.o $(OBJ)nomimagadapter.o $(OBJ)nomskymapadapter.o $(OBJ)nomspecrespadapter.o $(OBJ)nomtmatvecadapter.o $(OBJ)pawexecut.o $(OBJ)piacmd.o $(OBJ)piafitting.o $(OBJ)pigfd1.o $(OBJ)pigfd2.o $(OBJ)pihisto.o $(OBJ)pihisto2d.o $(OBJ)piinit.o $(OBJ)pintup3d.o $(OBJ)pintuple.o $(OBJ)pipodrw.o $(OBJ)pisiadw.o $(OBJ)pistdimgapp.o $(OBJ)pitvmaad.o $(OBJ)servnobjm.o
+	rm -f $(OBJ)basexecut.o $(OBJ)cxxexecutor.o $(OBJ)nobjmgr.o $(OBJ)nomgadapter.o $(OBJ)nomgfdadapter.o $(OBJ)nomhistadapter.o $(OBJ)nomimagadapter.o $(OBJ)nomskymapadapter.o $(OBJ)nomspecrespadapter.o $(OBJ)nomtmatvecadapter.o $(OBJ)pawexecut.o $(OBJ)piacmd.o $(OBJ)piafitting.o $(OBJ)pigfd1.o $(OBJ)pigfd2.o $(OBJ)pihisto.o $(OBJ)pihisto2d.o $(OBJ)piinit.o $(OBJ)pintup3d.o $(OBJ)pintuple.o $(OBJ)pipodrw.o $(OBJ)pisiadw.o $(OBJ)pistdimgapp.o $(OBJ)pitvmaad.o $(OBJ)servnobjm.o
 ifeq ($(CXX),cxx)
 	cd $(REPM); rm -f *.o
@@ -93,4 +93,77 @@
  $(INC)generaldata.h \
  $(INC)poly.h
+$(OBJ)cxxexecutor.o: cxxexecutor.cc cxxexecutor.h \
+ $(INC)machdefs.h piacmd.h dlftypes.h \
+ $(INC)pdlmgr.h nobjmgr.h \
+ $(INC)anydataobj.h \
+ $(INC)ppersist.h \
+ $(INC)pexceptions.h \
+ $(INC)gnumd5.h \
+ $(INC)dvlist.h \
+ $(INC)objfio.h \
+ $(INC)mutyv.h nomgadapter.h \
+ $(INC)pidrawer.h \
+ $(INC)pibwdggen.h \
+ $(INC)pisysdep.h \
+ $(INC)piwdgx.h \
+ $(INC)piwdggen.h \
+ $(INC)pimsghandler.h \
+ $(INC)picolist.h \
+ $(INC)picmap.h \
+ $(INC)picmapx.h \
+ $(INC)picmapgen.h \
+ $(INC)pigraphx.h \
+ $(INC)pigraphgen.h \
+ $(INC)pifontx.h \
+ $(INC)pifontgen.h \
+ $(INC)pigraphuc.h \
+ $(INC)pievthandler.h \
+ $(INC)psfile.h \
+ $(INC)parradapter.h \
+ $(INC)lut.h \
+ $(INC)ntupintf.h \
+ $(INC)generalfit.h \
+ $(INC)tvector.h \
+ $(INC)tmatrix.h \
+ $(INC)tarray.h \
+ $(INC)basarr.h \
+ $(INC)ndatablock.h \
+ $(INC)utilarr.h \
+ $(INC)generaldata.h \
+ $(INC)poly.h \
+ $(INC)peida.h \
+ $(INC)utils.h \
+ $(INC)perrors.h \
+ $(INC)fmath.h pistdimgapp.h \
+ $(INC)piapplx.h \
+ $(INC)piapplgen.h \
+ $(INC)picontainerx.h \
+ $(INC)picontainergen.h \
+ $(INC)pimenubarx.h \
+ $(INC)pimenubargen.h \
+ $(INC)pimenux.h \
+ $(INC)pimenugen.h \
+ $(INC)picons.h \
+ $(INC)pistdwdgx.h \
+ $(INC)pistdwdggen.h \
+ $(INC)pibwdgx.h \
+ $(INC)pigraphps.h \
+ $(INC)piwindowx.h \
+ $(INC)piwindowgen.h \
+ $(INC)pioptmenux.h \
+ $(INC)pioptmenugen.h \
+ $(INC)pifilechox.h \
+ $(INC)pifilechogen.h \
+ $(INC)piimage.h \
+ $(INC)pipixmapx.h \
+ $(INC)pipixmapgen.h \
+ $(INC)picmapview.h \
+ $(INC)pi3ddrw.h \
+ $(INC)pigraph3d.h pisiadw.h \
+ $(INC)pilistx.h \
+ $(INC)pilistgen.h \
+ $(INC)pistzwin.h \
+ $(INC)piperiodx.h \
+ $(INC)periodic.h
 $(OBJ)nobjmgr.o: nobjmgr.cc $(INC)strutil.h \
  $(INC)datatypes.h \
@@ -123,5 +196,18 @@
  $(INC)parradapter.h \
  $(INC)lut.h \
- $(INC)ntupintf.h pistdimgapp.h \
+ $(INC)ntupintf.h \
+ $(INC)generalfit.h \
+ $(INC)tvector.h \
+ $(INC)tmatrix.h \
+ $(INC)tarray.h \
+ $(INC)basarr.h \
+ $(INC)ndatablock.h \
+ $(INC)utilarr.h \
+ $(INC)generaldata.h \
+ $(INC)poly.h \
+ $(INC)peida.h \
+ $(INC)utils.h \
+ $(INC)perrors.h \
+ $(INC)fmath.h pistdimgapp.h \
  $(INC)piapplx.h \
  $(INC)piapplgen.h \
@@ -156,17 +242,6 @@
  $(INC)pisurfdr.h pipodrw.h \
  $(INC)histos2.h \
- $(INC)peida.h \
- $(INC)utils.h \
- $(INC)perrors.h \
- $(INC)fmath.h \
- $(INC)histos.h \
- $(INC)tvector.h \
- $(INC)tmatrix.h \
- $(INC)tarray.h \
- $(INC)basarr.h \
- $(INC)ndatablock.h \
- $(INC)utilarr.h pintuple.h pintup3d.h \
- pigfd1.h $(INC)generaldata.h \
- $(INC)poly.h pigfd2.h
+ $(INC)histos.h pintuple.h pintup3d.h \
+ pigfd1.h pigfd2.h
 $(OBJ)nomgadapter.o: nomgadapter.cc \
  $(INC)machdefs.h nomgadapter.h \
@@ -194,5 +269,21 @@
  $(INC)parradapter.h \
  $(INC)lut.h \
- $(INC)ntupintf.h
+ $(INC)ntupintf.h \
+ $(INC)generalfit.h \
+ $(INC)tvector.h \
+ $(INC)tmatrix.h \
+ $(INC)tarray.h \
+ $(INC)basarr.h \
+ $(INC)mutyv.h \
+ $(INC)dvlist.h \
+ $(INC)objfio.h \
+ $(INC)ndatablock.h \
+ $(INC)utilarr.h \
+ $(INC)generaldata.h \
+ $(INC)poly.h \
+ $(INC)peida.h \
+ $(INC)utils.h \
+ $(INC)perrors.h \
+ $(INC)fmath.h
 $(OBJ)nomgfdadapter.o: nomgfdadapter.cc \
  $(INC)machdefs.h nomgfdadapter.h \
@@ -221,21 +312,26 @@
  $(INC)lut.h \
  $(INC)ntupintf.h \
- $(INC)generaldata.h \
- $(INC)objfio.h \
+ $(INC)generalfit.h \
+ $(INC)tvector.h \
+ $(INC)tmatrix.h \
+ $(INC)tarray.h \
+ $(INC)basarr.h \
+ $(INC)mutyv.h \
+ $(INC)dvlist.h \
+ $(INC)objfio.h \
+ $(INC)ndatablock.h \
+ $(INC)utilarr.h \
+ $(INC)generaldata.h \
  $(INC)poly.h \
  $(INC)peida.h \
  $(INC)utils.h \
  $(INC)perrors.h \
- $(INC)fmath.h \
- $(INC)tvector.h \
- $(INC)tmatrix.h \
- $(INC)tarray.h \
- $(INC)basarr.h \
- $(INC)mutyv.h \
- $(INC)dvlist.h \
- $(INC)ndatablock.h \
- $(INC)utilarr.h pipodrw.h \
+ $(INC)fmath.h pipodrw.h \
  $(INC)histos2.h \
- $(INC)histos.h
+ $(INC)histos.h \
+ $(INC)objfitter.h \
+ $(INC)cimage.h \
+ $(INC)fioarr.h \
+ $(INC)hisprof.h
 $(OBJ)nomhistadapter.o: nomhistadapter.cc \
  $(INC)machdefs.h nomhistadapter.h \
@@ -264,18 +360,21 @@
  $(INC)lut.h \
  $(INC)ntupintf.h \
+ $(INC)generalfit.h \
+ $(INC)tvector.h \
+ $(INC)tmatrix.h \
+ $(INC)tarray.h \
+ $(INC)basarr.h \
+ $(INC)mutyv.h \
+ $(INC)dvlist.h \
+ $(INC)objfio.h \
+ $(INC)ndatablock.h \
+ $(INC)utilarr.h \
+ $(INC)generaldata.h \
+ $(INC)poly.h \
+ $(INC)peida.h \
+ $(INC)utils.h \
+ $(INC)perrors.h \
+ $(INC)fmath.h \
  $(INC)histos.h \
- $(INC)objfio.h \
- $(INC)peida.h \
- $(INC)utils.h \
- $(INC)perrors.h \
- $(INC)fmath.h \
- $(INC)tvector.h \
- $(INC)tmatrix.h \
- $(INC)tarray.h \
- $(INC)basarr.h \
- $(INC)mutyv.h \
- $(INC)dvlist.h \
- $(INC)ndatablock.h \
- $(INC)utilarr.h \
  $(INC)histos2.h \
  $(INC)hisprof.h \
@@ -297,5 +396,8 @@
  $(INC)picontainerx.h \
  $(INC)picontainergen.h pipodrw.h servnobjm.h \
- $(INC)pdlmgr.h dlftypes.h
+ $(INC)pdlmgr.h dlftypes.h \
+ $(INC)objfitter.h \
+ $(INC)cimage.h \
+ $(INC)fioarr.h
 $(OBJ)nomimagadapter.o: nomimagadapter.cc \
  $(INC)machdefs.h nomimagadapter.h \
@@ -324,15 +426,26 @@
  $(INC)lut.h \
  $(INC)ntupintf.h \
+ $(INC)generalfit.h \
+ $(INC)tvector.h \
+ $(INC)tmatrix.h \
+ $(INC)tarray.h \
+ $(INC)basarr.h \
+ $(INC)mutyv.h \
+ $(INC)dvlist.h \
+ $(INC)objfio.h \
+ $(INC)ndatablock.h \
+ $(INC)utilarr.h \
+ $(INC)generaldata.h \
+ $(INC)poly.h \
+ $(INC)peida.h \
+ $(INC)utils.h \
+ $(INC)perrors.h \
+ $(INC)fmath.h \
  $(INC)cimage.h \
- $(INC)tmatrix.h \
- $(INC)tarray.h \
- $(INC)basarr.h \
- $(INC)mutyv.h \
- $(INC)dvlist.h \
- $(INC)objfio.h \
- $(INC)ndatablock.h \
- $(INC)utilarr.h \
- $(INC)fioarr.h \
- $(INC)tvector.h pimgadapter.h
+ $(INC)fioarr.h pimgadapter.h \
+ $(INC)objfitter.h \
+ $(INC)histos.h \
+ $(INC)histos2.h \
+ $(INC)hisprof.h
 $(OBJ)nomskymapadapter.o: nomskymapadapter.cc \
  $(INC)machdefs.h nomskymapadapter.h \
@@ -361,12 +474,20 @@
  $(INC)lut.h \
  $(INC)ntupintf.h \
- $(INC)tmatrix.h \
- $(INC)tarray.h \
- $(INC)basarr.h \
- $(INC)mutyv.h \
- $(INC)dvlist.h \
- $(INC)objfio.h \
- $(INC)ndatablock.h \
- $(INC)utilarr.h \
+ $(INC)generalfit.h \
+ $(INC)tvector.h \
+ $(INC)tmatrix.h \
+ $(INC)tarray.h \
+ $(INC)basarr.h \
+ $(INC)mutyv.h \
+ $(INC)dvlist.h \
+ $(INC)objfio.h \
+ $(INC)ndatablock.h \
+ $(INC)utilarr.h \
+ $(INC)generaldata.h \
+ $(INC)poly.h \
+ $(INC)peida.h \
+ $(INC)utils.h \
+ $(INC)perrors.h \
+ $(INC)fmath.h \
  $(INC)pixelmap.h \
  $(INC)spherepos.h \
@@ -379,6 +500,6 @@
  $(INC)sphericalmap.h \
  $(INC)smathconst.h \
- $(INC)tvector.h \
  $(INC)spherehealpix.h \
+ $(INC)HEALPixUtils.h \
  $(INC)localmap.h \
  $(INC)fiospherethetaphi.h \
@@ -412,15 +533,22 @@
  $(INC)lut.h \
  $(INC)ntupintf.h \
+ $(INC)generalfit.h \
+ $(INC)tvector.h \
+ $(INC)tmatrix.h \
+ $(INC)tarray.h \
+ $(INC)basarr.h \
+ $(INC)mutyv.h \
+ $(INC)dvlist.h \
+ $(INC)objfio.h \
+ $(INC)ndatablock.h \
+ $(INC)utilarr.h \
+ $(INC)generaldata.h \
+ $(INC)poly.h \
+ $(INC)peida.h \
+ $(INC)utils.h \
+ $(INC)perrors.h \
+ $(INC)fmath.h \
  $(INC)specresp.h \
  $(INC)specrespvector.h \
- $(INC)tvector.h \
- $(INC)tmatrix.h \
- $(INC)tarray.h \
- $(INC)basarr.h \
- $(INC)mutyv.h \
- $(INC)dvlist.h \
- $(INC)objfio.h \
- $(INC)ndatablock.h \
- $(INC)utilarr.h \
  $(INC)gaussfilt.h
 $(OBJ)nomtmatvecadapter.o: nomtmatvecadapter.cc \
@@ -438,5 +566,19 @@
  $(INC)gnumd5.h \
  $(INC)ndatablock.h \
- $(INC)utilarr.h nomtmatvecadapter.h \
+ $(INC)utilarr.h \
+ $(INC)objfitter.h \
+ $(INC)cimage.h \
+ $(INC)fioarr.h \
+ $(INC)histos.h \
+ $(INC)peida.h \
+ $(INC)utils.h \
+ $(INC)perrors.h \
+ $(INC)fmath.h \
+ $(INC)histos2.h \
+ $(INC)hisprof.h \
+ $(INC)generalfit.h \
+ $(INC)generaldata.h \
+ $(INC)ntupintf.h \
+ $(INC)poly.h nomtmatvecadapter.h \
  nomgadapter.h $(INC)pidrawer.h \
  $(INC)pibwdggen.h \
@@ -458,5 +600,4 @@
  $(INC)parradapter.h \
  $(INC)lut.h \
- $(INC)ntupintf.h \
  $(INC)piscdrawwdg.h \
  $(INC)pibwdgx.h \
@@ -467,6 +608,5 @@
  $(INC)piwindowgen.h \
  $(INC)picontainerx.h \
- $(INC)picontainergen.h pitvmaad.h \
- $(INC)fioarr.h
+ $(INC)picontainergen.h pitvmaad.h
 $(OBJ)pawexecut.o: pawexecut.cc $(INC)strutil.h \
  $(INC)histos.h \
@@ -601,11 +741,19 @@
  $(INC)pistzwin.h \
  $(INC)piperiodx.h \
- $(INC)periodic.h piafitting.h \
- $(INC)tvector.h \
- $(INC)tmatrix.h \
- $(INC)tarray.h \
- $(INC)basarr.h \
- $(INC)ndatablock.h \
- $(INC)utilarr.h pawexecut.h
+ $(INC)periodic.h piafitting.h nomgadapter.h \
+ $(INC)ntupintf.h \
+ $(INC)generalfit.h \
+ $(INC)tvector.h \
+ $(INC)tmatrix.h \
+ $(INC)tarray.h \
+ $(INC)basarr.h \
+ $(INC)ndatablock.h \
+ $(INC)utilarr.h \
+ $(INC)generaldata.h \
+ $(INC)poly.h \
+ $(INC)peida.h \
+ $(INC)utils.h \
+ $(INC)perrors.h \
+ $(INC)fmath.h pawexecut.h cxxexecutor.h
 $(OBJ)piafitting.o: piafitting.cc $(INC)strutil.h \
  $(INC)nbtri.h \
@@ -640,15 +788,29 @@
  $(INC)histos2.h \
  $(INC)hisprof.h \
- $(INC)objfitter.h piafitting.h \
+ $(INC)objfitter.h piafitting.h nomgadapter.h \
+ $(INC)pidrawer.h \
+ $(INC)pibwdggen.h \
+ $(INC)pisysdep.h \
+ $(INC)piwdgx.h \
+ $(INC)piwdggen.h \
+ $(INC)pimsghandler.h \
+ $(INC)picolist.h \
+ $(INC)picmap.h \
+ $(INC)picmapx.h \
+ $(INC)picmapgen.h \
+ $(INC)pigraphx.h \
+ $(INC)pigraphgen.h \
+ $(INC)pifontx.h \
+ $(INC)pifontgen.h \
+ $(INC)pigraphuc.h \
+ $(INC)pievthandler.h \
+ $(INC)psfile.h \
+ $(INC)parradapter.h \
+ $(INC)lut.h \
  $(INC)pdlmgr.h dlftypes.h piacmd.h nobjmgr.h \
- pistdimgapp.h $(INC)pisysdep.h \
- $(INC)piapplx.h \
+ pistdimgapp.h $(INC)piapplx.h \
  $(INC)piapplgen.h \
- $(INC)pimsghandler.h \
  $(INC)picontainerx.h \
  $(INC)picontainergen.h \
- $(INC)piwdgx.h \
- $(INC)piwdggen.h \
- $(INC)picolist.h \
  $(INC)pimenubarx.h \
  $(INC)pimenubargen.h \
@@ -659,15 +821,4 @@
  $(INC)pistdwdggen.h \
  $(INC)pibwdgx.h \
- $(INC)pibwdggen.h \
- $(INC)picmap.h \
- $(INC)picmapx.h \
- $(INC)picmapgen.h \
- $(INC)pigraphx.h \
- $(INC)pigraphgen.h \
- $(INC)pifontx.h \
- $(INC)pifontgen.h \
- $(INC)pigraphuc.h \
- $(INC)pievthandler.h \
- $(INC)psfile.h \
  $(INC)pigraphps.h \
  $(INC)piwindowx.h \
@@ -678,7 +829,4 @@
  $(INC)pifilechogen.h \
  $(INC)piimage.h \
- $(INC)parradapter.h \
- $(INC)lut.h \
- $(INC)pidrawer.h \
  $(INC)pipixmapx.h \
  $(INC)pipixmapgen.h \
@@ -690,5 +838,7 @@
  $(INC)pistzwin.h \
  $(INC)piperiodx.h \
- $(INC)periodic.h
+ $(INC)periodic.h nomhistadapter.h \
+ $(INC)xntuple.h nomgfdadapter.h \
+ nomimagadapter.h nomtmatvecadapter.h
 $(OBJ)pigfd1.o: pigfd1.cc pigfd1.h \
  $(INC)generaldata.h \
@@ -932,22 +1082,23 @@
  nomhistadapter.h nomgadapter.h \
  $(INC)ntupintf.h \
+ $(INC)generalfit.h \
+ $(INC)tvector.h \
+ $(INC)tmatrix.h \
+ $(INC)tarray.h \
+ $(INC)basarr.h \
+ $(INC)ndatablock.h \
+ $(INC)utilarr.h \
+ $(INC)generaldata.h \
+ $(INC)poly.h \
+ $(INC)peida.h \
+ $(INC)utils.h \
+ $(INC)perrors.h \
+ $(INC)fmath.h \
  $(INC)histos.h \
- $(INC)peida.h \
- $(INC)utils.h \
- $(INC)perrors.h \
- $(INC)fmath.h \
- $(INC)tvector.h \
- $(INC)tmatrix.h \
- $(INC)tarray.h \
- $(INC)basarr.h \
- $(INC)ndatablock.h \
- $(INC)utilarr.h \
  $(INC)histos2.h \
  $(INC)hisprof.h \
  $(INC)ntuple.h \
  $(INC)xntuple.h nomgfdadapter.h \
- $(INC)generaldata.h \
- $(INC)poly.h nomimagadapter.h \
- $(INC)cimage.h \
+ nomimagadapter.h $(INC)cimage.h \
  $(INC)fioarr.h nomtmatvecadapter.h \
  nomskymapadapter.h $(INC)pixelmap.h \
@@ -961,4 +1112,5 @@
  $(INC)smathconst.h \
  $(INC)spherehealpix.h \
+ $(INC)HEALPixUtils.h \
  $(INC)localmap.h \
  $(INC)specrespvector.h \
@@ -1247,5 +1399,18 @@
  $(INC)parradapter.h \
  $(INC)lut.h \
- $(INC)ntupintf.h pistdimgapp.h \
+ $(INC)ntupintf.h \
+ $(INC)generalfit.h \
+ $(INC)tvector.h \
+ $(INC)tmatrix.h \
+ $(INC)tarray.h \
+ $(INC)basarr.h \
+ $(INC)ndatablock.h \
+ $(INC)utilarr.h \
+ $(INC)generaldata.h \
+ $(INC)poly.h \
+ $(INC)peida.h \
+ $(INC)utils.h \
+ $(INC)perrors.h \
+ $(INC)fmath.h pistdimgapp.h \
  $(INC)piapplx.h \
  $(INC)piapplgen.h \
@@ -1279,17 +1444,4 @@
  $(INC)periodic.h \
  $(INC)fct1dfit.h \
- $(INC)generalfit.h \
- $(INC)tvector.h \
- $(INC)tmatrix.h \
- $(INC)tarray.h \
- $(INC)basarr.h \
- $(INC)ndatablock.h \
- $(INC)utilarr.h \
- $(INC)generaldata.h \
- $(INC)poly.h \
- $(INC)peida.h \
- $(INC)utils.h \
- $(INC)perrors.h \
- $(INC)fmath.h \
  $(INC)fct2dfit.h pitvmaad.h \
  $(INC)ntuple.h \
Index: trunk/SophyaPI/PIext/cxxexecutor.cc
===================================================================
--- trunk/SophyaPI/PIext/cxxexecutor.cc	(revision 1224)
+++ trunk/SophyaPI/PIext/cxxexecutor.cc	(revision 1224)
@@ -0,0 +1,548 @@
+#include "cxxexecutor.h"
+
+#include <typeinfo>
+
+#include "dvlist.h"
+
+#include "nomgadapter.h"
+#include "pistdimgapp.h"
+
+
+
+/* --Methode-- */
+CxxExecutor::CxxExecutor(PIACmd *mpiac, PIStdImgApp* /* app */)
+  : mCompOpt(""), mLinkOpt(""), mMyLibs("")
+{
+mUserCode.resize(0);
+mIncList.resize(0);
+mCallArgs.resize(0);
+
+NamedObjMgr omg;
+
+// On enregistre les nouvelles commandes 
+string hgrp = "CxxExecutorCmd";
+string usage,kw;
+
+kw = "c++exec";
+usage = "c++exec: Execute the following c++ user code\n";
+usage+= "Usage: c++exec c++ user code";
+mpiac->RegisterCommand(kw, usage, this, hgrp);
+
+kw = "c++execfrf";
+usage = "c++execfrf: Execute c++ user code contained in a file\n";
+usage+= "Usage: c++execfrf fileuser.cc";
+mpiac->RegisterCommand(kw, usage, this, hgrp);
+
+kw = "c++args";
+usage = "c++args: Define user function arguments\n";
+usage+= "Usage: c++args arg1 arg2 arg3 ...";
+mpiac->RegisterCommand(kw, usage, this, hgrp);
+
+kw = "c++create";
+usage = "c++create: create a file to be used by spiapp\n";
+usage+= "Usage: c++create file.cc func c++ user code...\n";
+mpiac->RegisterCommand(kw, usage, this, hgrp);
+
+kw = "c++createfrf";
+usage = "c++createfrf: create a file \"file.cc\"to be used by spiapp\n";
+usage+= "              with a user file \"fileuser.cc\"\n";
+usage+= "Usage: c++createfrf file.cc func fileuser.cc\n";
+mpiac->RegisterCommand(kw, usage, this, hgrp);
+
+kw = "c++compile";
+usage = "c++compile: compile a file (file.cc -> file.so)\n";
+usage+= "Usage: c++compile file\n";
+usage+= "Warning: give \"file\" or \"file.so\" to create \"file.so\" from \"file.cc\"\n";
+usage+= "       : to be used before c++link";
+mpiac->RegisterCommand(kw, usage, this, hgrp);
+
+kw = "c++link";
+usage = "c++link: link function \"func\" in file.so to spiapp\n";
+usage+= "Usage: c++link file.so func";
+mpiac->RegisterCommand(kw, usage, this, hgrp);
+
+kw = "c++include";
+usage = "c++include: give personnal includes to be used\n";
+usage+= "Usage: c++include myinc1.h myinc2.h ...\n";
+usage+= "Warning: to be used before c++create... c++exec...";
+mpiac->RegisterCommand(kw, usage, this, hgrp);
+
+kw = "c++compileopt";
+usage = "c++compileopt: give additionnal compile options\n";
+usage+= "Usage: c++compileopt -g -O5 -IMy_Inc_Dir ...\n";
+usage+= "Warning: to be used before c++compile";
+mpiac->RegisterCommand(kw, usage, this, hgrp);
+
+kw = "c++linkopt";
+usage = "c++linkopt: give additionnal link options\n";
+usage+= "Usage: c++linkopt -g -O5 ...";
+usage+= "Warning: to be used before c++compile";
+mpiac->RegisterCommand(kw, usage, this, hgrp);
+
+kw = "c++mylibs";
+usage = "c++mylibs: give additionnal libraries\n";
+usage+= "Usage: c++mylibs -LMy_Lib_Dir -lmylib1 -lmylib2 ...";
+usage+= "Warning: to be used before c++compile";
+mpiac->RegisterCommand(kw, usage, this, hgrp);
+
+kw = "c++setvar";
+usage = "c++setvar: Setting test variable \n";
+usage+= "c++setvar varname varcontent ";
+mpiac->RegisterCommand(kw, usage, this, hgrp);
+
+kw = "c++getvar";
+usage = "c++getvar: Getting test variable content\n";
+usage+= "c++getvar varname ";
+mpiac->RegisterCommand(kw, usage, this, hgrp);
+
+kw = "c++varlist";
+usage = "c++getvar: Printing test variable list\n";
+usage+= "c++varlist  ";
+mpiac->RegisterCommand(kw, usage, this, hgrp);
+
+}
+
+/* --Methode-- */
+CxxExecutor::~CxxExecutor()
+{
+}
+
+/* --Methode-- */
+int CxxExecutor::Execute(string& kw, vector<string>& tokens)
+{
+int rc=0;
+if(kw == "c++exec" || kw == "c++execfrf") {
+  if(tokens.size()<1) {
+    cout<<"Usage: c++exec c++ user code"<<endl;
+    cout<<"Usage: c++execfrf fileuser.cc"<<endl;
+    return(1);
+  }
+  if(kw == "c++exec")    rc = FillUserCode(tokens,0);
+  if(kw == "c++execfrf") rc = FillUserCode(tokens[0]);
+  if(rc) return(1);
+  rc = CrFile();   if(rc) return(1);
+  rc = Compile();  if(rc) return(1);
+  rc = Link();     if(rc) return(1);
+  rc = Call();     if(rc) return(1);
+
+} else if(kw == "c++args") {
+  mCallArgs.resize(0);
+  if(tokens.size()>=1)
+    for(uint_4 i=0;i<tokens.size();i++) mCallArgs.push_back(tokens[i]);
+
+} else if(kw == "c++create") {
+  if(tokens.size()<3) {
+    cout<<"Usage: c++create file.cc func c++ user code ..."<<endl;
+    return(1);
+  }
+  rc = FillUserCode(tokens,2);       if(rc) return(1);
+  rc = CrFile(tokens[0],tokens[1]);  if(rc) return(1);
+
+} else if(kw == "c++createfrf") {
+  if(tokens.size()<3) {
+    cout<<"Usage: c++createfrf file.cc func fileuser.cc"<<endl;
+    return(1);
+  }
+  rc = FillUserCode(tokens[2]);     if(rc) return(1);
+  rc = CrFile(tokens[0],tokens[1]); if(rc) return(1);
+
+} else if(kw == "c++compile") {
+  if(tokens.size()>=1) rc = Compile(tokens[0]);
+  else                 rc = Compile();
+  if(rc) return(1);
+
+} else if(kw == "c++link") {
+  if(tokens.size()>=2)      rc = Link(tokens[0],tokens[1]);
+  else if(tokens.size()>=1) rc = Link(tokens[0]);
+  else                      rc = Link();
+  if(rc) return(1);
+
+} else if(kw == "c++include") {
+  mIncList.resize(0);
+  if(tokens.size()>=1)
+    for(uint_4 i=0;i<tokens.size();i++) mIncList.push_back(tokens[i]);
+
+} else if(kw == "c++compileopt") {
+  mCompOpt = "";
+  if(tokens.size()>=1) {
+    for(uint_4 i=0;i<tokens.size();i++) mCompOpt += tokens[i] + " ";
+  }
+
+} else if(kw == "c++linkopt") {
+  mLinkOpt = "";
+  if(tokens.size()>=1) {
+    for(uint_4 i=0;i<tokens.size();i++) mLinkOpt += tokens[i] + " ";
+  }
+
+} else if(kw == "c++mylibs") {
+  mMyLibs = "";
+  if(tokens.size()>=1) {
+    for(uint_4 i=0;i<tokens.size();i++) mMyLibs += tokens[i] + " ";
+  }
+
+} else if(kw == "c++setvar") {
+  if(tokens.size()<2) {
+    cerr << " Usage: c++setvar varname varcontent " << endl;
+    return(1);
+  }
+  string varcont = tokens[1];
+  if(tokens.size()>2) 
+    for(uint_4 i=2;i<tokens.size();i++) varcont += " " + tokens[i] ;
+  NamedObjMgr omg;
+  omg.SetVar(tokens[0], varcont);
+} else if(kw == "c++getvar") {
+  if(tokens.size()<1) {
+    cerr << " Usage: c++getvar varname " << endl;
+    return(1);
+  }
+  NamedObjMgr omg;
+  cout << "c++getvar(" << tokens[0] << ")=" << omg.GetVar(tokens[0]) << endl;
+}  else if(kw == "c++varlist") {
+  NamedObjMgr omg; 
+  cout << omg.GetVarList();
+}
+
+
+return(0);
+}
+
+/* --Methode-- */
+int CxxExecutor::CrFile(string cfilename,string func)
+{
+ofstream os(cfilename.c_str(),ios::out);
+if(!os) {
+  cout<<"CxxExecutor::CrFile: unable to open "<<cfilename<<endl;
+  return 1;
+}
+
+PutInclude(os);
+os<<endl;
+
+PutIncludeUser(os);
+os<<endl;
+
+os<<"extern \"C\" {"<<endl;
+os<<"  int "<<func<<"( vector<string>& args );"<<endl;
+os<<"}"<<endl<<endl;
+os<<"int "<<func<<"( vector<string>& args )"<<endl;
+os<<"{"<<endl;
+os<<"// Some definitions to help using spiapp;"<<endl;
+os<<"NamedObjMgr omg;"<<endl;
+os<<"Services2NObjMgr& srvo = *omg.GetServiceObj();"<<endl;
+os<<"//omg.AddObj(OBJECT* object,string nom_object);"<<endl;
+os<<endl;
+
+PutObject(os);
+os<<endl;
+
+PutVar(os);
+os<<endl;
+
+PutUserCode(os);
+os<<endl;
+
+os<<endl;
+os<<"return 0;"<<endl;
+os<<"}"<<endl;
+
+cout<<"File "<<cfilename<<" for function "<<func<<" created"<<endl;
+return 0;
+}
+
+/* --Methode-- */
+void CxxExecutor::PutInclude(ofstream& os)
+{
+os<<"#include \"machdefs.h\""<<endl
+  <<endl
+
+  <<"//---- System et stdc++ include files"<<endl
+  <<"#include <stdio.h>"<<endl
+  <<"#include <stdlib.h>"<<endl
+  <<"#include <math.h>"<<endl
+  <<"#include <ctype.h>"<<endl
+  <<"#include <string.h>"<<endl
+  <<"#include <iostream.h>"<<endl
+  <<"#include <fstream.h>"<<endl
+  <<"#include <complex>"<<endl
+  <<endl
+
+  <<"#include <typeinfo>"<<endl
+  <<"#include <string>"<<endl
+  <<"#include <vector>"<<endl
+  <<"#include <map>"<<endl
+  <<"#include <functional>"<<endl
+  <<"#include <list>"<<endl
+  <<endl
+
+  <<"//---- Sophya include files"<<endl
+  <<"#include \"systools.h\""<<endl
+  <<"#include \"ntools.h\""<<endl
+  <<"#include \"array.h\""<<endl
+  <<"#include \"histats.h\""<<endl
+  <<endl
+
+  <<"//---- Spiapp include files"<<endl
+  <<"#include \"nobjmgr.h\""<<endl
+  <<"#include \"servnobjm.h\""<<endl
+  <<endl
+
+  <<"#define KeepObj(obj) ___nomobj = #obj; omg.AddObj(obj,___nomobj);"<<endl
+  <<"#define KeepVar(var) ___nomobj = #var; omg.GetVarList().Get(___nomobj) = var ;"<<endl
+  <<endl;
+
+return;
+}
+
+/* --Methode-- */
+void CxxExecutor::PutIncludeUser(ofstream& os)
+{
+if(mIncList.size()<1) return;
+for(uint_4 i=0;i<mIncList.size();i++)
+  os<<"#include \""<<mIncList[i]<<"\""<<endl;
+}
+
+/* --Methode-- */
+void CxxExecutor::PutObject(ofstream& os)
+{
+NamedObjMgr omg;
+NObjMgrAdapter* objmgrad;
+vector<string> objlist;
+string patt = "*";
+omg.GetObjList(patt,objlist); 
+int nobjs = objlist.size();
+
+os<<"//-------------- Object List --------------"<<endl;
+os<<"//Number of objects = "<<nobjs<<endl;
+os<<"string ___nomobj;"<<endl<<endl;
+if(nobjs<=0) return;
+
+string dir,nobj,stmp,obtype;
+for(int i=0;i<nobjs;i++) {
+  objmgrad = omg.GetObjAdapter(objlist[i]);
+  omg.ParseObjectName(objlist[i],dir,nobj);
+  obtype = objmgrad->GetDataObjType();
+  stmp = "___" + nobj;
+
+  os<<"___nomobj = \""<<nobj<<"\";"<<endl;
+  os<<obtype<<"* "<<stmp
+    <<" = dynamic_cast< "<<obtype<<" * >(omg.GetObj(___nomobj));"<<endl;
+  os<<"if("<<stmp<<"==NULL) throw NullPtrError"
+    <<"(\"CxxExecutor::PutObject: Non existing object "<<nobj
+    <<"... please update file\");"<<endl;
+  os<<obtype<<"& "<<nobj<<" = (*"<<stmp<<");"<<endl<<endl;
+}
+
+return;
+}
+
+/* --Methode-- */
+void CxxExecutor::PutVar(ofstream& os)
+{  
+os<<"//-------------- Variable List --------------"<<endl;
+NamedObjMgr omg;
+DVList& varlist = omg.GetVarList();
+// varlist.Show(); varlist.Print();  
+DVList::ValList::const_iterator it;
+for(it=varlist.Begin(); it!=varlist.End(); it++) {
+  string key = (*it).first;
+  os<<"___nomobj = \""<<key<<"\";"<<endl;
+  os<<"MuTyV & "<<key<<" = omg.GetVarList().Get(___nomobj);"<<endl;
+}
+
+}
+
+/* --Methode-- */
+void CxxExecutor::PutUserCode(ofstream& os)
+{
+os<<"//--------------------------------------------//"<<endl;
+os<<"//------------- Code utilisateur -------------//"<<endl;
+os<<"//--------------------------------------------//"<<endl;
+os<<endl;
+if(mUserCode.size()<1) return;
+for(uint_4 i=0;i<mUserCode.size();i++) os<<mUserCode[i]<<endl;
+}
+
+/* --Methode-- */
+int CxxExecutor::FillUserCode(vector<string>& usercode,uint_4 first)
+// - first is the first position in the vector<> where the code starts
+{
+mUserCode.resize(0);
+uint_4 nus = usercode.size();
+if(nus<=first) {
+  cout<<"CxxExecutor::FillUserCode: no user code"<<endl;
+  return 1;
+}
+string dum = "";
+// On ajoute un blanc pour les chaines de caracteres contenant des blancs
+for(uint_4 i=first;i<nus;i++) dum += " " + usercode[i];
+// Tout dans une seule ligne pour eviter les pbs (cf au bas du fichier)
+mUserCode.push_back(dum);
+cout<<"User code filled from standard input"<<endl;
+return 0;
+}
+
+/* --Methode-- */
+int CxxExecutor::FillUserCode(string filename)
+{
+mUserCode.resize(0);
+
+ifstream is(filename.c_str());
+if(!is) {
+  cout<<"CxxExecutor::FillUserCode: unable to open "<<filename<<endl;
+  return 1;
+}
+
+int nline = 4096; // Au plus 4096 characters par ligne!
+char *str = new char[nline+2];
+while(is)
+  {is.getline(str,nline); mUserCode.push_back((string) str);}
+delete [] str;
+if(mUserCode.size()<=0) {
+  return 2;
+  cout<<"CxxExecutor::FillUserCode: no user code"<<endl;
+}
+
+cout<<"User code filled from file"<<filename<<endl;
+return 0;
+}
+
+/* --Methode-- */
+int CxxExecutor::Compile(string rootfilename)
+{
+string fc = rootfilename + ".cc";
+string fl = rootfilename + ".so";
+cout<<"Compile: "<<rootfilename<<endl;
+int rc = 0;
+rc = CrMakefile();
+if(rc) return(1);
+string make  = "make -f cxx_spiapp_Makefile";
+       make += " CXXFLAGS=\"" + mCompOpt + "\"";
+       make += " LDFLAGS=\""  + mLinkOpt + "\"";
+       make += " MYLIBS=\""   + mMyLibs  + "\"";
+       make += " " + rootfilename;
+rc = system(make.c_str());
+if(rc)
+  {cout<<"CxxExecutor::Compile : \n"<<make<<" Failed"<<endl;
+   return 1000+rc;}
+return 0;
+}
+
+/* --Methode-- */
+int CxxExecutor::CrMakefile(void)
+{
+ofstream os("cxx_spiapp_Makefile",ios::out);
+if(!os)
+  {cout<<"CxxExecutor::CrMakefile: unable to open file for Makefile"<<endl;
+   return 1;}
+//---------------------------------------------------------------------
+os<<"MODULEDECCXXFLAGS := -msg_quiet"<<endl;
+os<<"include $(DPCBASEREP)/Include/MakefileUser.h"<<endl;
+os<<"MYLIBS ="<<endl;
+os<<"LIBS = -L$(SLB) -lPI -lextsophya -lsophya -lm"<<endl;
+os<<"ifeq ($(MACHEROS),OSF1)"<<endl;
+os<<"LIBS := $(LIBS) -lfor"<<endl;
+os<<"endif"<<endl;
+os<<"ifeq ($(MACHEROS),Linux)"<<endl;
+os<<"LIBS := $(LIBS) -ldl -lf2c"<<endl;
+os<<"endif"<<endl;
+os<<"%.so:$(OBJ)%.o"<<endl;
+os<<"%:%.cc"<<endl;
+os<<"%:%.o"<<endl;
+os<<"%.o:%.cc"<<endl;
+os<<"%.o:%.c"<<endl;
+os<<"%:%.c"<<endl;
+os<<endl;
+os<<".PRECIOUS: %.so"<<endl;
+os<<endl;
+os<<"%:%.so"<<endl;
+os<<"\t"<<"echo $@ \" made (.so) \""<<endl;
+os<<"%.so:$(OBJ)%.o"<<endl;
+os<<"\t"<<"$(LINK.cc) -shared -o $@ $< $(LIBS) $(MYLIBS)"<<endl;
+os<<"$(OBJ)%.o:%.cc"<<endl;
+os<<"\t"<<"$(COMPILE.cc)  -o $@ $<"<<endl;
+os<<"$(OBJ)%.o:%.c"<<endl;
+os<<"\t"<<"$(COMPILE.c) -c $(CFLAGS)   $(USERFLAGS) -o $@ $<"<<endl;
+//---------------------------------------------------------------------
+return 0;
+}
+
+/* --Methode-- */
+int CxxExecutor::Link(string libname,string func)
+{
+NamedObjMgr omg;
+PIACmd* mpiac = omg.GetImgApp()->CmdInterpreter();
+string key("link");
+vector<string> arg; arg.push_back(libname); arg.push_back(func);
+int rc = mpiac->ExecuteCommand(key,arg);
+cout<<"Link from "<<libname<<" for function "<<func
+    <<" (rc="<<rc<<")"<<endl;
+return 0;
+}
+
+/* --Methode-- */
+int CxxExecutor::Call(string func)
+{
+NamedObjMgr omg;
+PIACmd* mpiac = omg.GetImgApp()->CmdInterpreter();
+string key("call");
+vector<string> arg; arg.push_back(func);
+if(mCallArgs.size()>0)
+  for(int i=0;i<mCallArgs.size();i++) arg.push_back(mCallArgs[i]);
+mpiac->ExecuteCommand(key,arg);
+return 0;
+}
+
+/* --Methode--  DO NOT DELETE.... cmv property !!!
+int CxxExecutor::FillUserCode(vector<string>& usercode,uint_4 first)
+// - first is the first position in the vector<> where the code starts
+{
+mUserCode.resize(0);
+uint_4 nus = usercode.size();
+if(nus<=first) {
+  cout<<"CxxExecutor::FillUserCode: no user code"<<endl;
+  return 1;
+}
+// **** 1er probleme ****
+// - Pour la lisibilite et eviter les bugs avec les chaines de caracteres
+// contenant des blancs, on ne casse les lignes qu'apres un ";" a condition
+// qu'il ne soit pas dans une chaine de caracteres c'est a dire
+// entoure de "....;....".
+// - Attention aux " dans les chaines de caracteres:  "...\"..."
+// - Bugs non-gere pour les tortures: ".....\\" suivi par une autre
+//   chaine de caracteres qui contient un ';'
+//   ex: cout<<"aaa\\"; cout<<"blabla;blabla";
+// **** 2ieme probleme ****
+// - Le decodeur de ligne va couper les commentaires qui contiennent des blancs:
+// "salut ca va" --> tokens[0]="salut tokens[1]=ca tokens[2]=va" --> "salutcava"
+// - On contourne partiellement le pb en ajoutant un blanc en debut des tokens[]
+// identifies comme etant dans une chaine de caracteres (mais impossible de gerer
+// si il y a plusieurs blancs!): "salut     ca    va" -> "salut ca va"
+// **** Conclusion ****
+// Pour ecrire du code sophistique, le faire dans un fichier
+string dum = "";
+bool lastchar = false;
+bool comment = false;
+for(uint_4 i=first;i<nus;i++) {
+  const char* str = usercode[i].c_str();
+  size_t lstr= strlen(str);
+  for(uint_4 j=0;j<lstr;j++) {
+    // debut de mot dans un commentaire -> ajouter un blanc
+    if(j==0 && comment) dum += " ";
+    // on arrive sur un " : debut ou fin commentaire? inactif (\")?
+    if(str[j]=='"') {
+      if(j==0) comment = (comment) ? false: true;
+      else {if(str[j-1]!='\\') comment = (comment) ? false: true;}
+    }
+    dum += str[j];
+    if( i==nus-1 && j==lstr-1 ) lastchar = true;
+    // On charge la string "dum" si : 1-/ on a un ";"
+    //                                2-/ c'est le dernier charactere
+    if((str[j]==';' && !comment) || lastchar)
+      {mUserCode.push_back(dum); dum = "";}
+  }
+}
+cout<<"User code filled from standard input"<<endl;
+return 0;
+}
+*/
+
Index: trunk/SophyaPI/PIext/cxxexecutor.h
===================================================================
--- trunk/SophyaPI/PIext/cxxexecutor.h	(revision 1224)
+++ trunk/SophyaPI/PIext/cxxexecutor.h	(revision 1224)
@@ -0,0 +1,58 @@
+// This may look like C code, but it is really -*- C++ -*-
+// Classe CxxExecutor  : Dynmamic C++ compile/execution in piapp
+// (c) DAPNIA (CEA)                 LAL (IN2P3/CNRS)
+//                           C. Magneville  10/2000
+
+#ifndef CXXEXECUTOR_H_SEEN
+#define CXXEXECUTOR_H_SEEN
+
+#include "machdefs.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <iostream.h>
+
+#include <vector>
+#include <string>
+
+#include "piacmd.h"
+#include "nobjmgr.h"
+
+class CxxExecutor : public CmdExecutor {
+public:
+           CxxExecutor(PIACmd* piac, PIStdImgApp* app);
+  virtual ~CxxExecutor();
+  virtual int Execute(string& keyw,vector<string>& args);
+
+  int  CrFile(string cfilename="cxx_spiapp.cc",string func="usercxx");
+       void PutInclude(ofstream& os);
+       void PutIncludeUser(ofstream& os);
+       void PutObject(ofstream& os);
+       void PutVar(ofstream& os);
+       void PutUserCode(ofstream& os);
+
+  int  FillUserCode(vector<string>& usercode,uint_4 first);
+  int  FillUserCode(string filename);
+  int  Compile(string rootfilename="cxx_spiapp");
+       int CrMakefile(void);
+  int  Link(string libname="cxx_spiapp.so",string func="usercxx");
+  int  Call(string func="usercxx");
+  //int  FillArgs(vector<string>& args);
+  //int  FillArgs(string& args);
+  //string GetArgs(void);
+  // etc...
+  //int  FillInclude(vector<string>& inc);
+  //int  FillCompileOpt(vector<string>& copt);
+  //int  FillLinkOpt(vector<string>& lopt);
+  //int  FillLinkLibs(vector<string>& llibs);
+
+private:
+  string mCompOpt;
+  string mLinkOpt;
+  string mMyLibs;
+  vector<string> mUserCode;
+  vector<string> mIncList;
+  vector<string> mCallArgs;
+};
+
+
+#endif
Index: trunk/SophyaPI/PIext/nobjmgr.cc
===================================================================
--- trunk/SophyaPI/PIext/nobjmgr.cc	(revision 1223)
+++ trunk/SophyaPI/PIext/nobjmgr.cc	(revision 1224)
@@ -204,4 +204,5 @@
 #endif
   myVars->SetS(key, val);
+  //  cout << " DEBUG::SetVar " << *myVars << endl;
   return(fg);
 }
@@ -230,4 +231,5 @@
 string NamedObjMgr::GetVar(string const & key)
 {
+  //  cout << " DEBUG::GetVar " << *myVars << endl;
   return(myVars->GetS(key));
 }
@@ -236,4 +238,5 @@
 DVList& NamedObjMgr::GetVarList()
 {
+  //  cout << " DEBUG::GetVarList " << *myVars << endl;
   return(*myVars);
 }
@@ -526,4 +529,20 @@
 }
 
+bool NamedObjMgr::AddObj(AnyDataObj& obj, string & nom, bool crd)
+{
+NObjMgrAdapter* adap = GetServiceObj()->GetAdapter(&obj);
+if (adap == NULL) {
+  cout << "NamedObjMgr::AddObj() No Adapter !   " << nom << endl;
+  return(false);
+}
+AnyDataObj * cloneobj = adap->CloneDataObj();
+delete adap;
+if (cloneobj == NULL) {
+  cout << "NamedObjMgr::AddObj() Pb cloning object ! " << nom << endl;
+  return(false);
+}
+return ( AddObj(cloneobj , nom, crd) );
+}
+
 /* --Methode-- */
 bool NamedObjMgr::RenameObj(string & nom, string& nomnew)
Index: trunk/SophyaPI/PIext/nobjmgr.h
===================================================================
--- trunk/SophyaPI/PIext/nobjmgr.h	(revision 1223)
+++ trunk/SophyaPI/PIext/nobjmgr.h	(revision 1224)
@@ -53,4 +53,5 @@
 //  Pour ajouter, supprimer et acceder aux objets 
   virtual bool		AddObj(AnyDataObj* obj, string & nom, bool crd=false);
+  virtual bool		AddObj(AnyDataObj& obj, string & nom, bool crd=false);
   virtual bool		RenameObj(string & nom, string& nomnew);
   virtual bool          DelObj(string & nom, bool fgd=true);
Index: trunk/SophyaPI/PIext/nomgadapter.cc
===================================================================
--- trunk/SophyaPI/PIext/nomgadapter.cc	(revision 1223)
+++ trunk/SophyaPI/PIext/nomgadapter.cc	(revision 1224)
@@ -143,56 +143,2 @@
 }
 
-/* --Methode-- */
-string NObjMgrAdapter::DecodeTypeIdName(string linuxtype)
-// seulement pour Linux qui ne code pas correctement
-{
-#if defined(Linux)  || defined(linux)
-  string type("");
-  const char* str = linuxtype.c_str();
-  int lstr = (int) strlen(str);
-  if(lstr<=0) return string("Linux Decoding error: lstr<=0");
-
-  // Le dernier caractere donne le type
-  lstr--;
-  if     (str[lstr]=='v') type = "void";
-  else if(str[lstr]=='b') type = "bool";
-  else if(str[lstr]=='c') type = "char";
-  else if(str[lstr]=='s') type = "short";
-  else if(str[lstr]=='i') type = "int";
-  else if(str[lstr]=='l') type = "long";
-  else if(str[lstr]=='x') type = "long long";
-  else if(str[lstr]=='f') type = "float";
-  else if(str[lstr]=='d') type = "double";
-  else if(str[lstr]=='r') type = "long double";
-  else return string("Linux Decoding error: bad last char");
-  if(lstr==0) return type;
-
-  // Les caracteres precedents donnent: signed, unsigned, *, & ou const.
-  // Mais si on a un Z, alors c'est un complexe (code ...t7complex1Z...)
-  for(int i=0; i<(int)strlen(str); i++) {
-    lstr--;
-    if     (str[lstr]=='U') type = "unsigned " + type;
-    else if(str[lstr]=='S') type = "signed " + type;
-    else if(str[lstr]=='P') type = type + "*";
-    else if(str[lstr]=='R') type = type + "&";
-    else if(str[lstr]=='C') type = "const " + type;
-    else if(str[lstr]=='Z') {  // Complexe
-      type = "complex<" + type + ">";
-      for(int j=0;j<(int)strlen(str);j++) {
-        if     (str[j]=='P') type = type + "*";
-        else if(str[j]=='R') type = type + "&";
-        else if(str[j]=='C') type = "const " + type;
-        else if(str[j]=='t') break;
-        else return string("Linux Decoding error: bad char 1,2 for Z");
-      }
-      break;
-    }
-    else return string("Linux Decoding error: bad last-1,last-2 char");
-    if(lstr==0) break;
-  }
-
-return type;
-#else
-return linuxtype;
-#endif
-}
Index: trunk/SophyaPI/PIext/nomgadapter.h
===================================================================
--- trunk/SophyaPI/PIext/nomgadapter.h	(revision 1223)
+++ trunk/SophyaPI/PIext/nomgadapter.h	(revision 1224)
@@ -67,6 +67,4 @@
 
 protected:
-  string DecodeTypeIdName(string linuxtype);
-
   AnyDataObj* mObj;
 };
Index: trunk/SophyaPI/PIext/nomimagadapter.cc
===================================================================
--- trunk/SophyaPI/PIext/nomimagadapter.cc	(revision 1223)
+++ trunk/SophyaPI/PIext/nomimagadapter.cc	(revision 1224)
@@ -5,4 +5,6 @@
 #include <string>
 
+#include "datatype.h"
+
 #include "nomimagadapter.h"
 #include "pimgadapter.h"
@@ -49,5 +51,6 @@
 {
 string type = "Image< ";
-type +=  DecodeTypeIdName(typeid(T).name());
+// type +=  DecodeTypeIdName(typeid(T).name());
+type += DataType<T>::getTypeName();
 type +=  " > ";
 return(type);
Index: trunk/SophyaPI/PIext/nomskymapadapter.cc
===================================================================
--- trunk/SophyaPI/PIext/nomskymapadapter.cc	(revision 1223)
+++ trunk/SophyaPI/PIext/nomskymapadapter.cc	(revision 1224)
@@ -7,4 +7,6 @@
 #include <complex>
 
+#include "datatype.h"
+
 #include "nomskymapadapter.h"
 #include "skymap.h"
@@ -85,5 +87,6 @@
 if (sg != NULL) type = "SphereHEALPix< ";
 
-type +=  DecodeTypeIdName(typeid(T).name());
+// type +=  DecodeTypeIdName(typeid(T).name());
+type += DataType<T>::getTypeName();
 type +=  " > ";
 return(type);
Index: trunk/SophyaPI/PIext/nomtmatvecadapter.cc
===================================================================
--- trunk/SophyaPI/PIext/nomtmatvecadapter.cc	(revision 1223)
+++ trunk/SophyaPI/PIext/nomtmatvecadapter.cc	(revision 1224)
@@ -6,4 +6,6 @@
 #include <complex>
 
+#include "datatype.h"
+
 #include "tvector.h"
 #include "objfitter.h"
@@ -53,5 +55,6 @@
 if (v != NULL) type = "TVector< ";
 
-type +=  DecodeTypeIdName(typeid(T).name());
+// type +=  DecodeTypeIdName(typeid(T).name());
+type += DataType<T>::getTypeName();
 type +=  " > ";
 return(type);
Index: trunk/SophyaPI/PIext/objlist.list
===================================================================
--- trunk/SophyaPI/PIext/objlist.list	(revision 1223)
+++ trunk/SophyaPI/PIext/objlist.list	(revision 1224)
@@ -1,3 +1,4 @@
 basexecut.o
+cxxexecutor.o
 nobjmgr.o
 nomgadapter.o
Index: trunk/SophyaPI/PIext/piacmd.cc
===================================================================
--- trunk/SophyaPI/PIext/piacmd.cc	(revision 1223)
+++ trunk/SophyaPI/PIext/piacmd.cc	(revision 1224)
@@ -15,4 +15,5 @@
 #include "piafitting.h"
 #include "pawexecut.h"
+#include "cxxexecutor.h"
 
 #include PISTDWDG_H 
@@ -313,4 +314,5 @@
 fitexec = new PIAFitter(this, app);
 pawexec = new PAWExecutor(this, app);
+cxxexec = new CxxExecutor(this, app);
 AddInterpreter(this);
 curcmdi = this;
@@ -334,4 +336,5 @@
 delete fitexec;
 delete pawexec;
+delete cxxexec;
 }
 
Index: trunk/SophyaPI/PIext/piacmd.h
===================================================================
--- trunk/SophyaPI/PIext/piacmd.h	(revision 1223)
+++ trunk/SophyaPI/PIext/piacmd.h	(revision 1224)
@@ -97,7 +97,8 @@
 
   CmdInterpreter* curcmdi;
-  CmdExecutor* basexec;
-  CmdExecutor* fitexec;
-  CmdExecutor* pawexec;
+  CmdExecutor* basexec;  // basic command executor
+  CmdExecutor* fitexec;  // Fit command executor
+  CmdExecutor* pawexec;  // paw-like command executor
+  CmdExecutor* cxxexec;  // on-line c++ compile/execution command executor
 
 // Pour enregistrer la liste de commandes et leurs executeurs et le help
