#ifndef XML_WRAPPER_H
#define XML_WRAPPER_H

// The base templated object that wraps "any" (hmm) c++ object.
// In practice, this works better if XMLIZED inherits from type xmlClass

//In this header and in the following, all code starts being totally template...

template<typename XMLIZED>

struct xmlWrapper : public xmlObject_base
{

  XMLIZED* wrapped;

  xmlWrapper(XMLIZED & obj , std::string name ) : xmlObject_base(name) , wrapped( &obj )
  {
    //const type_info & typ = typeid( obj );
    //cerr<<"CREATING AN XML OBJECT, WRAPPING TYPE "<<typ.name()<<endl;
    //if(xmlName.size() ) cerr<<" MY NAME IS "<<xmlName<<"."<<endl;

    xmlObject_base::reverseMap [ &obj ] = this;
    xmlObject_base::wrapped_noType = static_cast<void*> ( &obj ) ;

  }

  //constructor with no wrapped object...
xmlWrapper( std::string name ) : xmlObject_base(name) , wrapped(0)  {}

  //destructor
  virtual ~xmlWrapper(){}

private : //non copyable
  xmlWrapper(const xmlWrapper<XMLIZED> & yo){}


};



#endif
