# -*- coding: utf-8 -*-

import ioport

class Connection(object):
    """ Connection class for IPFBlock
    
        Connection binding OPort and IPort of some IPFBlocks 
    """


    def __init__(self, oport, iport):
        # Check port compatibility and free of input port
        if ioport.compatible(oport, iport) and iport.is_free():
            self._oport = oport
            self._iport = iport
            self._oport.increase_binded_count()
            self._iport.set_binded()
        else:
            raise ValueError("Can not create Connection with given ports")
            
    def __del__(self):
        self._oport.decrease_binded_count()
        self._iport.set_free()
        
    def transmit(self):
        """ Send value from output port to input port """
        self._iport.pass_value(self._oport.get_valure())
        
        
# -*- coding: utf-8 -*-

import ioport

class Connection(object):
    """ Connection class for IPFBlock
    
        Connection binding OPort and IPort of some IPFBlocks 
    """


    def __init__(self, oport, iport):
        # Check port compatibility and free of input port
        if ioport.compatible(oport, iport) and iport.is_free():
            self._oport = oport
            self._iport = iport
            self._oport.increase_binded_count()
            self._iport.set_binded()
        else:
            raise ValueError("Can not create Connection with given ports")
            
    def __del__(self):
        self._oport.decrease_binded_count()
        self._iport.set_free()
        
    def process(self):
        """ Send value from output port to input port """
        self._iport.pass_value(self._oport.get_valure())
        
        
Rename Connection transmit function to process for use in IPFGraph
Rename Connection transmit function to process for use in IPFGraph
