Class ModalController

    • Field Detail

      • _eol

        protected static final java.lang.String _eol
        End of line character. Under Unix: "\n", under Windows: "\n\r". We use a end of line character so that the files we generate have the proper end of line character for use by other native tools.
      • _myController

        protected ModalController _myController
        The associated modal controller component.
    • Constructor Detail

      • ModalController

        public ModalController​(ModalController component)
        Construct the code generator helper associated with the given modal controller.
        Parameters:
        component - The associated modal controller component.
    • Method Detail

      • generateFireCode

        public java.lang.String generateFireCode()
                                          throws IllegalActionException
        Description copied from class: NamedProgramCodeGeneratorAdapter
        Generate the fire code. In this base class, add the name of the associated component in the comment. It checks the inline parameter of the code generator. If the value is true, it generates the actor fire code and the necessary type conversion code. Otherwise, it generate an invocation to the actor function that is generated by generateFireFunctionCode.
        Overrides:
        generateFireCode in class NamedProgramCodeGeneratorAdapter
        Returns:
        The generated code.
        Throws:
        IllegalActionException - Not thrown in this base class.
      • generateTransferInputsCode

        public void generateTransferInputsCode​(TypedIOPort inputPort,
                                               java.lang.StringBuffer code)
                                        throws IllegalActionException
        Generate code for transferring enough tokens to complete an internal iteration.
        Parameters:
        inputPort - The port to transfer tokens.
        code - The string buffer that the generated code is appended to.
        Throws:
        IllegalActionException - If thrown while transferring tokens.
      • generateTransferOutputsCode

        public void generateTransferOutputsCode​(TypedIOPort outputPort,
                                                java.lang.StringBuffer code)
                                         throws IllegalActionException
        Generate code for transferring enough tokens to fulfill the output production rate.
        Parameters:
        outputPort - The port to transfer tokens.
        code - The string buffer that the generated code is appended to.
        Throws:
        IllegalActionException - If thrown while transferring tokens.
      • _generateRefinementCode

        protected boolean _generateRefinementCode​(java.lang.StringBuffer code)
                                           throws IllegalActionException
        Generate code for the firing of refinements.
        Parameters:
        code - The string buffer that the generated code is appended to.
        Returns:
        The refinemebt code.
        Throws:
        IllegalActionException - If the helper associated with an actor throws it while generating fire code for the actor.
      • _updatePortOffset

        protected void _updatePortOffset​(TypedIOPort port,
                                         java.lang.StringBuffer code,
                                         int rate)
                                  throws IllegalActionException
        Update the read offsets of the buffer associated with the given port.
        Parameters:
        port - The port whose read offset is to be updated.
        code - The string buffer that the generated code is appended to.
        rate - The rate, which must be greater than or equal to 0.
        Throws:
        IllegalActionException - If thrown while reading or writing offsets, or getting the buffer size, or if the rate is less than 0.
      • _updateConnectedPortsOffset

        protected void _updateConnectedPortsOffset​(IOPort port,
                                                   java.lang.StringBuffer code,
                                                   int rate)
                                            throws IllegalActionException
        Update the offsets of the buffers associated with the ports connected with the given port in its downstream.
        Parameters:
        port - The port whose directly connected downstream actors update their write offsets.
        code - The string buffer that the generated code is appended to.
        rate - The rate, which must be greater than or equal to 0.
        Throws:
        IllegalActionException - If thrown while reading or writing offsets, or getting the buffer size, or if the rate is less than 0.