X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2Fyacsloader%2FLoadState.hxx;h=6102e0b3f72407f3fc770a1919f019da7cf17c81;hb=e3255204c864201f5bc1aa040d4273ed2f44e8cd;hp=98b9075f25a140d8cc927e29ccaf10f13db688f6;hpb=f3b2b68ffecc5033287a7a255c8507f8989fb87f;p=modules%2Fyacs.git diff --git a/src/yacsloader/LoadState.hxx b/src/yacsloader/LoadState.hxx index 98b9075f2..6102e0b3f 100644 --- a/src/yacsloader/LoadState.hxx +++ b/src/yacsloader/LoadState.hxx @@ -1,9 +1,9 @@ -// Copyright (C) 2006-2013 CEA/DEN, EDF R&D +// Copyright (C) 2006-2016 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 // License as published by the Free Software Foundation; either -// version 2.1 of the License. +// version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -22,9 +22,12 @@ #include "YACSloaderExport.hxx" #include "xmlParserBase.hxx" +#include "InputPort.hxx" #include "define.hxx" #include "Exception.hxx" +#include +#include namespace YACS { @@ -32,6 +35,9 @@ namespace YACS { class Proc; class Runtime; + class SequenceAny; + class Any; + class TypeCode; //! Load state from a file into a Proc /*! @@ -105,14 +111,18 @@ namespace YACS }; + class loopPortParser; class YACSLOADER_EXPORT nodeParser: public stateParser { public: virtual void init(const xmlChar** p, xmlParserBase* father=0); virtual void onStart (const XML_Char* elem, const xmlChar** p); virtual void onEnd (const XML_Char* name); + Any* xmlToAny(const std::string& data, const TypeCode* tc)const; std::string _nodeName; std::string _nodeState; + private: + std::list _loopSamples; }; class YACSLOADER_EXPORT attrParser: public stateParser @@ -172,6 +182,37 @@ namespace YACS virtual void charData(std::string data); }; + class YACSLOADER_EXPORT loopPortParser: public stateParser + { + public: + virtual void init(const xmlChar** p, xmlParserBase* father=0); + virtual void onStart (const XML_Char* elem, const xmlChar** p); + virtual void onEnd (const XML_Char* name); + virtual void charData(std::string data); + void addSample(int index, const std::string data); + unsigned int getNbSamples()const; + unsigned int getSampleId(unsigned int i)const; + const std::string& getSampleData(unsigned int i)const; + const std::string& getPortName()const; + private: + std::vector _ids; + std::vector _sampleData; + }; + + class YACSLOADER_EXPORT sampleParser: public stateParser + { + public: + sampleParser(loopPortParser* father); + virtual void init(const xmlChar** p, xmlParserBase* father=0); + virtual void onStart (const XML_Char* elem, const xmlChar** p); + virtual void onEnd (const XML_Char* name); + virtual void charData(std::string data); + //protected: + // Any* xmlToAny()throw(ConversionException); + private: + loopPortParser* _sampleFather; + }; + } } #endif