// Copyright (C) 2010, Guy Barrand. All rights reserved.
// See the file tools.license for terms.

#ifndef tools_rroot_dummy_fac
#define tools_rroot_dummy_fac

//#include "info"
//#include "iros"

#include "graph"

namespace tools {
namespace rroot {

class dummy_fac : public virtual ifac {
public: //ifac
  virtual std::ostream& out() const {return m_out;}
  virtual iro* create(const std::string& a_class,const args& /*a_args*/) {
    if(rcmp(a_class,"TGraph")) { //for TH_read_1D/List.
      return new graph();
    } else {
      m_out << "tools::rroot::dummy_fac::create :"
            << " dummy. Can't create object of class " << sout(a_class) << "."
            << std::endl;
    }
    return 0;
  }
public:
  dummy_fac(std::ostream& a_out):m_out(a_out){}
  virtual ~dummy_fac(){}
protected:
  dummy_fac(const dummy_fac& a_from): ifac(a_from),m_out(a_from.m_out){}
  dummy_fac& operator=(const dummy_fac&){return *this;}
protected:
  std::ostream& m_out;
};

}}

#endif
