Salome HOME
5a5c689bfbe2e3de2e7bd697e934867268fe65e7
[modules/superv.git] / src / GraphBase / DataFlowBase_LoopNode.hxx
1 //  SUPERV GraphBase : contains fondamental classes for Services, Input Ports, Output Ports Links and Nodes.
2 //
3 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
5 // 
6 //  This library is free software; you can redistribute it and/or 
7 //  modify it under the terms of the GNU Lesser General Public 
8 //  License as published by the Free Software Foundation; either 
9 //  version 2.1 of the License. 
10 // 
11 //  This library is distributed in the hope that it will be useful, 
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of 
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
14 //  Lesser General Public License for more details. 
15 // 
16 //  You should have received a copy of the GNU Lesser General Public 
17 //  License along with this library; if not, write to the Free Software 
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
19 // 
20 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 //  File   : DataFlowBase_LoopNode.hxx
23 //  Author : Jean Rahuel, CEA
24 //  Module : SUPERV
25
26 #ifndef _DATAFLOWBASE_LOOPNODE_HXX
27 #define _DATAFLOWBASE_LOOPNODE_HXX
28
29 #include "DataFlowBase_GOTONode.hxx"
30
31 namespace GraphBase {
32
33   class LoopNode : public GOTONode {
34
35     private:
36
37       char                  * _MoreName ;
38       SUPERV::ListOfStrings * _MorePythonFunction ;
39       PyObject              * _MyPyMoreMethod ;
40       char                  * _NextName ;
41       SUPERV::ListOfStrings * _NextPythonFunction ;
42       PyObject              * _MyPyNextMethod ;
43
44     public:
45
46       LoopNode() ;
47       LoopNode( CORBA::ORB_ptr ORB ,
48                 SALOME_NamingService* ptrNamingService ,
49                 const char * InitName ,
50                 const SUPERV::ListOfStrings & aInitPythonFunction ,
51                 const char * MoreName ,
52                 const SUPERV::ListOfStrings & aMorePythonFunction ,
53                 const char * NextName ,
54                 const SUPERV::ListOfStrings & aNextPythonFunction ,
55                 const char *NodeName ,
56                 const SUPERV::KindOfNode akind ,
57                 const SUPERV::SDate NodeFirstCreation ,
58                 const SUPERV::SDate NodeLastModification ,
59                 const char * NodeEditorRelease ,
60                 const char * NodeAuthor ,
61                 const char * NodeComment ,
62                 const bool   GeneratedName ,
63                 const long   X ,
64                 const long   Y ,
65                 int * Graph_prof_debug = NULL ,
66                 ofstream * Graph_fdebug = NULL ) ;
67       virtual ~LoopNode() ;
68
69       void SetMorePythonFunction( const char * MoreName ,
70                                   const SUPERV::ListOfStrings & aMorePythonFunction ) {
71            _MoreName = my_strblkdup( MoreName ) ;
72            cdebug << "GraphBase::LoopNode::SetMorePythonFunction MoreName '" << MoreName << "' --> '"
73                   << _MoreName << "'" << endl ;
74            _MorePythonFunction = new SUPERV::ListOfStrings( aMorePythonFunction ) ; } ;
75
76       SUPERV::ListOfStrings * MorePythonFunction() const {
77               SUPERV::ListOfStrings * aMorePythonFunction ;
78               aMorePythonFunction = new SUPERV::ListOfStrings( *_MorePythonFunction ) ;
79               return aMorePythonFunction ; } ;
80
81       char * PyMoreName() {
82 //JR 17.02.2005 Memory Leak             return my_strdup( _MoreName ) ; } ;
83              return _MoreName ; } ;
84
85       void PyMoreMethod( PyObject * MyPyMoreMethod ) {
86            _MyPyMoreMethod = MyPyMoreMethod ; } ;
87
88       PyObject * PyMoreMethod() {
89         return _MyPyMoreMethod ; } ;
90
91       void SetNextPythonFunction( const char * NextName ,
92                                   const SUPERV::ListOfStrings & aNextPythonFunction ) {
93            _NextName = my_strblkdup( NextName ) ;
94            cdebug << "GraphBase::LoopNode::SetNextPythonFunction NextName '" << NextName << "' --> '"
95                   << _NextName << "'" << endl ;
96            _NextPythonFunction = new SUPERV::ListOfStrings( aNextPythonFunction ) ; } ;
97
98       SUPERV::ListOfStrings * NextPythonFunction() const {
99               SUPERV::ListOfStrings * aNextPythonFunction ;
100               aNextPythonFunction = new SUPERV::ListOfStrings( *_NextPythonFunction ) ;
101               return aNextPythonFunction ; } ;
102
103       char * PyNextName() {
104 //JR 17.02.2005 Memory Leak             return my_strdup( _NextName ) ; } ;
105              return _NextName ; } ;
106       void PyNextMethod( PyObject * MyPyNextMethod ) {
107            _MyPyNextMethod = MyPyNextMethod ; } ;
108
109       PyObject * PyNextMethod() {
110         return _MyPyNextMethod ; } ;
111
112 //      bool SaveXML(ostream &f , char *Tabs , int X , int Y ) ;
113       bool SaveXML(QDomDocument & Graph , QDomElement & info , int X , int Y ) ;
114
115       bool SavePY(ostream &f , const char * aGraphName , int X , int Y ) ;
116
117   };
118   
119 };
120
121 #endif