Salome HOME
SMH: 3.0.0 preparation = merged version (POLYWORK + RTVDEBUG01) + adopation for new GUI
[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  CEA/DEN, EDF R&D
4 //
5 //
6 //
7 //  File   : DataFlowBase_LoopNode.hxx
8 //  Author : Jean Rahuel, CEA
9 //  Module : SUPERV
10 //  $Header:
11
12 #ifndef _DATAFLOWBASE_LOOPNODE_HXX
13 #define _DATAFLOWBASE_LOOPNODE_HXX
14
15 #include "DataFlowBase_GOTONode.hxx"
16
17 namespace GraphBase {
18
19   class LoopNode : public GOTONode {
20
21     private:
22
23       char                  * _MoreName ;
24       SUPERV::ListOfStrings * _MorePythonFunction ;
25       PyObject              * _MyPyMoreMethod ;
26       char                  * _NextName ;
27       SUPERV::ListOfStrings * _NextPythonFunction ;
28       PyObject              * _MyPyNextMethod ;
29
30     public:
31
32       LoopNode() ;
33       LoopNode( CORBA::ORB_ptr ORB ,
34                 SALOME_NamingService* ptrNamingService ,
35                 const char * InitName ,
36                 const SUPERV::ListOfStrings & aInitPythonFunction ,
37                 const char * MoreName ,
38                 const SUPERV::ListOfStrings & aMorePythonFunction ,
39                 const char * NextName ,
40                 const SUPERV::ListOfStrings & aNextPythonFunction ,
41                 const char *NodeName ,
42                 const SUPERV::KindOfNode akind ,
43                 const SUPERV::SDate NodeFirstCreation ,
44                 const SUPERV::SDate NodeLastModification ,
45                 const char * NodeEditorRelease ,
46                 const char * NodeAuthor ,
47                 const char * NodeComment ,
48                 const bool   GeneratedName ,
49                 const long   X ,
50                 const long   Y ,
51                 int * Graph_prof_debug = NULL ,
52                 ofstream * Graph_fdebug = NULL ) ;
53       virtual ~LoopNode() ;
54
55       void SetMorePythonFunction( const char * MoreName ,
56                                   const SUPERV::ListOfStrings & aMorePythonFunction ) {
57            _MoreName = my_strblkdup( MoreName ) ;
58            cdebug << "GraphBase::LoopNode::SetMorePythonFunction MoreName '" << MoreName << "' --> '"
59                   << _MoreName << "'" << endl ;
60            _MorePythonFunction = new SUPERV::ListOfStrings( aMorePythonFunction ) ; } ;
61
62       SUPERV::ListOfStrings * MorePythonFunction() const {
63               SUPERV::ListOfStrings * aMorePythonFunction ;
64               aMorePythonFunction = new SUPERV::ListOfStrings( *_MorePythonFunction ) ;
65               return aMorePythonFunction ; } ;
66
67       char * PyMoreName() {
68 //JR 17.02.2005 Memory Leak             return my_strdup( _MoreName ) ; } ;
69              return _MoreName ; } ;
70
71       void PyMoreMethod( PyObject * MyPyMoreMethod ) {
72            _MyPyMoreMethod = MyPyMoreMethod ; } ;
73
74       PyObject * PyMoreMethod() {
75         return _MyPyMoreMethod ; } ;
76
77       void SetNextPythonFunction( const char * NextName ,
78                                   const SUPERV::ListOfStrings & aNextPythonFunction ) {
79            _NextName = my_strblkdup( NextName ) ;
80            cdebug << "GraphBase::LoopNode::SetNextPythonFunction NextName '" << NextName << "' --> '"
81                   << _NextName << "'" << endl ;
82            _NextPythonFunction = new SUPERV::ListOfStrings( aNextPythonFunction ) ; } ;
83
84       SUPERV::ListOfStrings * NextPythonFunction() const {
85               SUPERV::ListOfStrings * aNextPythonFunction ;
86               aNextPythonFunction = new SUPERV::ListOfStrings( *_NextPythonFunction ) ;
87               return aNextPythonFunction ; } ;
88
89       char * PyNextName() {
90 //JR 17.02.2005 Memory Leak             return my_strdup( _NextName ) ; } ;
91              return _NextName ; } ;
92       void PyNextMethod( PyObject * MyPyNextMethod ) {
93            _MyPyNextMethod = MyPyNextMethod ; } ;
94
95       PyObject * PyNextMethod() {
96         return _MyPyNextMethod ; } ;
97
98 //      bool SaveXML(ostream &f , char *Tabs , int X , int Y ) ;
99       bool SaveXML(QDomDocument & Graph , QDomElement & info , int X , int Y ) ;
100
101       bool SavePY(ostream &f , const char * aGraphName , int X , int Y ) ;
102
103   };
104   
105 };
106
107 #endif