Class GiottoReceiver

    • Constructor Detail

    • Method Detail

      • generateGetCode

        public java.lang.String generateGetCode​(java.lang.String offset)
                                         throws IllegalActionException
        Generates code for getting tokens from the receiver.
        Specified by:
        generateGetCode in class Receiver
        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.
        Specified by:
        generateHasTokenCode in class Receiver
        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.
        Specified by:
        generatePutCode in class Receiver
        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.
        Specified by:
        _generateTypeConvertStatement in class Receiver
        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.
      • _getExecutiveDirectorForReceiver

        protected StaticSchedulingDirector _getExecutiveDirectorForReceiver()
                                                                     throws IllegalActionException
        Each receiver is associated with a component of some executive director.
        Returns:
        The executive director if the component associated with this receiver.
        Throws:
        IllegalActionException - FIXME: This is a patch for hierarchical Giotto codegen, need to find a better way of doing this.