Salome HOME
MPV: Merge V1_2d
[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              return my_strdup( _MoreName ) ; } ;
69
70       void PyMoreMethod( PyObject * MyPyMoreMethod ) {
71            _MyPyMoreMethod = MyPyMoreMethod ; } ;
72
73       PyObject * PyMoreMethod() {
74         return _MyPyMoreMethod ; } ;
75
76       void SetNextPythonFunction( const char * NextName ,
77                                   const SUPERV::ListOfStrings & aNextPythonFunction ) {
78            _NextName = my_strblkdup( NextName ) ;
79            cdebug << "GraphBase::LoopNode::SetNextPythonFunction NextName '" << NextName << "' --> '"
80                   << _NextName << "'" << endl ;
81            _NextPythonFunction = new SUPERV::ListOfStrings( aNextPythonFunction ) ; } ;
82
83       SUPERV::ListOfStrings * NextPythonFunction() const {
84               SUPERV::ListOfStrings * aNextPythonFunction ;
85               aNextPythonFunction = new SUPERV::ListOfStrings( *_NextPythonFunction ) ;
86               return aNextPythonFunction ; } ;
87
88       char * PyNextName() {
89              return my_strdup( _NextName ) ; } ;
90       void PyNextMethod( PyObject * MyPyNextMethod ) {
91            _MyPyNextMethod = MyPyNextMethod ; } ;
92
93       PyObject * PyNextMethod() {
94         return _MyPyNextMethod ; } ;
95
96 //      bool SaveXML(ostream &f , char *Tabs , int X , int Y ) ;
97       bool SaveXML(QDomDocument & Graph , QDomElement & info , int X , int Y ) ;
98
99       bool SavePY(ostream &f , const char * aGraphName , int X , int Y ) ;
100
101   };
102   
103 };
104
105 #endif