#include "sopnamsp.h"
#include "machdefs.h"
#include <stdlib.h>
#include <typeinfo>
#include <iostream>
#include <string>
#include "nomgadapter.h"

/* --Methode-- */
NObjMgrAdapter::NObjMgrAdapter(AnyDataObj* o)
{
mObj = o;
}

/* --Methode-- */
NObjMgrAdapter::~NObjMgrAdapter()
{
}

/* --Methode-- */
NObjMgrAdapter* NObjMgrAdapter::Clone(AnyDataObj* o)
{
return(new NObjMgrAdapter(o));
}

/* --Methode-- */
AnyDataObj* NObjMgrAdapter::GetDataObj()
{
return(mObj);
}

/* --Methode-- */
string NObjMgrAdapter::GetDataObjType()
{
  return("AnyDataObj ");
}


/* --Methode-- */
AnyDataObj* NObjMgrAdapter::CloneDataObj(bool)
{
string s = typeid(*mObj).name();
cout << "NObjMgrAdapter::CloneDataObj() - Error : Not supported for " << s << endl;
return(NULL);
}

/* --Methode-- */
void NObjMgrAdapter::CopyFrom(AnyDataObj *)
{
string s = typeid(*mObj).name();
cout << "NObjMgrAdapter::CopyFrom() - Error : Not supported for " << s << endl;
}


/* --Methode-- */
string NObjMgrAdapter::ToString()
{
char buff[128];
sprintf(buff,"%s@%lx", typeid(*mObj).name(), (long)mObj);
return(buff);
}

/* --Methode-- */
void NObjMgrAdapter::FillFromString()
{
string s = typeid(*mObj).name();
cout << "NObjMgrAdapter::FillFromString() - Error : Not supported for " << s << endl;
 return;
}

/* --Methode-- */
string NObjMgrAdapter::GetInfoString(vector<string>& /*opts*/)
{
char buff[128];
sprintf(buff, "Type: %s @ %lx", typeid(*mObj).name(), (long)mObj);
return(buff);
}

/* --Methode-- */
int NObjMgrAdapter::PerformOperation(vector<string>& /*opts*/)
{
cout << "No operation defined for " << typeid(*mObj).name() << endl;
return 1;
}


/* --Methode-- */
void NObjMgrAdapter::SavePPF(POutPersist&, string const & )
{
string s = typeid(*mObj).name();
cout << "NObjMgrAdapter::SavePPF() - Error : Not supported for " << s << endl;
}

/* --Methode-- */
void NObjMgrAdapter::Print(ostream&, int /*lev*/)
{
string s = typeid(*mObj).name();
cout << "NObjMgrAdapter::Print() " << typeid(*mObj).name() << hex 
     << " @" << (unsigned long long)mObj << dec << endl; 
}

/* --Methode-- */
PIDrawer* NObjMgrAdapter::GetDrawer(string &)
{
return(NULL);
}

/* --Methode-- */
P2DArrayAdapter* NObjMgrAdapter::Get2DArray(string &)
{
return(NULL);
}

/* --Methode-- */
NTupleInterface* NObjMgrAdapter::GetNTupleInterface(bool& adel)
{
string s = typeid(*mObj).name();
cout << "NObjMgrAdapter::GetNTupleInterface() - Error : Not supported for " << s << endl;
adel = false;
return(NULL);
}

/* --Methode-- */
GeneralFitData* NObjMgrAdapter::GetGeneralFitData(bool& adel
                ,GeneralFitData::FitErrType errtype
                ,double errscale,double errmin,int i1,int i2,int j1,int j2)
{
string s = typeid(*mObj).name();
cout << "NObjMgrAdapter::GetGeneralFitData() - Error : Not supported for "<<s<<endl;
adel = false;
return(NULL);
}

AnyDataObj* NObjMgrAdapter::FitResidusObj(GeneralFit& mfit)
{
string s = typeid(*mObj).name();
cout << "NObjMgrAdapter::FitResidusObj() - Error : Not supported for "<<s<<endl;
return(NULL);
}


AnyDataObj* NObjMgrAdapter::FitFunctionObj(GeneralFit& mfit)
{
string s = typeid(*mObj).name();
cout << "NObjMgrAdapter::FitFunctionObj() - Error : Not supported for "<<s<<endl;
return(NULL);
}

