#ifndef XML_OBJECT_H
#define XML_OBJECT_H


// The 'base' template specialization of class xmlObject.
// Wraps  any 'non-containg' c++ object. That is, not a POINTER and not a CONTAINER.
// This base class is fairly empty : all the interesting properties are already included in class xmlObject_base !

template<typename XMLIZED>

struct xmlObject : public xmlWrapper<XMLIZED>
{

  xmlObject( XMLIZED & obj , std::string name="" ) : xmlWrapper<XMLIZED>(obj,name)	{}
  
//no wrapped object...
xmlObject( std::string name = "") : xmlWrapper<XMLIZED>(name)	{}

  virtual ~xmlObject(){}

//Copy the 'other-than-wrapped object' properties of an xmlObject<XMLIZED> to another.
//Useful when dealing with containers, or pointers, over class XMLIZED
  void copy_Handler(const xmlObject<XMLIZED> & origin)	{}

//This function is used to find the eventual derived type of an XMLIZED*, which can be something else than XMLIZED.
//It will be different for the pointer and container specializations of xmlObject.
//Note that it implies, that XMLIZED must necessarily inherit from class xmlClass.

static const type_info & pointer_typeid ( XMLIZED *obj )
{
	return obj->get_pointer_typeid();
}

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

};


// REGISTRATION FUNCTIONS :
//We have to make them external functions to allow partial template specialization.
//Basically, there are 'two' possible registration functions ( in this case) :

//*******   (1) Recursive registration with intermediate registrations (for contained objects, pointer names...)
//*******   (2) Recursive registration WITHOUT intermediate registrations (preceding function must ALREADY have been used)

//NOTA: there is no code by default: compile error, except for the useful specialisations, to come in the headers for
// xmlObject<XMLIZED*> and for xmlObject< stl_container<XMLIZED> >


template<uint order , typename XMLIZED , typename derivedCLASS >
struct Register_obj
{
	static bool total_registration ( list<string> registerNames , xmlObject<XMLIZED> * xml_obj );
	static bool last_step_registration ( string registerName , xmlObject<XMLIZED> * xml_obj );
};


#endif
