Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 2155)
+++ trunk/MagicSoft/Mars/Changelog	(revision 2156)
@@ -16,4 +16,10 @@
    * macros/readCT1.C:
      - fixed a typo
+
+   * mbase/MTaskInteractive.[h,cc]:
+     - added
+     
+   * mbase/Makefile, mbase/BaseLinkDef.h:
+     - added MTaskInteractive
 
 
Index: trunk/MagicSoft/Mars/mbase/BaseLinkDef.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/BaseLinkDef.h	(revision 2155)
+++ trunk/MagicSoft/Mars/mbase/BaseLinkDef.h	(revision 2156)
@@ -11,4 +11,6 @@
 //#pragma link C++ global kPI;
 
+#pragma link C++ function __omanip_debug;
+
 #pragma link C++ global gLog;
 
@@ -18,4 +20,5 @@
 
 #pragma link C++ class MTask+;
+#pragma link C++ class MTaskInteractive+;
 #pragma link C++ class MTaskList+;
 
Index: trunk/MagicSoft/Mars/mbase/MTaskInteractive.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MTaskInteractive.cc	(revision 2156)
+++ trunk/MagicSoft/Mars/mbase/MTaskInteractive.cc	(revision 2156)
@@ -0,0 +1,120 @@
+/* ======================================================================== *\
+!
+! *
+! * This file is part of MARS, the MAGIC Analysis and Reconstruction
+! * Software. It is distributed to you in the hope that it can be a useful
+! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
+! * It is distributed WITHOUT ANY WARRANTY.
+! *
+! * Permission to use, copy, modify and distribute this software and its
+! * documentation for any purpose is hereby granted without fee,
+! * provided that the above copyright notice appear in all copies and
+! * that both that copyright notice and this permission notice appear
+! * in supporting documentation. It is provided "as is" without express
+! * or implied warranty.
+! *
+!
+!
+!   Author(s): Thomas Bretz, 6/2003 <mailto:tbretz@astro.uni-wuerzburg.de>
+!
+!   Copyright: MAGIC Software Development, 2000-2003
+!
+!
+\* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// MTaskInteractive
+//
+//  Input Containers:
+//   -/-
+//
+//  Output Containers:
+//   -/-
+//
+/////////////////////////////////////////////////////////////////////////////
+#include "MTaskInteractive.h"
+
+#include <iostream.h>
+
+#include <Api.h>
+#include <TMethodCall.h>
+
+#include "MLog.h"
+#include "MLogManip.h"
+
+ClassImp(MTaskInteractive);
+
+// --------------------------------------------------------------------------
+//
+//
+MTaskInteractive::MTaskInteractive(const char *name, const char *title) :
+    fPreProcess(NULL), fProcess(NULL), fPostProcess(NULL)
+{
+    fName  = name  ? name  : "MTaskInteractive";
+    fTitle = title ? title : "Interactive task";
+
+    fCall[0] = 0;
+    fCall[1] = 0;
+    fCall[2] = 0;
+}
+
+MTaskInteractive::~MTaskInteractive()
+{
+    Free(0);
+    Free(1);
+    Free(2);
+}
+
+inline Bool_t MTaskInteractive::Return(Int_t no, void *params)
+{
+    // Static function called when SetFCN is called in interactive mode
+    if (!fCall[no])
+    {
+        gLog << err << dbginf << "Return(" << no << ") - TMethodCall not set." << endl;
+        return kFALSE;
+    }
+
+    Long_t result;
+    fCall[no]->Execute(params, result);
+    return result;
+}
+
+Bool_t MTaskInteractive::Set(void *fcn, Int_t no, const char *params)
+{
+    // this function is called by CINT instead of the function above
+    if (!fcn)
+        return kFALSE;
+
+    char *funcname = G__p2f2funcname(fcn);
+    if (!funcname)
+        return kFALSE;
+
+    Free(no);
+
+    fCall[no] = new TMethodCall;
+    fCall[no]->InitWithPrototype(funcname, params);
+
+    gLog << inf << GetDescriptor() << ": Using " << funcname << " as ";
+    switch (no)
+    {
+    case 0:
+        gLog << "Pre";
+        break;
+    case 2:
+        gLog << "Post";
+        break;
+
+    }
+    gLog << "Process-function." << endl;
+
+    return kTRUE;
+}
+
+void MTaskInteractive::Free(Int_t no)
+{
+    if (!fCall[no])
+        return;
+    delete fCall[no];
+    fCall[no] = 0;
+}
Index: trunk/MagicSoft/Mars/mbase/MTaskInteractive.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MTaskInteractive.h	(revision 2156)
+++ trunk/MagicSoft/Mars/mbase/MTaskInteractive.h	(revision 2156)
@@ -0,0 +1,54 @@
+#ifndef MARS_MTaskInteractive
+#define MARS_MTaskInteractive
+
+/////////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// MTaskInteractive                                                               //
+//                                                                         //
+// Does nothing than return kCONTINUE in the Process-fucntion              //
+// (use with filters)                                                      //
+//                                                                         //
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef MARS_MTask
+#include "MTask.h"
+#endif
+
+class MFilter;
+class MTaskList;
+
+class MTaskInteractive : public MTask
+{
+private:
+    TMethodCall *fCall[3];
+
+    Bool_t (*fPreProcess)(MParList *list);
+    Bool_t (*fProcess)();
+    Bool_t (*fPostProcess)();
+
+    Bool_t PreProcess(MParList *list) { if (fCall[0]) return Return(0, &list); return fPreProcess  ? (*fPreProcess)(list) : kTRUE; }
+    Bool_t Process()                  { if (fCall[1]) return Return(1);        return fProcess     ? (*fProcess)()        : kTRUE; }
+    Bool_t PostProcess()              { if (fCall[2]) return Return(2);        return fPostProcess ? (*fPostProcess)()    : kTRUE; }
+
+    Bool_t Return(Int_t no, void *param=NULL);
+    Bool_t Set(void *fcn, Int_t no, const char *params);
+    void   Free(Int_t no);
+
+public:
+    MTaskInteractive(const char *name=NULL, const char *title=NULL);
+    ~MTaskInteractive();
+
+    // This is to be used in compiled code
+    void SetPreProcess(Bool_t (*func)(MParList *list)) { fPreProcess = func;  Free(0); }
+    void SetProcess(Bool_t (*func)())                  { fProcess = func;     Free(1);  }
+    void SetPostProcess(Bool_t (*func)())              { fPostProcess = func; Free(2);  }
+
+    // This is for usage in CINT
+    void SetPreProcess(void *fcn)  { Set(fcn, 0, "MParList*"); fPreProcess =0; }
+    void SetProcess(void *fcn)     { Set(fcn, 1, "");          fProcess    =0; }
+    void SetPostProcess(void *fcn) { Set(fcn, 2, "");          fPostProcess=0; }
+
+    ClassDef(MTaskInteractive, 0) // Interactive task
+};
+
+#endif
Index: trunk/MagicSoft/Mars/mbase/Makefile
===================================================================
--- trunk/MagicSoft/Mars/mbase/Makefile	(revision 2155)
+++ trunk/MagicSoft/Mars/mbase/Makefile	(revision 2156)
@@ -38,4 +38,5 @@
 	   MInputStreamID.cc \
            MTask.cc \
+           MTaskInteractive.cc \
 	   MTaskList.cc \
            MFilter.cc \
