Class SDFDirector

    • Field Detail

      • _portNumber

        protected int _portNumber
        The port number.
    • Constructor Detail

      • SDFDirector

        public SDFDirector​(SDFDirector sdfDirector)
        Construct the code generator adapter associated with the given SDFDirector.
        Parameters:
        sdfDirector - The associated ptolemy.domains.sdf.kernel.SDFDirector
    • Method Detail

      • generateInitializeCode

        public java.lang.String generateInitializeCode()
                                                throws IllegalActionException
        Generate the initialize code for this director. The initialize code for the director is generated by appending the initialize code for each actor.
        Overrides:
        generateInitializeCode in class SDFDirector
        Returns:
        The generated initialize code.
        Throws:
        IllegalActionException - If the adapter associated with an actor throws it while generating initialize code for the actor.
      • generatePreinitializeCode

        public java.lang.String generatePreinitializeCode()
                                                   throws IllegalActionException
        Generate the preinitialize code for this director. The preinitialize code for the director is generated by appending the preinitialize code for each actor.
        Overrides:
        generatePreinitializeCode in class SDFDirector
        Returns:
        The generated preinitialize code.
        Throws:
        IllegalActionException - If getting the adapter fails, or if generating the preinitialize code for a adapter fails, or if there is a problem getting the buffer size of a port.
      • generateTransferInputsCode

        public void generateTransferInputsCode​(IOPort inputPort,
                                               java.lang.StringBuffer code)
                                        throws IllegalActionException
        Generate code for transferring enough tokens to complete an internal iteration.
        Overrides:
        generateTransferInputsCode in class Director
        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​(IOPort outputPort,
                                                java.lang.StringBuffer code)
                                         throws IllegalActionException
        Generate code for transferring enough tokens to fulfill the output production rate.
        Overrides:
        generateTransferOutputsCode in class Director
        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.
      • _generatePortVariableDeclaration

        protected java.lang.String _generatePortVariableDeclaration​(NamedProgramCodeGeneratorAdapter target)
                                                             throws IllegalActionException
        Generate the input and output port declarations.
        Parameters:
        target - The NamedProgramCodeGeneratorAdapter for which code needs to be generated.
        Returns:
        The generated code.
        Throws:
        IllegalActionException - If thrown while generating the input or output variables.
      • _generateVariableDeclaration

        protected java.lang.String _generateVariableDeclaration​(NamedProgramCodeGeneratorAdapter target)
                                                         throws IllegalActionException
        Generate variable declarations for inputs and outputs and parameters. Append the declarations to the given string buffer.
        Overrides:
        _generateVariableDeclaration in class Director
        Parameters:
        target - The ProgramCodeGeneratorAdapter for which code needs to be generated.
        Returns:
        code The generated code.
        Throws:
        IllegalActionException - If the adapter class for the model director cannot be found.
      • _getParameter

        protected java.lang.String _getParameter​(NamedProgramCodeGeneratorAdapter target,
                                                 Attribute attribute,
                                                 java.lang.String[] channelAndOffset)
                                          throws IllegalActionException
        Return an unique label for the given attribute referenced by the given adapter.
        Overrides:
        _getParameter in class SDFDirector
        Parameters:
        target - The ProgramCodeGeneratorAdapter for which code needs to be generated.
        attribute - The given attribute.
        channelAndOffset - The given channel and offset.
        Returns:
        an unique label for the given attribute.
        Throws:
        IllegalActionException - If the adapter throws it while generating the label.