X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2Fyacsloader%2FcontainerParsers.cxx;h=cf1dc6e644238ab2a1a21449728a0f30c32ed9ae;hb=af2d4706216fd0e87cbdd6ca900c3f2b407ca2c4;hp=b5a0879bf729a41814b23c79e04c68421f40f008;hpb=b797825313f7af9fd691d137c7c6df4950e7de2c;p=modules%2Fyacs.git diff --git a/src/yacsloader/containerParsers.cxx b/src/yacsloader/containerParsers.cxx old mode 100755 new mode 100644 index b5a0879bf..cf1dc6e64 --- a/src/yacsloader/containerParsers.cxx +++ b/src/yacsloader/containerParsers.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2006-2014 CEA/DEN, EDF R&D +// Copyright (C) 2006-2019 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -19,6 +19,7 @@ #include "containerParsers.hxx" #include "propertyParsers.hxx" +#include "HomogeneousPoolContainer.hxx" //#define _DEVDEBUG_ #include "YacsTrace.hxx" @@ -31,6 +32,8 @@ namespace YACS void machinetypeParser::buildAttr(const XML_Char** attr) { + if (!attr) + return; required("name",attr); for (int i = 0; attr[i]; i += 2) { @@ -46,6 +49,8 @@ namespace YACS void containertypeParser::buildAttr(const XML_Char** attr) { + if (!attr) + return; required("name",attr); for (int i = 0; attr[i]; i += 2) { @@ -58,6 +63,7 @@ namespace YACS parser* pp=&parser::main_parser; if(element == "machine")pp=&machinetypeParser::machineParser; if(element == "property")pp=&propertytypeParser::propertyParser; + if(element == "initializescriptkey")pp=&codetypeParser::codeParser; SetUserDataAndPush(pp); pp->init(); pp->pre(); @@ -68,6 +74,7 @@ namespace YACS std::string element(el); if(element == "machine")machine_(((machinetypeParser*)child)->post()); if(element == "property")property(((propertytypeParser*)child)->post()); + if(element == "initializescriptkey")initializescriptkey(((codetypeParser*)child)->post()); } void containertypeParser::pre () { @@ -85,6 +92,11 @@ namespace YACS DEBTRACE( "property_set: " << prop._name << " " << prop._value ); _container._props[prop._name]=prop._value; } + void containertypeParser::initializescriptkey(const myfunc& f) + { + _container._props[YACS::ENGINE::HomogeneousPoolContainer::INITIALIZE_SCRIPT_KEY]=f._code; + } + mycontainer containertypeParser::post() { //mincount("machine",1); @@ -93,6 +105,8 @@ namespace YACS void loadtypeParser::buildAttr(const XML_Char** attr) { + if (!attr) + return; required("container",attr); for (int i = 0; attr[i]; i += 2) {