#ifndef AGDBCOMPOSHH #define AGDBCOMPOSHH #include #include "agdbSection.hh" #include "agdbVolume.hh" #include "agdbBase.hh" #include "agdbPos.hh" namespace agdb { class Compos : public Volume { private: vector _posVec; // Pointed to for reference. // May or may not be our responsibility. vector _ownedPos; // string _name; public: Compos() : Volume("composition"), _posVec(), _ownedPos() { }; ~Compos() { for (unsigned int i=0; i<_ownedPos.size(); i++) { delete _ownedPos[i]; }; }; void putMeIn(xml::Element & parent) { //cout << "compos put me in" << endl; xml::Element * child = new xml::Element(); assert(child); parent.addChild(child); child->setTagName(Volume::Base::getTagName()); // LESTER Must complete ... add checking // Lastly the children. Volume::getNameAtt().addAttributeTo(child); //child->addAttribute("name", Volume::getName()); for (unsigned int i=0; i<_posVec.size(); i++) { _posVec[i]->putMeIn(*child); }; }; public: /* Compos & setName(const string & s) { _name=s; return *this; }; const string getName() { return _name; }; */ Compos & addPos(Pos & pos) { _posVec.push_back(&pos); return *this; }; }; } // end of namespace #endif