X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2Fengine%2FProc.hxx;h=de0970fc0b262c85b119e7cf1ec9a3588f58bcdc;hb=52a75f12fdde977172b39325b7acc98370b48473;hp=77518b8dec0d48d5a351a4aca36f6162ba1f2fbb;hpb=a84e60a749da66dffb73297fa5082b70b9d62f7d;p=modules%2Fyacs.git diff --git a/src/engine/Proc.hxx b/src/engine/Proc.hxx index 77518b8de..de0970fc0 100644 --- a/src/engine/Proc.hxx +++ b/src/engine/Proc.hxx @@ -1,10 +1,32 @@ +// 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 +// License as published by the Free Software Foundation; either +// 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 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + #ifndef _PROC_HXX_ #define _PROC_HXX_ +#include "YACSlibEngineExport.hxx" #include "Bloc.hxx" + #include #include #include +#include namespace YACS { @@ -15,8 +37,10 @@ namespace YACS class InlineNode; class ServiceNode; class Container; + class ComponentInstance; + class Logger; - class Proc: public Bloc + class YACSLIBENGINE_EXPORT Proc : public Bloc { public: Proc(const std::string& name); @@ -27,24 +51,62 @@ namespace YACS virtual TypeCode *createSequenceTc (const std::string& id, const std::string& name, TypeCode *content); virtual TypeCode *createStructTc (const std::string& id, const std::string& name); - virtual TypeCode* getTypeCode(const std::string& name); + virtual TypeCode *getTypeCode(const std::string& name); virtual void setTypeCode(const std::string& name,TypeCode *t); + virtual Container *createContainer(const std::string& name, const std::string& kind=""); + virtual ComponentInstance *createComponentInstance(const std::string& componame, + const std::string& name="", + const std::string& kind=""); + virtual void addComponentInstance(ComponentInstance* inst, const std::string& name="",bool resetCtr=false); + virtual void removeComponentInstance(ComponentInstance* inst); + virtual void removeContainer(Container* cont); virtual void accept(Visitor *visitor); + virtual Proc *getProc(); + virtual const Proc *getProc() const; + virtual void updateContainersAndComponents(); YACS::StatesForNode getNodeState(int numId); + std::string getNodeProgress(int numId); + int getGlobalProgressPercent(); + std::string getInPortValue(int nodeNumId, std::string portName); + std::string setInPortValue(std::string nodeName, std::string portName, std::string value); + std::string getOutPortValue(int nodeNumId, std::string portName); + std::string getNodeErrorDetails(int nodeNumId); + std::string getNodeErrorReport(int nodeNumId); + std::string getNodeContainerLog(int nodeNumId); std::string getXMLState(int numId); std::list getNumIds(); std::list getIds(); + virtual Logger *getLogger(const std::string& name); - virtual void writeDot(std::ostream &os); + virtual void writeDot(std::ostream &os) const; void setName(const std::string& name); // Used by GUI to display graph name + virtual std::string typeName() {return "YACS__ENGINE__Proc";} + friend std::ostream & operator<< ( std::ostream &os, const Proc& p); std::map nodeMap; std::map serviceMap; std::map inlineMap; std::map typeMap; std::map containerMap; + std::map componentInstanceMap; std::vector names; + + typedef std::map LoggerMap; + LoggerMap _loggers; + virtual bool getEdition(){return _edition;} + virtual void setEdition(bool edition); + virtual void modified(); + virtual void saveSchema(const std::string& xmlSchemaFile); + //! deprecated. See VisitorSalomeSaveState and schemaSaveState in order + //! to deal with the execution state of ForEachLoop. + virtual void saveState(const std::string& xmlStateFile); + protected: + void removeContainers(); + protected: + bool _edition; + int _compoinstctr; + }; } }