Salome HOME
Update copyright information
[modules/superv.git] / src / GraphBase / DataFlowBase_LoopNode.hxx
1 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  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 //  SUPERV GraphBase : contains fondamental classes for Services, Input Ports, Output Ports Links and Nodes.
23 //  File   : DataFlowBase_LoopNode.hxx
24 //  Author : Jean Rahuel, CEA
25 //  Module : SUPERV
26 //
27 #ifndef _DATAFLOWBASE_LOOPNODE_HXX
28 #define _DATAFLOWBASE_LOOPNODE_HXX
29
30 #include "DataFlowBase_GOTONode.hxx"
31
32 namespace GraphBase {
33
34   class LoopNode : public GOTONode {
35
36     private:
37
38       char                  * _MoreName ;
39       SUPERV::ListOfStrings * _MorePythonFunction ;
40       PyObject              * _MyPyMoreMethod ;
41       char                  * _NextName ;
42       SUPERV::ListOfStrings * _NextPythonFunction ;
43       PyObject              * _MyPyNextMethod ;
44
45     public:
46
47       LoopNode() ;
48       LoopNode( CORBA::ORB_ptr ORB ,
49                 SALOME_NamingService* ptrNamingService ,
50                 const char * InitName ,
51                 const SUPERV::ListOfStrings & aInitPythonFunction ,
52                 const char * MoreName ,
53                 const SUPERV::ListOfStrings & aMorePythonFunction ,
54                 const char * NextName ,
55                 const SUPERV::ListOfStrings & aNextPythonFunction ,
56                 const char *NodeName ,
57                 const SUPERV::KindOfNode akind ,
58                 const SUPERV::SDate NodeFirstCreation ,
59                 const SUPERV::SDate NodeLastModification ,
60                 const char * NodeEditorRelease ,
61                 const char * NodeAuthor ,
62                 const char * NodeComment ,
63                 const bool   GeneratedName ,
64                 const long   X ,
65                 const long   Y ,
66                 int * Graph_prof_debug = NULL ,
67                 ofstream * Graph_fdebug = NULL ) ;
68       virtual ~LoopNode() ;
69
70       void SetMorePythonFunction( const char * MoreName ,
71                                   const SUPERV::ListOfStrings & aMorePythonFunction ) {
72            _MoreName = my_strblkdup( MoreName ) ;
73            cdebug << "GraphBase::LoopNode::SetMorePythonFunction MoreName '" << MoreName << "' --> '"
74                   << _MoreName << "'" << endl ;
75            _MorePythonFunction = new SUPERV::ListOfStrings( aMorePythonFunction ) ; } ;
76
77       SUPERV::ListOfStrings * MorePythonFunction() const {
78               SUPERV::ListOfStrings * aMorePythonFunction ;
79               aMorePythonFunction = new SUPERV::ListOfStrings( *_MorePythonFunction ) ;
80               return aMorePythonFunction ; } ;
81
82       char * PyMoreName() {
83 //JR 17.02.2005 Memory Leak             return my_strdup( _MoreName ) ; } ;
84              return _MoreName ; } ;
85
86       void PyMoreMethod( PyObject * MyPyMoreMethod ) {
87            _MyPyMoreMethod = MyPyMoreMethod ; } ;
88
89       PyObject * PyMoreMethod() {
90         return _MyPyMoreMethod ; } ;
91
92       void SetNextPythonFunction( const char * NextName ,
93                                   const SUPERV::ListOfStrings & aNextPythonFunction ) {
94            _NextName = my_strblkdup( NextName ) ;
95            cdebug << "GraphBase::LoopNode::SetNextPythonFunction NextName '" << NextName << "' --> '"
96                   << _NextName << "'" << endl ;
97            _NextPythonFunction = new SUPERV::ListOfStrings( aNextPythonFunction ) ; } ;
98
99       SUPERV::ListOfStrings * NextPythonFunction() const {
100               SUPERV::ListOfStrings * aNextPythonFunction ;
101               aNextPythonFunction = new SUPERV::ListOfStrings( *_NextPythonFunction ) ;
102               return aNextPythonFunction ; } ;
103
104       char * PyNextName() {
105 //JR 17.02.2005 Memory Leak             return my_strdup( _NextName ) ; } ;
106              return _NextName ; } ;
107       void PyNextMethod( PyObject * MyPyNextMethod ) {
108            _MyPyNextMethod = MyPyNextMethod ; } ;
109
110       PyObject * PyNextMethod() {
111         return _MyPyNextMethod ; } ;
112
113 //      bool SaveXML(ostream &f , char *Tabs , int X , int Y ) ;
114       bool SaveXML(QDomDocument & Graph , QDomElement & info , int X , int Y ) ;
115
116       bool SavePY(ostream &f , const char * aGraphName , int X , int Y ) ;
117
118   };
119   
120 };
121
122 #endif