ptolemy.cg.adapter.generic.program.procedural.c.adapters.ptolemy.actor.lib
Class Accumulator

java.lang.Object
  extended by ptolemy.kernel.util.NamedObj
      extended by ptolemy.cg.kernel.generic.CodeGeneratorAdapter
          extended by ptolemy.cg.kernel.generic.program.ProgramCodeGeneratorAdapter
              extended by ptolemy.cg.kernel.generic.program.NamedProgramCodeGeneratorAdapter
                  extended by ptolemy.cg.adapter.generic.program.procedural.c.adapters.ptolemy.actor.lib.Accumulator
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Changeable, Debuggable, DebugListener, Derivable, ModelErrorHandler, MoMLExportable, Moveable, Nameable

public class Accumulator
extends NamedProgramCodeGeneratorAdapter

An adapter class for ptolemy.actor.lib.Accumulator.

Since:
Ptolemy II 6.0
Version:
$Id: Accumulator.java 53095 2009-04-12 19:12:45Z cxh $
Author:
Man-Kit Leung, Gang Zhou
See Also:
Serialized Form
Accepted Rating:
Green (cxh)
Proposed Rating:
Green (mankit)

Nested Class Summary
 
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, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
 
Constructor Summary
Accumulator(Accumulator actor)
          Construct an Accumulator helper.
 
Method Summary
protected  java.lang.String _generateFireCode()
          Generate fire code.
 java.lang.String generateInitializeCode()
          Generate the initialize code.
 java.lang.String generatePreinitializeCode()
          Generate the preinitialize code.
 java.util.Set getHeaderFiles()
          Get the files needed by the code generated for the Accumulator actor.
 
Methods inherited from class ptolemy.cg.kernel.generic.program.NamedProgramCodeGeneratorAdapter
_generateTypeConvertStatement, analyzeTypeConvert, copyFilesToCodeDirectory, generateFireCode, generateFireFunctionCode, generateModeTransitionCode, generateName, generatePostfireCode, generatePrefireCode, generateSimpleName, generateTypeConvertFireCode, generateTypeConvertFireCode, generateVariableDeclaration, generateVariableInitialization, generateWrapupCode, getComponent, getDefaultBlocks, getIncludeDirectories, getLibraries, getLibraryDirectories, getModifiedVariables, getName, getParameterValue, getReference, getReference, getSharedCode, getSinkChannels, 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
createDecoratedAttributes, setTypesOfDecoratedVariables
 
Methods inherited from class ptolemy.kernel.util.NamedObj
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _debug, _debug, _debug, _debug, _debug, _description, _exportMoMLContents, _getContainedObject, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _propagateExistence, _propagateValue, _recordDecoratedAttributes, _removeAttribute, _splitName, _stripNumericSuffix, _validateSettables, addChangeListener, addDebugListener, attributeChanged, attributeList, attributeList, attributeTypeChanged, clone, clone, containedObjectsIterator, 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, propagateExistence, propagateValue, propagateValues, removeChangeListener, removeDebugListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setName, setPersistent, setSource, sortContainedObjects, toplevel, uniqueName, validateSettables, workspace
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Accumulator

public Accumulator(Accumulator actor)
Construct an Accumulator helper.

Parameters:
actor - the associated actor.
Method Detail

_generateFireCode

protected java.lang.String _generateFireCode()
                                      throws IllegalActionException
Generate fire code. The method reads in fireBlock from Accumulator.c, replaces macros with their values and returns the processed code block.

Overrides:
_generateFireCode in class NamedProgramCodeGeneratorAdapter
Returns:
The generated code.
Throws:
IllegalActionException - If the code stream encounters an error in processing the specified code block(s).

generateInitializeCode

public java.lang.String generateInitializeCode()
                                        throws IllegalActionException
Generate the initialize code. The method reads in initBlock from Accumulator.c, replaces macros with their values and returns the processed code block.

Overrides:
generateInitializeCode in class NamedProgramCodeGeneratorAdapter
Returns:
The initialize code.
Throws:
IllegalActionException - If the code stream encounters an error in processing the specified code block(s).

generatePreinitializeCode

public java.lang.String generatePreinitializeCode()
                                           throws IllegalActionException
Generate the preinitialize code. The method reads in preinitBlock from Accumulator.c, replaces macros with their values and returns the processed code block.

Overrides:
generatePreinitializeCode in class NamedProgramCodeGeneratorAdapter
Returns:
The preinitialize code.
Throws:
IllegalActionException - If the code stream encounters an error in processing the specified code block(s).

getHeaderFiles

public java.util.Set getHeaderFiles()
                             throws IllegalActionException
Get the files needed by the code generated for the Accumulator actor.

Overrides:
getHeaderFiles in class NamedProgramCodeGeneratorAdapter
Returns:
A set of Strings that are names of the header files needed by the code generated for the StringCompare actor.
Throws:
IllegalActionException - Not Thrown in this subclass.