#ifndef __XMLIO_CGroupTemplate_impl__ #define __XMLIO_CGroupTemplate_impl__ namespace xmlioserver { using namespace tree; /// ////////////////////// Définitions ////////////////////// /// template CGroupTemplate::CGroupTemplate(void) : CObjectTemplate() //, V() , childMap(), childList() , groupMap(), groupList() { /* Ne rien faire de plus */ } template CGroupTemplate::CGroupTemplate(const StdString & id) : CObjectTemplate(id) //, V() , childMap(), childList() , groupMap(), groupList() { /* Ne rien faire de plus */ } template CGroupTemplate::~CGroupTemplate(void) { /* Ne rien faire de plus */ } template StdString CGroupTemplate::toString(void) const { StdOStringStream oss; StdString name = (this->getId().compare(V::GetDefName()) != 0) ? V::GetName() : V::GetDefName(); oss << "< " << name << " "; if (this->hasId() && (this->getId().compare(V::GetDefName()) != 0)) oss << " id=\"" << this->getId() << "\" "; if (this->hasChild()) { oss << SuperClassAttribute::toString() << ">" << std::endl; typename std::vector >::const_iterator itg = this->groupList.begin(), endg = this->groupList.end(); typename std::vector >::const_iterator itc = this->childList.begin(), endc = this->childList.end(); for (; itg != endg; itg++) { boost::shared_ptr group = *itg; oss << *group << std::endl; } for (; itc != endc; itc++) { boost::shared_ptr child = *itc; oss << *child << std::endl; } oss << ""; } else { oss << SuperClassAttribute::toString() << "/>"; } return (oss.str()); } template void CGroupTemplate::fromString(const StdString & str) { ERROR("CGroupTemplate::toString(void)", << "[ str = " << str << "] Not implemented yet !"); } template StdString CGroupTemplate::GetName(void) { return (U::GetName().append("_group")); } template StdString CGroupTemplate::GetDefName(void) { return (U::GetName().append("_definition")); } template const std::vector >& CGroupTemplate::getChildList(void) const { return (this->childList); } template const xios_map >& CGroupTemplate::getGroupMap(void) const { return (this->groupList); } template bool CGroupTemplate::hasChild(void) const { return ((groupList.size() + childList.size()) > 0); } template void CGroupTemplate::parse(xml::CXMLNode & node) { this->parse(node, true); } template void CGroupTemplate::solveDescInheritance(const CAttributeMap * const parent) { if (parent != NULL) SuperClassAttribute::setAttributes(parent); typename std::vector >::const_iterator itc = this->childList.begin(), endc = this->childList.end(); typename std::vector >::const_iterator itg = this->groupList.begin(), endg = this->groupList.end(); for (; itc != endc; itc++) { boost::shared_ptr child = *itc; child->solveDescInheritance(this); } for (; itg != endg; itg++) { boost::shared_ptr group = *itg; group->solveRefInheritance(); group->solveDescInheritance(this); } } template void CGroupTemplate::getAllChildren(std::vector > & allc) const { allc.insert (allc.end(), childList.begin(), childList.end()); typename std::vector >::const_iterator itg = this->groupList.begin(), endg = this->groupList.end(); for (; itg != endg; itg++) { boost::shared_ptr group = *itg; group->getAllChildren(allc); } } template std::vector > CGroupTemplate::getAllChildren(void) const { std::vector > allc; this->getAllChildren(allc); return (allc); } template void CGroupTemplate::solveRefInheritance(void) { /* Ne rien faire de plus */ } } // namespace xmlioserver #endif // __XMLIO_CGroupTemplate_impl__