Changeset 2612


Ignore:
Timestamp:
02/06/24 15:41:08 (3 months ago)
Author:
jderouillat
Message:

Fix management of a service created onto a service through XML

Location:
XIOS3/trunk/src/node
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • XIOS3/trunk/src/node/service_node.cpp

    r2547 r2612  
    1111 
    1212  CServiceNode::~CServiceNode(void) 
    13   { /* Ne rien faire de plus */ } 
     13  { 
     14    for(auto& serviceOnto : servicesOnto_) 
     15    { 
     16      delete serviceOnto; 
     17    } 
     18  } 
    1419 
    1520 
     
    1722  { 
    1823    SuperClass::parse(node); 
     24    if (node.goToChildElement()) 
     25    { 
     26      do 
     27      { 
     28        CServiceNode* serviceOnto = new CServiceNode(); 
     29        serviceOnto->parse( node ); 
     30        if ( (serviceOnto->name.isEmpty()) || (serviceOnto->type.isEmpty()) ) 
     31        { 
     32          ERROR("void CServiceNode::parse(xml::CXMLNode & node)",<<"Service onto is not defined correctly <name> and <type> must be specified") 
     33        } 
     34        servicesOnto_.push_back( serviceOnto ); 
     35      } while (node.goToNextElement()); 
     36      node.goToParentElement(); 
     37    } 
    1938  } 
    2039 
     
    6281     
    6382    servicesManager->createServices(poolId, serviceId, serviceType, nbRessources, nb_partitions, true) ; 
     83 
     84    for(auto& serviceOnto : servicesOnto_) 
     85    { 
     86      if (serviceOnto->type.getValue() == type_attr::writer) serviceType=CServicesManager::WRITER ; 
     87      else if (serviceOnto->type.getValue() == type_attr::reader) serviceType=CServicesManager::READER ; 
     88      else if (serviceOnto->type.getValue() == type_attr::gatherer) serviceType=CServicesManager::GATHERER ; 
     89      servicesManager->createServicesOnto(poolId, serviceOnto->name, serviceType, serviceId, true) ; 
     90    } 
     91     
    6492    if (CThreadManager::isUsingThreads()) 
    6593      for(int i=0; i<nb_partitions; i++) 
  • XIOS3/trunk/src/node/service_node.hpp

    r2458 r2612  
    5959      virtual void parse(xml::CXMLNode & node); 
    6060      void allocateRessources(const string& poolId) ; 
     61      std::vector<CServiceNode*> servicesOnto_; 
    6162 
    6263  }; // class CServiceNode 
Note: See TracChangeset for help on using the changeset viewer.