Class SDFReceiver

    • Constructor Detail

    • Method Detail

      • generateGetCode

        public java.lang.String generateGetCode​(java.lang.String offset)
                                         throws IllegalActionException
        Generates code for getting tokens from the receiver.
        Overrides:
        generateGetCode in class SDFReceiver
        Parameters:
        offset - The offset of the port.
        Returns:
        The generated get code.
        Throws:
        IllegalActionException - If thrown while getting the component, getting the adapter, getting the director or getting the port reference.
      • generateHasTokenCode

        public java.lang.String generateHasTokenCode​(java.lang.String offset)
                                              throws IllegalActionException
        Generates code to check the receiver has a token.
        Overrides:
        generateHasTokenCode in class SDFReceiver
        Parameters:
        offset - The offset of the receiver, ignored in this base class.
        Returns:
        The generated hasToken code, in this class, the string "true" is returned
        Throws:
        IllegalActionException - Not thrown in this base class.
      • generatePutCode

        public java.lang.String generatePutCode​(IOPort sourcePort,
                                                java.lang.String offset,
                                                java.lang.String token)
                                         throws IllegalActionException
        Generate code for putting tokens from the receiver.
        Overrides:
        generatePutCode in class SDFReceiver
        Parameters:
        sourcePort - The source port.
        offset - The offset of the port.
        token - The token.
        Returns:
        The generated put code.
        Throws:
        IllegalActionException - If thrown while getting the component, getting the adapter, getting the director or getting the port reference.
      • _generateTypeConvertStatement

        protected java.lang.String _generateTypeConvertStatement​(ProgramCodeGeneratorAdapter.Channel source)
                                                          throws IllegalActionException
        Description copied from class: Receiver
        Generate the type conversion statement for the particular offset of the two given channels. This assumes that the offset is the same for both channel. Advancing the offset of one has to advance the offset of the other.
        Overrides:
        _generateTypeConvertStatement in class SDFReceiver
        Parameters:
        source - The given source channel.
        Returns:
        The type convert statement for assigning the converted source variable to the sink variable with the given offset.
        Throws:
        IllegalActionException - If there is a problem getting the adapters for the ports or if the conversion cannot be handled.