Class TypedCompositeActor
- java.lang.Object
-
- ptolemy.kernel.util.NamedObj
-
- ptolemy.cg.kernel.generic.CodeGeneratorAdapter
-
- ptolemy.cg.kernel.generic.program.ProgramCodeGeneratorAdapter
-
- ptolemy.cg.kernel.generic.program.NamedProgramCodeGeneratorAdapter
-
- ptolemy.cg.adapter.generic.adapters.ptolemy.actor.TypedCompositeActor
-
- ptolemy.cg.adapter.generic.program.procedural.adapters.ptolemy.actor.TypedCompositeActor
-
- ptolemy.cg.adapter.generic.program.procedural.c.adapters.ptolemy.actor.TypedCompositeActor
-
- All Implemented Interfaces:
java.lang.Cloneable
,Changeable
,Debuggable
,DebugListener
,Derivable
,ModelErrorHandler
,MoMLExportable
,Moveable
,Nameable
- Direct Known Subclasses:
CompiledCompositeActor
public class TypedCompositeActor extends TypedCompositeActor
A C adapter class for ptolemy.actor.lib.TypedCompositeActor.- Since:
- Ptolemy II 10.0
- Version:
- $Id$
- Author:
- William Lucas
- Pt.AcceptedRating:
- Red (wlc)
- Pt.ProposedRating:
- Red (wlc)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ptolemy.cg.kernel.generic.program.NamedProgramCodeGeneratorAdapter
NamedProgramCodeGeneratorAdapter.VariableScope
-
Nested classes/interfaces inherited from class ptolemy.cg.kernel.generic.program.ProgramCodeGeneratorAdapter
ProgramCodeGeneratorAdapter.Channel
-
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj
NamedObj.ContainedObjectsIterator
-
-
Field Summary
-
Fields inherited from class ptolemy.cg.kernel.generic.program.ProgramCodeGeneratorAdapter
_component, _defaultBlocks, _eol, _templateParser
-
Fields inherited from class ptolemy.kernel.util.NamedObj
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
-
-
Constructor Summary
Constructors Constructor Description TypedCompositeActor(TypedCompositeActor actor)
Constructor method for the CompositeActor adapter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.String
_generateFireCode()
Generate the fire code of a Composite Actor.java.lang.String
generateFireFunctionCode()
Generate The fire function code.java.lang.String
generateInitializeCode()
Generate the initialize code for this composite actor.java.lang.String
generatePostfireCode()
Generate the postfire code for this composite actor.java.lang.String
generatePrefireCode()
Generate the prefire code for this composite actor.java.lang.String
generatePreinitializeCode()
Generate the preinitialize code.java.lang.String
generatePreinitializeMethodBodyCode()
Generate the preinitialize code.java.lang.String
generateVariableDeclaration()
Generate variable declarations for inputs and outputs and parameters.java.lang.String
generateVariableInitialization()
Generate variable initialization for the referenced parameters.java.lang.String
generateWrapupCode()
Generate variable declarations for inputs and outputs and parameters.java.util.Set<Parameter>
getModifiedVariables()
Return a set of parameters that will be modified during the execution of the model.void
setupAdapter()
Set up adapters contained by the composite actor.-
Methods inherited from class ptolemy.cg.adapter.generic.program.procedural.adapters.ptolemy.actor.TypedCompositeActor
analyzeTypeConvert, generateModeTransitionCode, getDeclareSharedCode, getHeaderFiles, getIncludeDirectories, getLibraries, getLibraryDirectories, getSharedCode
-
Methods inherited from class ptolemy.cg.kernel.generic.program.NamedProgramCodeGeneratorAdapter
_generateTypeConvertStatement, copyFilesToCodeDirectory, generateFireCode, generateMainLoop, generateSimpleName, generateTypeConvertFireCode, generateTypeConvertFireCode, getAddTimeString, getBufferSize, getBufferSize, getComponent, getDefaultBlocks, getFireFunctionParameters, getName, getParameterValue, getReference, getReference, getSinkChannels, getSourceTimeString, getTimeSourcePortName, getTypeConvertChannels, getTypeConvertReference, getTypeConvertSinkChannels, targetType
-
Methods inherited from class ptolemy.cg.kernel.generic.program.ProgramCodeGeneratorAdapter
_generateBlockByName, getAdapter, getCodeGenerator, getTemplateParser, processCode, setCodeGenerator, setTemplateParser, toString
-
Methods inherited from class ptolemy.cg.kernel.generic.CodeGeneratorAdapter
createDecoratorAttributes, generateName
-
Methods inherited from class ptolemy.kernel.util.NamedObj
_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
-
-
-
-
Constructor Detail
-
TypedCompositeActor
public TypedCompositeActor(TypedCompositeActor actor)
Constructor method for the CompositeActor adapter.- Parameters:
actor
- the associated actor
-
-
Method Detail
-
generateFireFunctionCode
public java.lang.String generateFireFunctionCode() throws IllegalActionException
Generate The fire function code. This method is called when the firing code of each actor is not inlined. Each actor's firing code is in a function with the same name as that of the actor.- Overrides:
generateFireFunctionCode
in classTypedCompositeActor
- Returns:
- The fire function code.
- Throws:
IllegalActionException
- If thrown while generating fire code.
-
generateInitializeCode
public java.lang.String generateInitializeCode() throws IllegalActionException
Generate the initialize code for this composite actor.- Overrides:
generateInitializeCode
in classTypedCompositeActor
- Returns:
- The generated initialize code.
- Throws:
IllegalActionException
- If thrown while appending to the the block or processing the macros.
-
generatePostfireCode
public java.lang.String generatePostfireCode() throws IllegalActionException
Generate the postfire code for this composite actor.- Overrides:
generatePostfireCode
in classTypedCompositeActor
- Returns:
- The generated postfire code.
- Throws:
IllegalActionException
- If thrown while appending to the the block or processing the macros.
-
generatePrefireCode
public java.lang.String generatePrefireCode() throws IllegalActionException
Generate the prefire code for this composite actor.- Overrides:
generatePrefireCode
in classNamedProgramCodeGeneratorAdapter
- Returns:
- The generated prefire code.
- Throws:
IllegalActionException
- If thrown while appending to the the block or processing the macros.
-
generatePreinitializeCode
public java.lang.String generatePreinitializeCode() throws IllegalActionException
Generate the preinitialize code. We do not call the super method, because we have arguments to add here This code contains the variable declarations- Overrides:
generatePreinitializeCode
in classTypedCompositeActor
- Returns:
- The generated preinitialize code.
- Throws:
IllegalActionException
- If thrown while appending to the the block or processing the macros.
-
generatePreinitializeMethodBodyCode
public java.lang.String generatePreinitializeMethodBodyCode() throws IllegalActionException
Generate the preinitialize code. We do not call the super method, because we have arguments to add here This code contains the different constructions and initializations.- Overrides:
generatePreinitializeMethodBodyCode
in classTypedCompositeActor
- Returns:
- The generated preinitialize Method code.
- Throws:
IllegalActionException
- If thrown while appending to the the block or processing the macros.
-
setupAdapter
public void setupAdapter() throws IllegalActionException
Set up adapters contained by the composite actor. This method is run very early in the code generation sequence, so adapters that need to set up code generation-time variables may have setupAdapter() methods that need to be invoked. Variables and shared code that are to be generated should be in generateSharedCode() or other methods, not this method.- Overrides:
setupAdapter
in classTypedCompositeActor
- Throws:
IllegalActionException
- If the adapter associated with an actor throws it while being set up.
-
generateVariableDeclaration
public java.lang.String generateVariableDeclaration() throws IllegalActionException
Generate variable declarations for inputs and outputs and parameters. Append the declarations to the given string buffer.- Overrides:
generateVariableDeclaration
in classTypedCompositeActor
- Returns:
- code The generated code.
- Throws:
IllegalActionException
- If the adapter class for the model director cannot be found.
-
generateVariableInitialization
public java.lang.String generateVariableInitialization() throws IllegalActionException
Generate variable initialization for the referenced parameters.- Overrides:
generateVariableInitialization
in classTypedCompositeActor
- Returns:
- code The generated code.
- Throws:
IllegalActionException
- If the adapter associated with an actor throws it while generating variable declarations for the actor.
-
generateWrapupCode
public java.lang.String generateWrapupCode() throws IllegalActionException
Generate variable declarations for inputs and outputs and parameters. Append the declarations to the given string buffer.- Overrides:
generateWrapupCode
in classTypedCompositeActor
- Returns:
- code The generated code.
- Throws:
IllegalActionException
- If the adapter class for the model director cannot be found.
-
getModifiedVariables
public java.util.Set<Parameter> getModifiedVariables() throws IllegalActionException
Return a set of parameters that will be modified during the execution of the model. These parameters are those returned by getModifiedVariables() method of directors or actors that implement ExplicitChangeContext interface.- Overrides:
getModifiedVariables
in classTypedCompositeActor
- Returns:
- a set of parameters that will be modified.
- Throws:
IllegalActionException
- If the adapter associated with an actor or director throws it while getting modified variables.
-
_generateFireCode
protected java.lang.String _generateFireCode() throws IllegalActionException
Generate the fire code of a Composite Actor.- Overrides:
_generateFireCode
in classTypedCompositeActor
- Returns:
- The generated code.
- Throws:
IllegalActionException
- If thrown while appending the fireBlock or processing the code.
-
-