public class ModalController extends NamedProgramCodeGeneratorAdapter
red (sssf) |
red (sssf) |
NamedProgramCodeGeneratorAdapter.VariableScope
ProgramCodeGeneratorAdapter.Channel
NamedObj.ContainedObjectsIterator
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
_eol
End of line character.
|
protected ModalController |
_myController
The associated modal controller component.
|
_component, _defaultBlocks, _templateParser
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
Constructor and Description |
---|
ModalController(ModalController component)
Construct the code generator helper associated
with the given modal controller.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
_generateRefinementCode(java.lang.StringBuffer code)
Generate code for the firing of refinements.
|
protected void |
_updateConnectedPortsOffset(IOPort port,
java.lang.StringBuffer code,
int rate)
Update the offsets of the buffers associated with the ports connected
with the given port in its downstream.
|
protected void |
_updatePortOffset(TypedIOPort port,
java.lang.StringBuffer code,
int rate)
Update the read offsets of the buffer associated with the given port.
|
java.lang.String |
generateFireCode()
Generate the fire code.
|
java.lang.String |
generateFireFunctionCode()
Generate The fire function code.
|
java.lang.String |
generatePreinitializeCode()
Generate the preinitialization code for the director.
|
void |
generateTransferInputsCode(TypedIOPort inputPort,
java.lang.StringBuffer code)
Generate code for transferring enough tokens to complete an internal
iteration.
|
void |
generateTransferOutputsCode(TypedIOPort outputPort,
java.lang.StringBuffer code)
Generate code for transferring enough tokens to fulfill the output
production rate.
|
_generateFireCode, _generateTypeConvertStatement, analyzeTypeConvert, copyFilesToCodeDirectory, generateInitializeCode, generateMainLoop, generateModeTransitionCode, generatePostfireCode, generatePrefireCode, generatePreinitializeMethodBodyCode, generateSimpleName, generateTypeConvertFireCode, generateTypeConvertFireCode, generateVariableDeclaration, generateVariableInitialization, generateWrapupCode, getAddTimeString, getBufferSize, getBufferSize, getComponent, getDeclareSharedCode, getDefaultBlocks, getFireFunctionParameters, getHeaderFiles, getIncludeDirectories, getLibraries, getLibraryDirectories, getModifiedVariables, getName, getParameterValue, getReference, getReference, getSharedCode, getSinkChannels, getSourceTimeString, getTimeSourcePortName, getTypeConvertChannels, getTypeConvertReference, getTypeConvertSinkChannels, setupAdapter, targetType
_generateBlockByName, getAdapter, getCodeGenerator, getTemplateParser, processCode, setCodeGenerator, setTemplateParser, toString
createDecoratorAttributes, generateName
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _description, _executeChangeRequests, _exportMoMLContents, _getContainedObject, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateExistence, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, _validateSettables, addChangeListener, addDebugListener, addHierarchyListener, attributeChanged, attributeDeleted, attributeList, attributeList, attributeTypeChanged, clone, clone, containedObjectsIterator, decorators, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttribute, getAttributes, getChangeListeners, getClassName, getContainer, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getElementName, getFullName, getModelErrorHandler, getName, getPrototypeList, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, notifyOfNameChange, propagateExistence, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setName, setPersistent, setSource, sortContainedObjects, toplevel, uniqueName, validateSettables, workspace
protected static final java.lang.String _eol
protected ModalController _myController
public ModalController(ModalController component)
component
- The associated modal controller component.public java.lang.String generatePreinitializeCode() throws IllegalActionException
generatePreinitializeCode
in class NamedProgramCodeGeneratorAdapter
IllegalActionException
- If thrown by the superclass or thrown
while generating code for the director.public java.lang.String generateFireCode() throws IllegalActionException
NamedProgramCodeGeneratorAdapter
generateFireCode
in class NamedProgramCodeGeneratorAdapter
IllegalActionException
- Not thrown in this base class.public java.lang.String generateFireFunctionCode() throws IllegalActionException
generateFireFunctionCode
in class NamedProgramCodeGeneratorAdapter
IllegalActionException
- If thrown while generating fire code.public void generateTransferInputsCode(TypedIOPort inputPort, java.lang.StringBuffer code) throws IllegalActionException
inputPort
- The port to transfer tokens.code
- The string buffer that the generated code is appended to.IllegalActionException
- If thrown while transferring tokens.public void generateTransferOutputsCode(TypedIOPort outputPort, java.lang.StringBuffer code) throws IllegalActionException
outputPort
- The port to transfer tokens.code
- The string buffer that the generated code is appended to.IllegalActionException
- If thrown while transferring tokens.protected boolean _generateRefinementCode(java.lang.StringBuffer code) throws IllegalActionException
code
- The string buffer that the generated code is appended to.IllegalActionException
- If the helper associated with
an actor throws it while generating fire code for the actor.protected void _updatePortOffset(TypedIOPort port, java.lang.StringBuffer code, int rate) throws IllegalActionException
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.IllegalActionException
- If thrown while reading or writing
offsets, or getting the buffer size, or if the rate is less than 0.protected void _updateConnectedPortsOffset(IOPort port, java.lang.StringBuffer code, int rate) throws IllegalActionException
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.IllegalActionException
- If thrown while reading or writing
offsets, or getting the buffer size, or if the rate is less than 0.