src/GraphExecutor/DataFlowExecutor_DataFlow.hxx

Go to the documentation of this file.
00001 //  SUPERV GraphExecutor : contains classes that permit execution of graphs and particularly the execution automaton
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 //
00023 //
00024 //  File   : DataFlowExecutor_DataFlow.hxx
00025 //  Module : SUPERV
00026 
00027 #ifndef _DATAFLOWEXECUTOR_DATAFLOW_HXX
00028 #define _DATAFLOWEXECUTOR_DATAFLOW_HXX
00029 
00030 #include "DataFlowExecutor_OutNode.hxx"
00031 
00032 namespace GraphExecutor {
00033 
00034   class DataFlow : public GraphExecutor::OutNode {
00035     
00036     private :
00037 
00038       SALOME_NamingService* _theNamingService ;
00039 
00040     public:
00041 
00042       DataFlow();
00043       DataFlow( CORBA::ORB_ptr ORB, SALOME_NamingService* ptrNamingService ,
00044                 const char * DataFlowName ,
00045                 const char * DebugFileName ,
00046                 const SUPERV::KindOfNode aKindOfNode );
00047       DataFlow( CORBA::ORB_ptr ORB, SALOME_NamingService* ptrNamingService ,
00048                 const SALOME_ModuleCatalog::Service& DataFlowService ,
00049                 const char *DataFlowComponentName ,
00050                 const char *DataFlowInterfaceName ,
00051                 const char *DataFlowName ,
00052                 const SUPERV::KindOfNode DataFlowkind = SUPERV::ComputingNode ,
00053                 const SUPERV::SDate DataFlowFirstCreation = SUPERV::SDate() ,
00054                 const SUPERV::SDate DataFlowLastModification = SUPERV::SDate() ,
00055                 const char * DataFlowEditorRelease = NULLSTRING ,
00056                 const char * DataFlowAuthor = NULLSTRING ,
00057                 const char * DataFlowComputer = NULLSTRING ,
00058                 const char * DataFlowComment = NULLSTRING ,
00059                 const char * DebugFileName = NULLSTRING ) ;
00060       virtual ~DataFlow();
00061 
00062       bool LoadDataFlow( const GraphBase::SGraph * aDataFlow ) ;
00063 //      bool LoadXml( const char* myFileName ) ;
00064 
00065       const SALOME_ModuleCatalog::Service * NodeService( const char * NodeName ) ;
00066 
00067       bool AddInputData( const char * ToNodeName ,
00068                          const char * ToParameterName ,
00069                          const CORBA::Any aValue = CORBA::Any() ) ;
00070       bool ChangeInputData( const char * ToNodeName ,
00071                             const char * ToParameterName ,
00072                             const CORBA::Any aValue = CORBA::Any() ) ;
00073 
00074       bool InputOfAny( const char * ToServiceParameterName ,
00075                        const CORBA::Any & aValue ,
00076                        const bool SomeDataReady = true ) ;
00077       bool OutputOfAny( const char * aNodeName ,
00078                         const char * ToServiceParameterName ,
00079                         const CORBA::Any & aValue ) ;
00080       bool SetWaitingStates( const char * ToServiceParameterName ) ;
00081 
00082       bool IsValid() ;
00083       bool IsExecutable() ;
00084 
00085       bool Run( const bool AndSuspend ) ;
00086 
00087       long LastLevelDone() ;
00088 
00089       void State(GraphExecutor::AutomatonState aState ) ;
00090       SUPERV::GraphState State() ;
00091       SUPERV::GraphState State(const char * aNodeName ) ;
00092       SUPERV::GraphState State( const char * aNodeName ,
00093                                  const char * anOutServiceParameterName ) ;
00094 
00095       long Thread() ;
00096       long Thread(const char * aNodeName ) ;
00097 
00098       GraphExecutor::AutomatonState AutomatonState() ;
00099       GraphExecutor::AutomatonState AutomatonState(const char * aNodeName ) ;
00100 
00101       SUPERV::ControlState ControlState() ;
00102       SUPERV::ControlState ControlState(const char * aNodeName ) ;
00103       void ControlClear() ;
00104       void ControlClear(const char * aNodeName ) ;
00105 
00106       bool Event( char ** aNodeName ,
00107                   SUPERV::GraphEvent & anEvent ,
00108                   SUPERV::GraphState & aState ,
00109                   bool WithWait = true ) ;
00110       bool EventW( char ** aNodeName ,
00111                    SUPERV::GraphEvent & anEvent ,
00112                    SUPERV::GraphState & aState ) ;
00113       long EventQSize() ;
00114 
00115       bool IsWaiting() ;
00116       bool IsReady() ;
00117       bool IsRunning() ;
00118       bool IsDone() ;
00119       bool IsSuspended() ;
00120       bool IsWaiting(const char * aNodeName ) ;
00121       bool IsReady(const char * aNodeName ) ;
00122       bool IsRunning(const char * aNodeName ) ;
00123       bool IsDone(const char * aNodeName ) ;
00124       bool IsSuspended(const char * aNodeName ) ;
00125       bool PortDone( const char * aNodeName ,
00126                      const char * anOutServiceParameterName ) ;
00127 
00128 //JR 30.03.2005      const CORBA::Any *GetInData( const char * ToNodeName ,
00129       const CORBA::Any GetInData( const char * ToNodeName ,
00130                                   const char * ToParameterName ) ;
00131 //JR 30.03.2005      const CORBA::Any *GetOutData( const char * FromNodeName ,
00132       const CORBA::Any GetOutData( const char * FromNodeName ,
00133                                    const char * FromParameterName ) ;
00134 
00135       long Threads() ;
00136 
00137       bool ReadyWait() ;
00138       bool RunningWait() ;
00139       bool DoneWait() ;
00140       bool SuspendedWait() ;
00141       bool ReadyWait(const char * aNodeName ) ;
00142       bool RunningWait(const char * aNodeName ) ;
00143       bool DoneWait(const char * aNodeName ) ;
00144       bool SuspendedWait(const char * aNodeName ) ;
00145 
00146       bool Ping(const char * aNodeName ) ;
00147       bool ContainerKill() ;
00148       bool ContainerKill(const char * aNodeName ) ;
00149 
00150       bool Kill() ;
00151       bool Kill(const char * aNodeName ) ;
00152       bool KillDone(const char * aNodeName ) ;
00153       bool Suspend() ;
00154       bool Suspend(const char * aNodeName ) ;
00155       bool SuspendDone() ;
00156       bool SuspendDone(const char * aNodeName ) ;
00157       bool Resume() ;
00158       bool Resume(const char * aNodeName ) ;
00159       bool Stop() ;
00160       bool Stop(const char * aNodeName ) ;
00161 
00162   };
00163 
00164 };
00165 
00166 #include "DataFlowExecutor_DataFlow.lxx"
00167 
00168 ostream & operator << (ostream &,const GraphExecutor::DataFlow & G);
00169 ostream & operator << (ostream &,const SUPERV::SDate &);
00170 
00171 #endif
00172 
00173 
00174