class Port : public ServicesParameter {
- const char *const * _NodeName ;
- SUPERV::Port_var _Port ;
- SUPERV::KindOfPort _KindOfPort ;
+ private:
- vector<long > _X ;
- vector<long > _Y ;
+ const char *const * _NodeName ;
+ SUPERV::Port_var _Port ;
+ SUPERV::KindOfPort _KindOfPort ;
+
+ vector<long > _X ;
+ vector<long > _Y ;
+
+ SALOME_ModuleCatalog::DataStreamDependency _Dependency ; // Time or Iteration only for DataStreamPorts
public:
- Port() {
-// cout << "Port()" << endl ;
- _NodeName = NULL ;
- _Port = SUPERV::Port::_nil() ;
- _KindOfPort = SUPERV::UndefinedParameter ;
- } ;
- Port( const char *const * NodeName ,
- const SALOME_ModuleCatalog::ServicesParameter aserviceParameter ,
- const SUPERV::KindOfPort aKindOfPort = SUPERV::ServiceParameter ) :
- ServicesParameter( aserviceParameter ) {
- _NodeName = NodeName ;
- _Port = SUPERV::Port::_nil() ;
- _KindOfPort = aKindOfPort ;
- } ;
- virtual ~Port() {
+ Port() {
+ _NodeName = NULL ;
+ _Port = SUPERV::Port::_nil() ;
+ _KindOfPort = SUPERV::UndefinedParameter ;
+ _Dependency = SALOME_ModuleCatalog::DATASTREAM_UNDEFINED ; } ;
+ Port( const char *const * NodeName ,
+ const SALOME_ModuleCatalog::ServicesParameter aserviceParameter ,
+ const SUPERV::KindOfPort aKindOfPort = SUPERV::ServiceParameter ,
+ const SALOME_ModuleCatalog::DataStreamDependency aDependency = SALOME_ModuleCatalog::DATASTREAM_UNDEFINED ) :
+ ServicesParameter( aserviceParameter ) {
+ _NodeName = NodeName ;
+ _Port = SUPERV::Port::_nil() ;
+ _KindOfPort = aKindOfPort ;
+ if ( IsDataStream() ) {
+ _Dependency = aDependency ;
+ }
+ else {
+ _Dependency = SALOME_ModuleCatalog::DATASTREAM_UNDEFINED ;
+ } } ;
+ virtual ~Port() {
cdebug << "~Port" << endl ; } ;
- SUPERV::Port_var ObjRef() const { return _Port ; } ;
- void ObjRef(SUPERV::Port_var aPort) {
- _Port = aPort ; } ;
-
- const char * NodeName() const { return *_NodeName ; } ;
- const char * NodePortName() const {
-// cout << "NodePortName " << hex << (void *) _NodeName << " "
-// << dec << _NodeName << endl ;
- char * _NodePortName = new char [ strlen( *_NodeName ) +
- strlen( ServicesParameterName() ) + 3 ] ;
- strcpy( _NodePortName , *_NodeName ) ;
- strcat( _NodePortName , "\\" ) ;
- strcat( _NodePortName , ServicesParameterName() ) ;
-// strcat( _NodePortName , "\\" ) ;
- return _NodePortName ; } ;
-
- const char * PortName() const {
- if ( this == NULL )
- return NULLSTRING ;
- return ServicesParameterName() ; } ;
- const char * PortType() const { return ServicesParameterType() ; } ;
-
- void Kind( SUPERV::KindOfPort aKindOfPort ) {
- if ( _KindOfPort == SUPERV::GateParameter && aKindOfPort == SUPERV::InLineParameter ) {
- cdebug << "GraphBase::Port::Kind " << _KindOfPort << " --> " << aKindOfPort
- << endl ;
- }
- _KindOfPort = aKindOfPort ; } ;
- const SUPERV::KindOfPort Kind() const { return _KindOfPort ; } ;
- bool IsParam() const {
- return _KindOfPort == SUPERV::ServiceParameter ; } ;
- bool IsGate() const {
- return _KindOfPort == SUPERV::GateParameter ||
- _KindOfPort == SUPERV::GOTOParameter ; } ;
- bool IsInLine() const {
- return _KindOfPort == SUPERV::InLineParameter ; } ;
- bool IsLoop() const {
- return _KindOfPort == SUPERV::LoopParameter ; } ;
- bool IsSwitch() const {
- return _KindOfPort == SUPERV::SwitchParameter ; } ;
- bool IsEndSwitch() const {
- return _KindOfPort == SUPERV::EndSwitchParameter ; } ;
- bool IsGOTO() const {
- return _KindOfPort == SUPERV::GOTOParameter ; } ;
- bool IsDataStream() const {
- return _KindOfPort == SUPERV::DataStreamParameter ; } ;
-// bool IsBus() const { return ( ( _KindOfPort == SUPERV::InLineParameter ) ||
-// ( _PortIndex != -1 ) ) ; } ;
-
-// void PortIndex( const int anIndex ) {
-// _PortIndex = anIndex ; } ;
-// const int PortIndex() const {
-// return _PortIndex ; } ;
-
-
- bool AddCoord( const int nxy , const int *x , const int *y ) ;
- bool AddCoord( const int index , const int x , const int y ) ;
- bool ChangeCoord( const int index ,
- const int x ,
- const int y ) ;
- bool RemoveCoord( const int index ) ;
- bool RemoveCoords() ;
- int GetCoord() const ;
- bool GetCoord( int *x , int *y ) const ;
- const GraphBase::ListOfCoords * Coords() const ;
- bool GetCoord( const int index , long &x , long &y ) const ;
+ SUPERV::Port_var ObjRef() const { return _Port ; } ;
+ void ObjRef(SUPERV::Port_var aPort) {
+ _Port = aPort ; } ;
+
+ const char * NodeName() const { return *_NodeName ; } ;
+ const char * NodePortName() const {
+// cout << "NodePortName " << hex << (void *) _NodeName << " "
+// << dec << _NodeName << endl ;
+ char * _NodePortName = new char [ strlen( *_NodeName ) +
+ strlen( ServicesParameterName() ) + 3 ] ;
+ strcpy( _NodePortName , *_NodeName ) ;
+ strcat( _NodePortName , "\\" ) ;
+ strcat( _NodePortName , ServicesParameterName() ) ;
+ return _NodePortName ; } ;
+
+ const char * PortName() const {
+ if ( this == NULL )
+ return NULLSTRING ;
+ return ServicesParameterName() ; } ;
+ const char * PortType() const { return ServicesParameterType() ; } ;
+
+ void Kind( SUPERV::KindOfPort aKindOfPort ) {
+ if ( _KindOfPort == SUPERV::GateParameter && aKindOfPort == SUPERV::InLineParameter ) {
+ cdebug << "GraphBase::Port::Kind " << _KindOfPort << " --> " << aKindOfPort
+ << endl ;
+ }
+ _KindOfPort = aKindOfPort ; } ;
+ const SUPERV::KindOfPort Kind() const {
+ return _KindOfPort ; } ;
+ bool IsParam() const {
+ return _KindOfPort == SUPERV::ServiceParameter ; } ;
+ bool IsGate() const {
+ return _KindOfPort == SUPERV::GateParameter ||
+ _KindOfPort == SUPERV::GOTOParameter ; } ;
+ bool IsInLine() const {
+ return _KindOfPort == SUPERV::InLineParameter ; } ;
+ bool IsLoop() const {
+ return _KindOfPort == SUPERV::LoopParameter ; } ;
+ bool IsSwitch() const {
+ return _KindOfPort == SUPERV::SwitchParameter ; } ;
+ bool IsEndSwitch() const {
+ return _KindOfPort == SUPERV::EndSwitchParameter ; } ;
+ bool IsGOTO() const {
+ return _KindOfPort == SUPERV::GOTOParameter ; } ;
+ bool IsDataStream() const {
+ return _KindOfPort == SUPERV::DataStreamParameter ; } ;
+
+ const SALOME_ModuleCatalog::DataStreamDependency Dependency() const {
+ return _Dependency ; } ;
+ bool Dependency( SALOME_ModuleCatalog::DataStreamDependency aDependency ) {
+ if ( IsDataStream() ) {
+ _Dependency = aDependency ;
+ return true ;
+ }
+ return false ; } ;
+
+ bool AddCoord( const int nxy , const int *x , const int *y ) ;
+ bool AddCoord( const int index , const int x , const int y ) ;
+ bool ChangeCoord( const int index ,
+ const int x ,
+ const int y ) ;
+ bool RemoveCoord( const int index ) ;
+ bool RemoveCoords() ;
+ int GetCoord() const ;
+ bool GetCoord( int *x , int *y ) const ;
+ const GraphBase::ListOfCoords * Coords() const ;
+ bool GetCoord( const int index , long &x , long &y ) const ;
} ;
ostream & operator<< (ostream &,const SUPERV::KindOfPort &);
+ostream & operator<< (ostream &,const SALOME_ModuleCatalog::DataStreamDependency &);
+
#endif