Salome HOME
Update copyright information
[modules/superv.git] / src / GraphBase / DataFlowBase_Port.cxx
index e0395bc13cf9c72f1fb35653c4fc0a4a4751a044..bab5686ca5a0fdecb03ff3e45d8ff91b65b8aace 100644 (file)
@@ -1,12 +1,30 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  SUPERV GraphBase : contains fondamental classes for Services, Input Ports, Output Ports Links and Nodes.
+//  File   : DataFlowBase_Port.cxx
+//  Author : Jean Rahuel, CEA
+//  Module : SUPERV
+//
 using namespace std;
-//=============================================================================
-// File      : DataFlowBase_Port.cxx
-// Created   : 2002
-// Author    : Jean Rahuel, CEA
-// Project   : SALOME
-// $Header:
-//=============================================================================
-
 #include "DataFlowBase_Port.hxx"
 
 //GraphBase::Port::~Port() {
@@ -36,7 +54,7 @@ bool GraphBase::Port::AddCoord( const int index ,
     return false ;
   }
   else {
-    if ( index <= 0 || index > _X.size()+1 )
+    if ( index <= 0 || index > (int ) _X.size()+1 )
       return false ;
     _X.resize( _X.size()+1 ) ;
     _Y.resize( _Y.size()+1 ) ;
@@ -63,7 +81,7 @@ bool GraphBase::Port::ChangeCoord( const int index ,
     return false ;
   }
   else {
-    if ( index <= 0 || index > _X.size() )
+    if ( index <= 0 || index > (int ) _X.size() )
       return false ;
     _X[ index - 1 ] = x ;
     _Y[ index - 1 ] = y ;
@@ -82,10 +100,10 @@ bool GraphBase::Port::RemoveCoord( const int index ) {
     return false ;
   }
   else {
-    if ( index <= 0 || index > _X.size() )
+    if ( index <= 0 || index > (int ) _X.size() )
       return false ;
     int i ;
-    for ( i = index - 1 ; i < _X.size() - 1 ; i++ ) {
+    for ( i = index - 1 ; i < (int ) _X.size() - 1 ; i++ ) {
       _X[ i ] = _X[ i+1 ] ;
       _Y[ i ] = _Y[ i+1 ] ;
     }
@@ -123,7 +141,7 @@ bool GraphBase::Port::GetCoord( int *x , int *y ) const {
     return false ;
   }
   else {
-    for ( i = 0 ; i < _X.size() ; i++ ) {
+    for ( i = 0 ; i < (int ) _X.size() ; i++ ) {
       x[ i ] = _X[ i ] ;
       y[ i ] = _Y[ i ] ;
     }
@@ -136,7 +154,7 @@ const GraphBase::ListOfCoords * GraphBase::Port::Coords() const {
   int i ;
   if ( !IsEndSwitch() ) {
     _list_Coords->resize( _X.size() );
-    for ( i = 0 ; i < _X.size() ; i++ ) {
+    for ( i = 0 ; i < (int ) _X.size() ; i++ ) {
       (*_list_Coords)[ i ].theX = _X[ i ] ;
       (*_list_Coords)[ i ].theY = _Y[ i ] ;
     }
@@ -144,12 +162,12 @@ const GraphBase::ListOfCoords * GraphBase::Port::Coords() const {
   return _list_Coords ;
 }
 
-bool GraphBase::Port::GetCoord( const int index , long &x , long &y ) const {
+bool GraphBase::Port::GetCoord( const int index , CORBA::Long &x , CORBA::Long &y ) const {
   if ( IsEndSwitch() ) {
     return false ;
   }
   else {
-    if ( index <= 0 || index > _X.size() )
+    if ( index <= 0 || index > (int ) _X.size() )
       return false ;
     x = _X[ index - 1 ] ;
     y = _Y[ index - 1 ] ;
@@ -165,24 +183,33 @@ bool GraphBase::Port::GetCoord( const int index , long &x , long &y ) const {
 
 ostream & operator<< (ostream & f ,const SUPERV::KindOfPort & s ) {
   switch (s) {
+  case SUPERV::UndefinedParameter :
+    f << "UndefinedParameter";
+    break;
   case SUPERV::ServiceParameter :
     f << "ServiceParameter";
     break;
   case SUPERV::GateParameter :
     f << "GateParameter";
     break;
-  case SUPERV::LoopParameter :
-    f << "LoopParameter";
-    break;
   case SUPERV::InLineParameter :
     f << "InLineParameter";
     break;
+  case SUPERV::LoopParameter :
+    f << "LoopParameter";
+    break;
   case SUPERV::SwitchParameter :
     f << "SwitchParameter";
     break;
   case SUPERV::EndSwitchParameter :
     f << "EndSwitchParameter";
     break;
+  case SUPERV::GOTOParameter :
+    f << "GOTOParameter";
+    break;
+  case SUPERV::DataStreamParameter :
+    f << "DataStreamParameter";
+    break;
   default :
     f << "UnknownKindOfPort";
     break;
@@ -191,3 +218,46 @@ ostream & operator<< (ostream & f ,const SUPERV::KindOfPort & s ) {
   return f;
 }
 
+ostream & operator<< (ostream & f ,const SALOME_ModuleCatalog::DataStreamDependency & s ) {
+  switch (s) {
+  case SALOME_ModuleCatalog::DATASTREAM_UNDEFINED :
+    f << "DATASTREAM_UNDEFINED";
+    break;
+  case SALOME_ModuleCatalog::DATASTREAM_TEMPORAL :
+    f << "DATASTREAM_TEMPORAL";
+    break;
+  case SALOME_ModuleCatalog::DATASTREAM_ITERATIVE :
+    f << "DATASTREAM_ITERATIVE";
+    break;
+  default :
+    f << "DATASTREAM_?";
+    break;
+  }
+
+  return f;
+}
+
+ostream & operator<< (ostream & f ,const StatusOfPort & s ) {
+  switch (s) {
+  case NotConnected :
+    f << "NotConnected";
+    break;
+  case PortConnected :
+    f << "PortConnected";
+    break;
+//  case PortAndDataConnected :
+//    f << "PortAndDataConnected";
+//    break;
+  case DataConnected :
+    f << "DataConnected";
+    break;
+  case ExternConnected :
+    f << "ExternConnected";
+    break;
+  default :
+    f << "UnknownStatusOfPort";
+    break;
+  }
+
+  return f;
+}