using namespace std;
#include "DataFlowBase_OutPort.hxx"
+#include "DataFlowBase_InPort.hxx"
//GraphBase::OutPort::~OutPort() {
// In GraphExecutor::OutPort
if ( index > 0 && index <= _InPortsSize ) {
anInPort = _InPorts[ index-1 ] ;
if ( anInPort != toPort ) {
- cout << "GraphBase::OutPort::GetInPort inconsistency toPort "
- << hex << (void *) toPort << " != anInPort " << (void *) anInPort
- << dec << endl ;
+ //cout << "GraphBase::OutPort::GetInPort inconsistency toPort "
+// << hex << (void *) toPort << " != anInPort " << (void *) anInPort
+// << dec << endl ;
anInPort = NULL ;
}
}
return true ;
}
+bool GraphBase::OutPort::RemoveInPort() {
+ if ( _InPortsSize != 1 ) {
+ return false ;
+ }
+ int index = 1 ;
+ GraphBase::InPort * toPort = _InPorts[ index - 1 ] ;
+ _InPortsSize -= 1 ;
+ _InPorts.resize( _InPortsSize ) ;
+ _Links.resize( _InPortsSize ) ;
+ _MapOfInPorts.erase( toPort->NodePortName() ) ;
+ if ( _InPortsSize == 0 ) {
+ PortStatus(NotConnected ) ;
+ if ( IsSwitch() ) {
+ Kind( SUPERV::InLineParameter ) ;
+ }
+ }
+ toPort->RemoveOutPort() ;
+ cdebug << "OutPort::RemoveInPort " << NodeName() << "( " << PortName() << " " << PortStatus()
+ << " " << Kind() << " ) _InPortsSize " << _InPortsSize << " --> "
+ << toPort->NodeName() << "( " << toPort->PortName() << " " << toPort->PortStatus()
+ << " " << toPort->Kind() << " )" << endl ;
+ return true ;
+}
+
bool GraphBase::OutPort::RemoveInPort( GraphBase::InPort * toPort ) {
int i ;
int index = _MapOfInPorts[ toPort->NodePortName() ] ;
if ( index <= 0 || index > _InPortsSize ) {
- cdebug << "GraphBase::OutPort::RemoveInPort Error " << NodePortName()
- << " --> " << toPort->NodePortName() << endl ;
+ cdebug << "GraphBase::OutPort::RemoveInPort Error " << NodeName() << "( " << PortName()<< " ) --> "
+ << toPort->NodeName() << "( " << toPort->PortName() << " )" << endl ;
return false ;
}
+ cdebug << "OutPort::RemoveInPort " << NodeName() << "(" << PortName() << ") --> "
+ << _InPorts[ index - 1 ]->NodeName() << "(" << _InPorts[ index - 1 ]->PortName() << ")" << endl ;
_InPortsSize -= 1 ;
for ( i = index - 1 ; i < _InPortsSize ; i++ ) {
_MapOfInPorts[ _InPorts[ i+1 ]->NodePortName() ] = i + 1 ;
_MapOfInPorts.erase( toPort->NodePortName() ) ;
if ( _InPortsSize == 0 ) {
PortStatus(NotConnected ) ;
+ if ( IsSwitch() ) {
+ Kind( SUPERV::InLineParameter ) ;
+ }
}
toPort->RemoveOutPort() ;
return true ;
const char* NewNodePortName ) {
int index = _MapOfInPorts[ OldNodePortName ] ;
if ( index <= 0 || index > _InPortsSize ) {
- cdebug << "GraphBase::OutPort::ReNameLink Error " << OldNodePortName
+ cdebug << "GraphBase::OutPort::ReNameInPort Error " << OldNodePortName
<< " --> " << NewNodePortName << " index " << index << endl ;
return false ;
}
ostream & operator<< (ostream &f ,const GraphBase::OutPort &P)
{
- f << P.PortName() << ", "
- << "type : " << P.PortType() << ", " ;
-
- f << "from "
- << P.NodeName() << ", ";
-
+ f << P.PortName() << ", " << "type : " << P.PortType() << ", " ;
+ f << "kind " << P.Kind() << ", ";
+ f << "Status " << P.PortStatus() << ", ";
+ f << "from Node " << P.NodeName() << ", ";
return f;
}