src/GraphBase/DataFlowBase_LoopNode.hxx

Go to the documentation of this file.
00001 //  SUPERV GraphBase : contains fondamental classes for Services, Input Ports, Output Ports Links and Nodes.
00002 //
00003 //  Copyright (C) 2003  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 //  File   : DataFlowBase_LoopNode.hxx
00023 //  Author : Jean Rahuel, CEA
00024 //  Module : SUPERV
00025 
00026 #ifndef _DATAFLOWBASE_LOOPNODE_HXX
00027 #define _DATAFLOWBASE_LOOPNODE_HXX
00028 
00029 #include "DataFlowBase_GOTONode.hxx"
00030 
00031 namespace GraphBase {
00032 
00033   class LoopNode : public GOTONode {
00034 
00035     private:
00036 
00037       char                  * _MoreName ;
00038       SUPERV::ListOfStrings * _MorePythonFunction ;
00039       PyObject              * _MyPyMoreMethod ;
00040       char                  * _NextName ;
00041       SUPERV::ListOfStrings * _NextPythonFunction ;
00042       PyObject              * _MyPyNextMethod ;
00043 
00044     public:
00045 
00046       LoopNode() ;
00047       LoopNode( CORBA::ORB_ptr ORB ,
00048                 SALOME_NamingService* ptrNamingService ,
00049                 const char * InitName ,
00050                 const SUPERV::ListOfStrings & aInitPythonFunction ,
00051                 const char * MoreName ,
00052                 const SUPERV::ListOfStrings & aMorePythonFunction ,
00053                 const char * NextName ,
00054                 const SUPERV::ListOfStrings & aNextPythonFunction ,
00055                 const char *NodeName ,
00056                 const SUPERV::KindOfNode akind ,
00057                 const SUPERV::SDate NodeFirstCreation ,
00058                 const SUPERV::SDate NodeLastModification ,
00059                 const char * NodeEditorRelease ,
00060                 const char * NodeAuthor ,
00061                 const char * NodeComment ,
00062                 const bool   GeneratedName ,
00063                 const long   X ,
00064                 const long   Y ,
00065                 int * Graph_prof_debug = NULL ,
00066                 ofstream * Graph_fdebug = NULL ) ;
00067       virtual ~LoopNode() ;
00068 
00069       void SetMorePythonFunction( const char * MoreName ,
00070                                   const SUPERV::ListOfStrings & aMorePythonFunction ) {
00071            _MoreName = my_strblkdup( MoreName ) ;
00072            cdebug << "GraphBase::LoopNode::SetMorePythonFunction MoreName '" << MoreName << "' --> '"
00073                   << _MoreName << "'" << endl ;
00074            _MorePythonFunction = new SUPERV::ListOfStrings( aMorePythonFunction ) ; } ;
00075 
00076       SUPERV::ListOfStrings * MorePythonFunction() const {
00077               SUPERV::ListOfStrings * aMorePythonFunction ;
00078               aMorePythonFunction = new SUPERV::ListOfStrings( *_MorePythonFunction ) ;
00079               return aMorePythonFunction ; } ;
00080 
00081       char * PyMoreName() {
00082 //JR 17.02.2005 Memory Leak             return my_strdup( _MoreName ) ; } ;
00083              return _MoreName ; } ;
00084 
00085       void PyMoreMethod( PyObject * MyPyMoreMethod ) {
00086            _MyPyMoreMethod = MyPyMoreMethod ; } ;
00087 
00088       PyObject * PyMoreMethod() {
00089         return _MyPyMoreMethod ; } ;
00090 
00091       void SetNextPythonFunction( const char * NextName ,
00092                                   const SUPERV::ListOfStrings & aNextPythonFunction ) {
00093            _NextName = my_strblkdup( NextName ) ;
00094            cdebug << "GraphBase::LoopNode::SetNextPythonFunction NextName '" << NextName << "' --> '"
00095                   << _NextName << "'" << endl ;
00096            _NextPythonFunction = new SUPERV::ListOfStrings( aNextPythonFunction ) ; } ;
00097 
00098       SUPERV::ListOfStrings * NextPythonFunction() const {
00099               SUPERV::ListOfStrings * aNextPythonFunction ;
00100               aNextPythonFunction = new SUPERV::ListOfStrings( *_NextPythonFunction ) ;
00101               return aNextPythonFunction ; } ;
00102 
00103       char * PyNextName() {
00104 //JR 17.02.2005 Memory Leak             return my_strdup( _NextName ) ; } ;
00105              return _NextName ; } ;
00106       void PyNextMethod( PyObject * MyPyNextMethod ) {
00107            _MyPyNextMethod = MyPyNextMethod ; } ;
00108 
00109       PyObject * PyNextMethod() {
00110         return _MyPyNextMethod ; } ;
00111 
00112 //      bool SaveXML(ostream &f , char *Tabs , int X , int Y ) ;
00113       bool SaveXML(QDomDocument & Graph , QDomElement & info , int X , int Y ) ;
00114 
00115       bool SavePY(ostream &f , const char * aGraphName , int X , int Y ) ;
00116 
00117   };
00118   
00119 };
00120 
00121 #endif