Back to index

salome-kernel  6.5.0
SALOME_ModuleCatalog_Handler.cxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 //  SALOME ModuleCatalog : implementation of ModuleCatalog server which parsers xml description of modules
00024 //  File   : SALOME_ModuleCatalog_Handler.cxx
00025 //  Author : Estelle Deville
00026 //  Module : SALOME
00027 //  $Header: /home/server/cvs/KERNEL/KERNEL_SRC/src/ModuleCatalog/SALOME_ModuleCatalog_Handler.cxx,v 1.12.32.2.12.1 2012-04-12 14:05:17 vsr Exp $ 
00028 //
00029 #define WRITE_CATA_COMPONENT
00030 
00031 #include "SALOME_ModuleCatalog_Handler.hxx"
00032 #include "SALOME_ModuleCatalog_Parser_IO.hxx"
00033 #include "utilities.h"
00034 
00035 #include <sstream>
00036 
00037 #ifdef _DEBUG_
00038 static int MYDEBUG = 0;
00039 #else
00040 static int MYDEBUG = 0;
00041 #endif
00042 
00043 //----------------------------------------------------------------------
00044 // Function : SALOME_ModuleCatalog_Handler
00045 // Purpose  : Constructor
00046 //----------------------------------------------------------------------
00047 SALOME_ModuleCatalog_Handler::SALOME_ModuleCatalog_Handler(ParserPathPrefixes& pathList,
00048                                                            ParserComponents& moduleList,
00049                                                            ParserTypes& typeMap,
00050                                                            TypeList& typeList):_typeMap(typeMap),_typeList(typeList),
00051                                                                                _pathList(pathList),_moduleList(moduleList)
00052 
00053 {
00054   if(MYDEBUG) BEGIN_OF("SALOME_ModuleCatalog_Handler");
00055 
00056   // XML Tags initialisation
00057   // Used in the function endElement
00058   test_path_prefix_name     = "path-prefix-name";
00059   test_computer_name        = "computer-name" ;
00060   test_computer_list        = "computer-list" ;
00061   test_path_prefix          = "path-prefix" ;
00062   test_path_prefix_list     = "path-prefix-list" ;
00063 
00064   test_component_name       = "component-name";
00065   test_component_username   = "component-username";
00066   test_component_type       = "component-type" ;
00067   test_component_multistudy = "component-multistudy";
00068   test_component_icon       = "component-icone" ;
00069   test_component_impltype   = "component-impltype";
00070   test_component_implname   = "component-implname";
00071   test_component_version    = "component-version";
00072   test_component_comment    = "component-comment";
00073 
00074   test_interface_name       = "component-interface-name" ;
00075   
00076   test_service_name         = "service-name";
00077   test_defaultservice       = "service-by-default";
00078 
00079   test_typeofnode           = "type-of-node";
00080 
00081   test_inParameter_type     = "inParameter-type";
00082   test_inParameter_name     = "inParameter-name";
00083   test_inParameter          = "inParameter";
00084   test_inParameter_list     = "inParameter-list";
00085 
00086   test_outParameter_type    = "outParameter-type";
00087   test_outParameter_name    = "outParameter-name";
00088   test_outParameter         = "outParameter";
00089   test_outParameter_list    = "outParameter-list";
00090 
00091   test_inDataStreamParameter_type = "inParameter-type";
00092   test_inDataStreamParameter_name = "inParameter-name";
00093   test_inDataStreamParameter_dependency = "inParameter-dependency";
00094   test_inDataStreamParameter = "inParameter";
00095   test_inDataStreamParameter_list = "DataStream-list";
00096 
00097   test_outDataStreamParameter_type = "outParameter-type";
00098   test_outDataStreamParameter_name = "outParameter-name";
00099   test_outDataStreamParameter_dependency = "outParameter-dependency";
00100   test_outDataStreamParameter = "outParameter";
00101   test_outDataStreamParameter_list = "DataStream-list";
00102 
00103   test_service =  "component-service";
00104   test_service_list = "component-service-list";
00105   test_interface_list = "component-interface-list";
00106 
00107   test_constraint = "constraint";
00108 
00109   test_component_list = "component-list";
00110   test_component="component";
00111 
00112   if(MYDEBUG) END_OF("SALOME_ModuleCatalog_Handler");
00113 }
00114 
00115 //----------------------------------------------------------------------
00116 // Function : ~SALOME_ModuleCatalog_Handler
00117 // Purpose  : Destructor
00118 //----------------------------------------------------------------------
00119 SALOME_ModuleCatalog_Handler::~SALOME_ModuleCatalog_Handler()
00120 {
00121   if(MYDEBUG) BEGIN_OF("~SALOME_ModuleCatalog_Handler()")
00122   if(MYDEBUG) END_OF("~SALOME_ModuleCatalog_Handler()")
00123 }
00124 
00125 
00126 //=============================================================================
00130 //=============================================================================
00131 
00132 void SALOME_ModuleCatalog_Handler::ProcessXmlDocument(xmlDocPtr theDoc)
00133 {
00134   if(MYDEBUG) MESSAGE("Begin parse document");
00135   // Empty the private elements
00136   _pathList.resize(0);
00137   _pathPrefix.listOfComputer.resize(0);
00138   _serviceList.resize(0);
00139   _interfaceList.resize(0);
00140   _moduleList.resize(0);
00141   _inDataStreamParamList.resize(0);
00142   _outDataStreamParamList.resize(0);
00143   _inParamList.resize(0);
00144   _outParamList.resize(0);
00145 
00146   // Get the document root node
00147   xmlNodePtr aCurNode = xmlDocGetRootElement(theDoc);
00148   aCurNode = aCurNode->xmlChildrenNode;
00149   
00150   // Processing the document nodes
00151   while(aCurNode != NULL)
00152   {
00153     // Part 1: Process path prefix list (tag test_path_prefix_list)
00154     if ( !xmlStrcmp(aCurNode->name,(const xmlChar*)test_path_prefix_list) )
00155     {
00156       xmlNodePtr aCurSubNode = aCurNode->xmlChildrenNode;
00157       while(aCurSubNode != NULL)
00158       {
00159         // Forming a PathPrefix structure (tag test_path_prefix)
00160         if ( xmlStrcmp(aCurSubNode->name, (const xmlChar*)test_path_prefix) ) {
00161           aCurSubNode = aCurSubNode->next;
00162           continue;
00163         }
00164 
00165         xmlNodePtr aCurSubSubNode = aCurSubNode->xmlChildrenNode;
00166         while(aCurSubSubNode != NULL)
00167         {
00168           // Tag test_path_prefix_name
00169           if ( !xmlStrcmp(aCurSubSubNode->name, (const xmlChar*)test_path_prefix_name) ) {
00170             xmlChar* aPath = xmlNodeGetContent(aCurSubSubNode);
00171             if (aPath != NULL) {
00172               _pathPrefix.path = (const char*)aPath;
00173               xmlFree(aPath);
00174             }
00175           }
00176 
00177           // Tag test_computer_list
00178           if ( !xmlStrcmp(aCurSubSubNode->name, (const xmlChar*)test_computer_list) ) {
00179             xmlNodePtr aComputerNode = aCurSubSubNode->xmlChildrenNode;
00180             while (aComputerNode != NULL) {
00181               // Tag test_computer_name
00182               if ( !xmlStrcmp(aComputerNode->name, (const xmlChar*) test_computer_name) ) {
00183                 xmlChar* aCompName = xmlNodeGetContent(aComputerNode);
00184                 if (aCompName != NULL) {
00185                   _pathPrefix.listOfComputer.push_back((const char*)aCompName);
00186                   xmlFree(aCompName);
00187                 }
00188               }
00189 
00190               aComputerNode = aComputerNode->next;
00191             }
00192           }
00193 
00194           aCurSubSubNode = aCurSubSubNode->next;
00195         }
00196 
00197         _pathList.push_back(_pathPrefix);
00198         _pathPrefix.listOfComputer.resize(0);
00199 
00200         aCurSubNode = aCurSubNode->next;
00201       }
00202     }
00203 
00204     //Part 2: Process list of types
00205     if ( !xmlStrcmp(aCurNode->name,(const xmlChar*)"type-list") )
00206       {
00207         xmlNodePtr aTypeNode = aCurNode->xmlChildrenNode;
00208         while (aTypeNode != NULL)
00209           {
00210             //  match "type"
00211             if ( !xmlStrcmp(aTypeNode->name, (const xmlChar*)"type" )) 
00212               {
00213                 // Here is a basic type description
00214                 ParserType aType;
00215                 xmlChar * name=xmlGetProp(aTypeNode,(const xmlChar*)"name");
00216                 if(name)
00217                   {
00218                     aType.name = (const char*)name;
00219                     xmlFree(name);
00220                   }
00221                 xmlChar *kind=xmlGetProp(aTypeNode,(const xmlChar*)"kind");
00222                 if(kind)
00223                   {
00224                     aType.kind = (const char*)kind;
00225                     xmlFree(kind);
00226                   }
00227                 if(aType.kind == "double" ||
00228                    aType.kind == "int"    ||
00229                    aType.kind == "bool"    ||
00230                    aType.kind == "string")
00231                   {
00232                     if ( _typeMap.find(aType.name) == _typeMap.end() )
00233                       {
00234                         MESSAGE("Registered basic type: " << aType.name << " " << aType.kind );
00235                         _typeMap[aType.name]=aType;
00236                         _typeList.push_back(aType);
00237                       }
00238                     else
00239                       std::cerr << "Warning: this type (" << aType.name << "," << aType.kind << ") already exists, it will be ignored."  << std::endl;
00240                   }
00241                 else
00242                   std::cerr << "Warning: this type (" << aType.name << "," << aType.kind << ") has incorrect kind, it will be ignored." << std::endl;
00243               }
00244             else if ( !xmlStrcmp(aTypeNode->name, (const xmlChar*)"sequence" )) 
00245               {
00246                 // Here is a sequence type description
00247                 ParserSequence aType;
00248                 xmlChar * name=xmlGetProp(aTypeNode,(const xmlChar*)"name");
00249                 if(name)
00250                   {
00251                     aType.name = (const char*)name;
00252                     xmlFree(name);
00253                   }
00254                 xmlChar *content=xmlGetProp(aTypeNode,(const xmlChar*)"content");
00255                 if(content)
00256                   {
00257                     aType.content = (const char*)content;
00258                     xmlFree(content);
00259                   }
00260                 if ( _typeMap.find(aType.content) != _typeMap.end() )
00261                   {
00262                     if ( _typeMap.find(aType.name) == _typeMap.end() )
00263                       {
00264                         MESSAGE("Registered sequence type: " << aType.name << " " << aType.content );
00265                         _typeMap[aType.name]=aType;
00266                         _typeList.push_back(aType);
00267                       }
00268                     else
00269                       std::cerr << "Warning: this type (" << aType.name << "," << aType.kind << ") already exists, it will be ignored."  << std::endl;
00270                   }
00271                 else
00272                   {
00273                     std::cerr << "Warning: this sequence type (" << aType.name << "," << aType.content << ") has unknown content type, it will be ignored." << std::endl;
00274                   }
00275               }
00276             else if ( !xmlStrcmp(aTypeNode->name, (const xmlChar*)"objref" )) 
00277               {
00278                 // Here is an objref type description
00279                 ParserObjref aType;
00280                 int error=0;
00281                 xmlChar * name=xmlGetProp(aTypeNode,(const xmlChar*)"name");
00282                 if(name)
00283                   {
00284                     aType.name = (const char*)name;
00285                     xmlFree(name);
00286                   }
00287                 xmlChar *id=xmlGetProp(aTypeNode,(const xmlChar*)"id");
00288                 if(id)
00289                   {
00290                     aType.id = (const char*)id;
00291                     xmlFree(id);
00292                   }
00293 
00294                 xmlNodePtr aTypeSubNode = aTypeNode->xmlChildrenNode;
00295                 while (aTypeSubNode != NULL)
00296                   {
00297                     if ( !xmlStrcmp(aTypeSubNode->name, (const xmlChar*)"base" )) 
00298                       {
00299                         //a base type
00300                         xmlChar* content = xmlNodeGetContent(aTypeSubNode);
00301                         if(content)
00302                           {
00303                             std::string base=(const char*)content;
00304                             xmlFree(content);
00305                             if ( _typeMap.find(base) != _typeMap.end() && _typeMap[base].kind == "objref")
00306                               {
00307                                 aType.bases.push_back(base);
00308                               }
00309                             else
00310                               {
00311                                 std::cerr << "Warning: this objref type (" << aType.name << ") has unknown base type (" << base << "), it will be ignored." << std::endl;
00312                                 error=1;
00313                                 break;
00314                               }
00315                           }
00316                       }
00317                     aTypeSubNode = aTypeSubNode->next;
00318                   }
00319                 if(!error)
00320                   {
00321                     if ( _typeMap.find(aType.name) == _typeMap.end() )
00322                       {
00323                         MESSAGE("Registered objref type: " << aType.name << " " << aType.id );
00324                         _typeMap[aType.name]=aType;
00325                         _typeList.push_back(aType);
00326                       }
00327                     else
00328                       std::cerr << "Warning: this type (" << aType.name << "," << aType.kind << ") already exists, it will be ignored."  << std::endl;
00329                   }
00330               }
00331             else if ( !xmlStrcmp(aTypeNode->name, (const xmlChar*)"struct" )) 
00332               {
00333                 // Here is a struct type description
00334                 ParserStruct aType;
00335                 int error=0;
00336                 xmlChar * name=xmlGetProp(aTypeNode,(const xmlChar*)"name");
00337                 if(name)
00338                   {
00339                     aType.name = (const char*)name;
00340                     xmlFree(name);
00341                   }
00342                 xmlChar *id=xmlGetProp(aTypeNode,(const xmlChar*)"id");
00343                 if(id)
00344                   {
00345                     aType.id = (const char*)id;
00346                     xmlFree(id);
00347                   }
00348 
00349                 xmlNodePtr aTypeSubNode = aTypeNode->xmlChildrenNode;
00350                 while (aTypeSubNode != NULL)
00351                   {
00352                     if ( !xmlStrcmp(aTypeSubNode->name, (const xmlChar*)"member" )) 
00353                       {
00354                         std::pair<std::string,std::string> member;
00355                         xmlChar * m_name=xmlGetProp(aTypeSubNode,(const xmlChar*)"name");
00356                         if(m_name)
00357                           {
00358                             member.first=(const char*)m_name;
00359                             xmlFree(m_name);
00360                           }
00361                         xmlChar * m_type=xmlGetProp(aTypeSubNode,(const xmlChar*)"type");
00362                         if(m_type)
00363                           {
00364                             member.second=(const char*)m_type;
00365                             xmlFree(m_type);
00366                           }
00367                         if ( _typeMap.find(member.second) != _typeMap.end() )
00368                           {
00369                             aType.members.push_back(member);
00370                           }
00371                         else
00372                           {
00373                             std::cerr << "Warning: this struct type (" << aType.name << ") has unknown member type (" << member.first << "," << member.second << "), it will be ignored." << std::endl;
00374                             error=1;
00375                             break;
00376                           }
00377                       }
00378                     aTypeSubNode = aTypeSubNode->next;
00379                   }
00380                 if(!error)
00381                   {
00382                     if ( _typeMap.find(aType.name) == _typeMap.end() )
00383                       {
00384                         MESSAGE("Registered struct type: " << aType.name << " " << aType.id );
00385                         _typeMap[aType.name]=aType;
00386                         _typeList.push_back(aType);
00387                       }
00388                     else
00389                       std::cerr << "Warning: this type (" << aType.name << "," << aType.kind << ") already exists, it will be ignored."  << std::endl;
00390                   }
00391               } // end of struct
00392             aTypeNode = aTypeNode->next;
00393           }
00394       }
00395 
00396     //Part 3: Process list of components (tag test_component_list)
00397     if ( !xmlStrcmp(aCurNode->name,(const xmlChar*)test_component_list) )
00398     {
00399       xmlNodePtr aComponentNode = aCurNode->xmlChildrenNode;
00400       while (aComponentNode != NULL)
00401       {
00402         // Do not process tags differ from test_component here
00403         if ( xmlStrcmp(aComponentNode->name, (const xmlChar*)test_component) ) {
00404           aComponentNode = aComponentNode->next;
00405           continue;
00406         }
00407 
00408         // Component identification
00409 
00410         // Empty temporary structures
00411         _aModule.name = "";
00412         _aModule.constraint = "";
00413         _aModule.icon="";       
00414         _aModule.interfaces.resize(0);
00415         _aModule.implementationType ="";
00416         _aModule.implementationName ="";
00417 
00418         xmlNodePtr aComponentSubNode = aComponentNode->xmlChildrenNode;
00419         while(aComponentSubNode != NULL)
00420         {
00421           xmlChar* aNodeContent = xmlNodeGetContent(aComponentSubNode);
00422 
00423           if (aNodeContent == NULL) {
00424             aComponentSubNode = aComponentSubNode->next;
00425             continue;
00426           }
00427 
00428           std::string aContent = (const char*)aNodeContent;
00429 
00430           // Tag test_component_name
00431           if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_component_name) )
00432             _aModule.name = aContent;
00433 
00434           // Tag test_component_username
00435           if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_component_username) )
00436             _aModule.username = aContent;
00437 
00438           // Tag test_component_type
00439           if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_component_type) ) {
00440             std::string aType = aContent;
00441 
00442             if ((aType.compare("MESH") == 0) ||
00443                 (aType.compare("Mesh") == 0) ||
00444                 (aType.compare("mesh") == 0))
00445               _aModule.type = MESH ;
00446             else if((aType.compare("MED") == 0) ||
00447                     (aType.compare("Med") == 0) ||
00448                     (aType.compare("med") == 0))
00449               _aModule.type = Med ;
00450             else if((aType.compare("GEOM") == 0) ||
00451                     (aType.compare("Geom") == 0) ||
00452                     (aType.compare("geom") == 0))
00453               _aModule.type = GEOM ;
00454             else if((aType.compare("SOLVER") == 0) ||
00455                     (aType.compare("Solver") == 0) ||
00456                     (aType.compare("solver") == 0))
00457               _aModule.type = SOLVER ;
00458             else if((aType.compare("SUPERV") == 0) ||
00459                     (aType.compare("Superv") == 0) ||
00460                     (aType.compare("Supervision") == 0) ||
00461                     (aType.compare("superv") == 0))
00462               _aModule.type = SUPERV ;
00463             else if((aType.compare("DATA") == 0) ||
00464                     (aType.compare("Data") == 0) ||
00465                     (aType.compare("data") == 0))
00466               _aModule.type = DATA ; 
00467             else if((aType.compare("VISU") == 0) ||
00468                     (aType.compare("Visu") == 0) ||
00469                     (aType.compare("visu") == 0))
00470               _aModule.type = VISU ; 
00471             else if((aType.compare("OTHER") == 0) ||
00472                     (aType.compare("Other") == 0) ||
00473                     (aType.compare("other") == 0))                
00474               _aModule.type = OTHER ;
00475             else
00476               // If it'not in all theses cases, the type is affected to OTHER
00477               _aModule.type = OTHER ;
00478           }
00479 
00480           // Tag test_component_multistudy
00481           if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_component_multistudy) )
00482             _aModule.multistudy = atoi( aContent.c_str() ) != 0;
00483 
00484           // Tag test_component_impltype
00485           if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_component_impltype) )
00486             _aModule.implementationType = aContent;
00487 
00488           // Tag test_component_implname
00489           if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_component_implname) )
00490             _aModule.implementationName = aContent;
00491 
00492           // Tag test_component_icon
00493           if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_component_icon) )
00494             _aModule.icon = aContent;
00495 
00496           // Tag test_component_version
00497           if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_component_version) )
00498             _aModule.version = aContent;
00499 
00500           // Tag test_component_comment
00501           if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_component_comment) )
00502             _aModule.comment = aContent;
00503 
00504           // Tag test_constraint
00505           if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_constraint) )
00506             _aModule.constraint = aContent;
00507 
00508           xmlFree(aNodeContent);
00509 
00510           // Process tag test_interface_list:
00511           if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_interface_list) ) {
00512 
00513             // Form an interface list for the component
00514             xmlNodePtr aSubNode = aComponentSubNode->xmlChildrenNode;
00515             while(aSubNode != NULL) {
00516               // Tag test_interface_name
00517               if ( !xmlStrcmp(aSubNode->name, (const xmlChar*)test_interface_name) ) {
00518                 xmlChar* anInterfaceName = xmlNodeGetContent(aSubNode);
00519                 if (anInterfaceName != NULL) {
00520                   _aInterface.name = (const char*)anInterfaceName;
00521                   xmlFree(anInterfaceName);
00522                 }
00523               }
00524 
00525               // Tag test_service_list
00526               if ( !xmlStrcmp(aSubNode->name, (const xmlChar*)test_service_list) ) {
00527                 // Form a service list for the interface
00528                 xmlNodePtr aCompServiceNode = aSubNode->xmlChildrenNode;
00529                 while(aCompServiceNode != NULL) {
00530                   // Tag test_service
00531                   if ( !xmlStrcmp(aCompServiceNode->name, (const xmlChar*)"component-service") ) {
00532                     xmlNodePtr aCompServiceSubNode = aCompServiceNode->xmlChildrenNode;
00533                     while(aCompServiceSubNode != NULL)
00534                     {
00535                       xmlChar* aCompServiceData = xmlNodeGetContent(aCompServiceSubNode);
00536 
00537                       if ( aCompServiceData != NULL)
00538                       {
00539                         // Tag test_service_name
00540                         if ( !xmlStrcmp(aCompServiceSubNode->name, (const xmlChar*)test_service_name) )
00541                           _aService.name = (const char*)aCompServiceData;
00542 
00543                         // Tag test_defaultservice
00544                         if ( !xmlStrcmp(aCompServiceSubNode->name, (const xmlChar*)test_defaultservice) )
00545                           _aService.byDefault = atoi((const char*)aCompServiceData) !=0 ;
00546 
00547                         // Tag test_typeofnode
00548                         if ( !xmlStrcmp(aCompServiceSubNode->name, (const xmlChar*)test_typeofnode) )
00549                           _aService.typeOfNode = atoi((const char*)aCompServiceData) !=0 ;
00550 
00551                         xmlFree(aCompServiceData);
00552                       }
00553 
00554                       // Tag test_inParameter_list
00555                       if ( !xmlStrcmp(aCompServiceSubNode->name, (const xmlChar*)test_inParameter_list) ) {
00556                         xmlNodePtr aParamNode = aCompServiceSubNode->xmlChildrenNode;
00557                         while (aParamNode != NULL)
00558                         {
00559                           // Tag test_inParameter
00560                           if (xmlStrcmp(aParamNode->name, (const xmlChar*)test_inParameter)) {
00561                             aParamNode = aParamNode->next;
00562                             continue;
00563                           }
00564 
00565                           xmlNodePtr aParamItemNode = aParamNode->xmlChildrenNode;
00566                           while (aParamItemNode != NULL)
00567                           {
00568                             xmlChar* aParamData = xmlNodeGetContent(aParamItemNode);
00569 
00570                             if (aParamData != NULL)
00571                             {
00572                               // Tag test_inParameter_name
00573                               if ( !xmlStrcmp(aParamItemNode->name, (const xmlChar*)test_inParameter_name) )
00574                                 _inParam.name = (const char*)aParamData;
00575 
00576                               // Tag test_inParameter_type
00577                               if ( !xmlStrcmp(aParamItemNode->name, (const xmlChar*)test_inParameter_type) )
00578                                 _inParam.type = (const char*)aParamData;
00579 
00580                               xmlFree(aParamData);
00581                             }
00582 
00583                             aParamItemNode = aParamItemNode->next;
00584                           }
00585 
00586                           _inParamList.push_back(_inParam) ; 
00587 
00588                           // Empty temporary structures
00589                           _inParam.type = "";
00590                           _inParam.name = "";
00591 
00592                           aParamNode = aParamNode->next;
00593                         }
00594 
00595                         _aService.inParameters = _inParamList;
00596                         _inParamList.resize(0);
00597                       }
00598 
00599                       // Tag test_outParameter_list
00600                       if ( !xmlStrcmp(aCompServiceSubNode->name, (const xmlChar*)test_outParameter_list) ) {
00601                         xmlNodePtr aParamNode = aCompServiceSubNode->xmlChildrenNode;
00602                         while (aParamNode != NULL)
00603                         {
00604                           // Tag test_outParameter
00605                           if (xmlStrcmp(aParamNode->name, (const xmlChar*)test_outParameter)) {
00606                             aParamNode = aParamNode->next;
00607                             continue;
00608                           }
00609 
00610                           xmlNodePtr aParamItemNode = aParamNode->xmlChildrenNode;
00611                           while (aParamItemNode != NULL)
00612                           {
00613                             xmlChar* anOutParamData = xmlNodeGetContent(aParamItemNode);
00614 
00615                             if (anOutParamData != NULL)
00616                             {
00617                               // Tag test_outParameter_name
00618                               if ( !xmlStrcmp(aParamItemNode->name, (const xmlChar*)test_outParameter_name) )
00619                                 _outParam.name = (const char*)anOutParamData;
00620 
00621                               // Tag test_outParameter_type
00622                               if ( !xmlStrcmp(aParamItemNode->name, (const xmlChar*)test_outParameter_type) )
00623                                 _outParam.type = (const char*)anOutParamData;
00624 
00625                               xmlFree(anOutParamData);
00626                             }
00627 
00628                             aParamItemNode = aParamItemNode->next;
00629                           }
00630 
00631                           _outParamList.push_back(_outParam) ; 
00632 
00633                           // Empty temporary structures
00634                           _outParam.type = "";
00635                           _outParam.name = "";
00636 
00637                           aParamNode = aParamNode->next;
00638                         }
00639 
00640                         _aService.outParameters = _outParamList;
00641                         _outParamList.resize(0);
00642                       }
00643 
00644                       //@ Tag test_inDataStreamParameter_list
00645                       if ( !xmlStrcmp(aCompServiceSubNode->name, (const xmlChar*)test_inDataStreamParameter_list) )
00646                       {
00647                         xmlNodePtr aParamNode = aCompServiceSubNode->xmlChildrenNode;
00648                         while (aParamNode != NULL)
00649                         {
00650                           // Tag test_inDataStreamParameter
00651                           if (xmlStrcmp(aParamNode->name, (const xmlChar*)test_inDataStreamParameter)) {
00652                             aParamNode = aParamNode->next;
00653                             continue;
00654                           }
00655 
00656                           xmlNodePtr aParamItemNode = aParamNode->xmlChildrenNode;
00657                           while (aParamItemNode != NULL)
00658                           {
00659                             xmlChar* inDataStreamParamData = xmlNodeGetContent(aParamItemNode);
00660 
00661                             if (inDataStreamParamData != NULL)
00662                             {
00663                               // Tag test_inDataStreamParameter_name
00664                               if ( !xmlStrcmp(aParamItemNode->name, (const xmlChar*)test_inDataStreamParameter_name) )
00665                                 _inDataStreamParam.name = (const char*)inDataStreamParamData;
00666 
00667                               // Tag test_inDataStreamParameter_type
00668                               if ( !xmlStrcmp(aParamItemNode->name, (const xmlChar*)test_inDataStreamParameter_type) )
00669                                 _inDataStreamParam.type = (const char*)inDataStreamParamData;
00670 
00671                               // Tag test_inDataStreamParameter_dependency
00672                               if ( !xmlStrcmp(aParamItemNode->name, (const xmlChar*)test_inDataStreamParameter_dependency) )
00673                                 _inDataStreamParam.dependency = (const char*)inDataStreamParamData;
00674 
00675                               xmlFree(inDataStreamParamData);
00676                             }
00677 
00678                             aParamItemNode = aParamItemNode->next;
00679                           }
00680 
00681                           _inDataStreamParamList.push_back(_inDataStreamParam) ; 
00682 
00683                           // Empty temporary structures
00684                           _inDataStreamParam.type = "";
00685                           _inDataStreamParam.name = "";
00686                           _inDataStreamParam.dependency = "";
00687 
00688                           aParamNode = aParamNode->next;
00689                         }
00690 
00691                         _aService.inDataStreamParameters = _inDataStreamParamList;
00692                         _inDataStreamParamList.resize(0);
00693                       }
00694 
00695                       // Tag test_outDataStreamParameter_list
00696                       if ( !xmlStrcmp(aCompServiceSubNode->name, (const xmlChar*)test_outDataStreamParameter_list) )
00697                       {
00698                         xmlNodePtr aParamNode = aCompServiceSubNode->xmlChildrenNode;
00699                         while (aParamNode != NULL)
00700                         {
00701                           // Tag test_outDataStreamParameter
00702                           if (xmlStrcmp(aParamNode->name, (const xmlChar*)test_outDataStreamParameter)) {
00703                             aParamNode = aParamNode->next;
00704                             continue;
00705                           }
00706 
00707                           xmlNodePtr aParamItemNode = aParamNode->xmlChildrenNode;
00708                           while (aParamItemNode != NULL)
00709                           {
00710                             xmlChar* outDataStreamParamData = xmlNodeGetContent(aParamItemNode);
00711 
00712                             if (outDataStreamParamData != NULL)
00713                             {
00714                               // Tag test_outDataStreamParameter_name
00715                               if ( !xmlStrcmp(aParamItemNode->name, (const xmlChar*)test_outDataStreamParameter_name) )
00716                                 _outDataStreamParam.name = (const char*)outDataStreamParamData;
00717                               
00718                               // Tag test_outDataStreamParameter_type
00719                               if ( !xmlStrcmp(aParamItemNode->name, (const xmlChar*)test_outDataStreamParameter_type) )
00720                                 _outDataStreamParam.type = (const char*)outDataStreamParamData;
00721                               
00722                               // Tag test_outDataStreamParameter_dependency
00723                               if ( !xmlStrcmp(aParamItemNode->name, (const xmlChar*)test_outDataStreamParameter_dependency) )
00724                                 _outDataStreamParam.dependency = (const char*)outDataStreamParamData;
00725                               
00726                               xmlFree(outDataStreamParamData);
00727                             }
00728 
00729                             aParamItemNode = aParamItemNode->next;
00730                           }
00731                           
00732                           _outDataStreamParamList.push_back(_outDataStreamParam) ; 
00733                           
00734                           // Empty temporary structures
00735                           _outDataStreamParam.type = "";
00736                           _outDataStreamParam.name = "";
00737                           _outDataStreamParam.dependency = "";
00738 
00739                           aParamNode = aParamNode->next;
00740                         }
00741                         
00742                         _aService.outDataStreamParameters = _outDataStreamParamList;
00743                         _outDataStreamParamList.resize(0);
00744                       }
00745                       
00746                       aCompServiceSubNode = aCompServiceSubNode->next;
00747                     }
00748 
00749                     // Put formed service into the list
00750                     _serviceList.push_back(_aService);
00751 
00752                     // Empty temporary structures
00753                     _aService.name = "";
00754                     _aService.typeOfNode = 1;
00755                     _aService.inParameters.resize(0);
00756                     _aService.outParameters.resize(0);
00757                     _aService.inDataStreamParameters.resize(0);
00758                     _aService.outDataStreamParameters.resize(0);
00759                   }
00760                   
00761                   aCompServiceNode = aCompServiceNode->next;
00762                 }
00763                 
00764                 _aInterface.services = _serviceList ;
00765                 
00766                 // Empty temporary structures
00767                 _serviceList.resize(0);
00768                 _interfaceList.push_back(_aInterface);  
00769                 _aInterface.name ="";    
00770                 _aInterface.services.resize(0);
00771               }
00772               
00773               aSubNode = aSubNode->next;
00774             }
00775             
00776             _aModule.interfaces = _interfaceList ;
00777             _interfaceList.resize(0);
00778           }
00779 
00780           aComponentSubNode = aComponentSubNode->next;
00781         }
00782 
00783         _moduleList.push_back(_aModule);
00784 
00785         aComponentNode = aComponentNode->next;
00786       }
00787     }
00788 
00789     aCurNode = aCurNode->next;
00790   }
00791 }