*************************************************************************
************		Welcome to xmlParameters++	*****************
************			version 1.0	 	*****************
*************************************************************************

		Saving/loading parameters of a C++ program from an xml tree.

			Author : Adrien Wohrer
			Institution : ODYSSEE, INRIA Sophia Antipolis
			Contact : Adrien.Wohrer@sophia.inria.fr
			Code started september 2006.


******************* THIS IS THE EXAMPLE FILE !!! ************************


You very understandably got bored of the preceding README and came here to see something more practical!


*****************PROBLEMATIC:

Suppose you have stupid C++ classes, as defined in 

sample_classes.h

Suppose you want to be able to load the IMPORTANT PARAMETERS of the objects through an xml file
(NOT ALL the fields of the objects... although in this case, you DO load almost all the fields :-) )
For example, define the people in a bus by

bus_definition.xml

Note the difficulty of the thing, since you want to initialize a vector<Toto*> structure, and tell which specialization of Toto* has each of the pointed objects.



******************PROPOSED SOLUTION:

Here is what I propose:

sample_classes_withXMLcode.h

Given an object Bus, all fields that you want to include in an xml file are defined in the function called xml_ize() inside class Bus. This includes registration of different acceptable derived types for a vector<Toto *>.

Type "make" in the directory: it will create program Test_Bus, which explicitly initializes a Bus object from file bus_definition.xml, uses it, and then saves it to another xml file, reconstructed-bus-file.xml

Note that warnings are emitted if an unregistered parameter is present in the XML file (here, the parameter called "whatever").


