There is a base class "model of a device", it includes classes describing the configuration of this device.
Class Conf1 { public: Conf1(): Name("C1"){} private: string Name; int mvalue; } Class Conf2 и Conf3 по подобию. Class Model { public: Model(): Name("M1"){} private: string Name; Conf1 c1; Conf2 c2; Conf3 c3; }
It is necessary to somehow establish the affinity of configurations by the name of the model.
All CONFIGS have "Name" and "parameter", MODEL only "name". It is necessary in some way to assign these configurations to the corresponding model and to produce the output of configurations in this way.
<person> <firstName>Иван</firstName> <lastName>Иванов</lastName> <phoneNumbers> <phoneNumber>812 123-1234</phoneNumber> <phoneNumber>916 123-4567</phoneNumber> </phoneNumbers> </person>
I can display, I can not organize a hierarchy of nesting classes.