Changeset 352 for XIOS/trunk/src/group_template_impl.hpp
- Timestamp:
- 07/09/12 11:33:05 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/group_template_impl.hpp
r347 r352 4 4 #include "xmlioserver_spl.hpp" 5 5 #include "event_server.hpp" 6 #include "object_template _impl.hpp"6 #include "object_template.hpp" 7 7 #include "group_template.hpp" 8 8 #include "context.hpp" 9 9 #include "event_client.hpp" 10 10 #include "context_client.hpp" 11 #include "message.hpp" 12 #include "type.hpp" 13 #include "type_util.hpp" 11 14 12 15 … … 238 241 CGroupTemplate<U, V, W>::getGroupMap(void) const 239 242 { 240 return (this->group List);243 return (this->groupMap); 241 244 } 242 245 … … 351 354 void CGroupTemplate<U, V, W>::addChild(U* child) 352 355 { 353 return CGroupFactory::AddChild<V>(this->getShared ,child->getShared()) ;356 return CGroupFactory::AddChild<V>(this->getShared(),child->getShared()) ; 354 357 } 355 358 … … 475 478 } 476 479 480 template <class U, class V, class W> 481 void CGroupTemplate<U, V, W>::parse(xml::CXMLNode & node, bool withAttr) 482 { 483 484 StdString name = node.getElementName(); 485 xml::THashAttributes attributes = node.getAttributes(); 486 if (withAttr) 487 { 488 CGroupTemplate<U, V, W>::SuperClass::parse(node); 489 if (attributes.end() != attributes.find("src")) 490 { 491 StdIFStream ifs ( attributes["src"].c_str() , StdIFStream::in ); 492 if (!ifs.good()) 493 ERROR("CGroupTemplate<U, V, W>::parse(xml::CXMLNode & node, bool withAttr)", 494 << "[ filename = " << attributes["src"] << " ] Bad xml stream !"); 495 xml::CXMLParser::ParseInclude(ifs, *this); 496 } 497 } 498 499 // PARSING POUR GESTION DES ENFANTS 500 V* group_ptr = (this->hasId()) 501 ? V::get(this->getId()) 502 : boost::polymorphic_downcast<V*>(this); 503 504 if (!(node.goToChildElement())) 505 { 506 if (this->hasId()) 507 { 508 DEBUG(<< "L'objet de type \'" << V::GetName() 509 << "\' nommé \'" << this->getId() 510 << "\' ne contient pas d\'enfant !"); 511 } 512 } 513 else 514 { 515 do { // Parcours pour traitement. 516 517 StdString name = node.getElementName(); 518 attributes.clear(); 519 attributes = node.getAttributes(); 520 521 if (name.compare(V::GetName()) == 0) 522 { 523 if (attributes.end() == attributes.find("id")) 524 CGroupFactory::CreateGroup(group_ptr->getShared())->parse(node); 525 else 526 CGroupFactory::CreateGroup(group_ptr->getShared(), attributes["id"])->parse(node); 527 continue; 528 } 529 530 if (name.compare(U::GetName()) == 0) 531 { 532 if (attributes.end() == attributes.find("id")) 533 CGroupFactory::CreateChild(group_ptr->getShared())->parse(node); 534 else 535 CGroupFactory::CreateChild(group_ptr->getShared(), attributes["id"])->parse(node); 536 continue; 537 } 538 539 DEBUG(<< "Dans le contexte \'" << CContext::getCurrent()->getId() 540 << "\', un objet de type \'" << V::GetName() 541 << "\' ne peut contenir qu'un objet de type \'" << V::GetName() 542 << "\' ou de type \'" << U::GetName() 543 << "\' (reçu : " << name << ") !"); 544 545 } while (node.goToNextElement()); 546 node.goToParentElement(); // Retour au parent 547 } 548 } 477 549 } // namespace xios 478 550
Note: See TracChangeset
for help on using the changeset viewer.