ptolemy.codegen.kernel
Interface ComponentCodeGenerator

All Known Subinterfaces:
ActorCodeGenerator, PortCodeGenerator
All Known Implementing Classes:
AbsoluteValue, AbstractActionsAttribute, Accumulator, Accumulator, AddSubtract, AddSubtract, AddSubtract, ArrayAppend, ArrayAverage, ArrayElement, ArrayElementAsMatrix, ArrayExtract, ArrayLength, ArrayLevelCrossing, ArrayMaximum, ArrayMinimum, ArrayPeakSearch, ArrayToElements, ArrayToSequence, AudioPlayer, AudioReader, AudioSDLActor, AudioWriter, Average, Bernoulli, BitsToInt, BooleanMultiplexor, BooleanMultiplexor, BooleanSelect, BooleanSwitch, BooleanToAnything, CartesianToComplex, CartesianToPolar, Case, Case, CaseDirector, CaseDirector, CCodeGenerator, CCodeGeneratorHelper, Chop, Clock, CodegenActor, CodeGenerator, CodeGeneratorHelper, ColtBinomial, ColtBinomial, ColtBinomialSelector, ColtBinomialSelector, ColtPoisson, ColtPoisson, ColtRandomSource, ColtRandomSource, Commutator, Commutator, Comparator, Comparator, CompiledCompositeActor, CompiledCompositeActor, ComplexToCartesian, Const, Const, Const, Counter, CountTrues, CurrentTime, CurrentTime, CurrentTime, DEDirector, DEReceiver, Differential, Director, Director, DirectoryListing, Discard, Discard, DiscreteRandomSource, Display, Display, Display, Distributor, Distributor, DotProduct, DownSample, ElementsToArray, ElementsToArray, EmbeddedCActor, EmbeddedCActor.EmbeddedActor, EmbeddedCFileActor, EmbeddedCFileActor.EmbeddedFileActor, EmbeddedJavaActor, EmbeddedJavaActor.EmbeddedActor, Entity, Equals, Exit, Expression, Expression, Expression, ExpressionWriter, FileReader, FIR, FSMActor, FSMActor, FSMActor, FSMActor, FSMDirector, FSMDirector, FSMDirector, FSMDirector, FSMDirector, Gaussian, GiottoDirector, GiottoDirector, GradientAdaptiveLattice, HammingCoder, HammingDecoder, HDFDirector, HDFFSMDirector, Interpolator, IntToBits, IOPort, IOPort, IOPort, IORelation, IsPresent, JavaCodeGenerator, JavaCodeGeneratorHelper, JopReadPort, JopSerialRead, JopSerialWrite, JopWatchDog, JopWritePort, Lattice, LEDMatrix, Limiter, Limiter, LineReader, LineWriter, LMSAdaptive, LogicalNot, LogicFunction, LogicFunction, LookupTable, Maximum, Minimum, Minimum, ModalController, ModalController, ModalModel, ModalModel, ModalModel, ModalPort, ModalPort, MonitorValue, MonitorValue, MovingAverage, MovingAverage, MultiCompositeActor, MultiCompositeActor, MultiCompositePort, MultiCompositePort, MultiInstanceComposite, MultiplyDivide, MultiplyDivide, MultirateFSMDirector, MultirateFSMDirector, MultirateFSMDirector, NonInterruptibleTimer, NonStrictDelay, NonStrictDisplay, NonStrictLogicFunction, NonStrictTest, OpenRTOSTarget, OrderedMerge, ParameterPort, ParameterPort, ParameterPort, PlotterBase, PNDirector, PNDirector, PolarToCartesian, PosixTarget, Publisher, Publisher, PublisherTest, PublisherTest, Pulse, Pulse, Pulse, Quantizer, RaisedCosine, Ramp, Ramp, Ramp, RampNecessaryFiles, RandomSource, RandomSource, Receiver, RecursiveLattice, Refinement, Refinement, Refinement, Refinement, RefinementPort, RefinementPort, RefinementPort, RefinementPort, Remainder, Repeat, Repeat, Rician, Round, Round, RTMaudeAdaptor, RTMaudeCodeGenerator, SampleDelay, SampleDelay, Scale, Scale, Scale, SDFDirector, SDFDirector, SDFDirector, SDFDirector, Sequence, Sequence, SequencePlotter, SequencePlotter, SequenceScope, SequenceToArray, SetVariable, SetVariable, SimpleALU, SingleEvent, Sink, Sleep, SliderSource, SRDirector, SRDirector, StaticALU, StaticSchedulingCodeGenerator, StaticSchedulingDirector, StaticSchedulingDirector, Stop, StringCompare, StringConst, StringConst, StringFunction, StringIndexOf, StringLength, StringLength, StringMatches, StringSimpleReplace, StringSubstring, StringToIntArray, StringToUnsignedByteArray, Subscriber, Subscriber, SubscriptionAggregator, SubscriptionAggregator, Synchronizer, Test, Test, TestCodeGeneratorHelper, TestExpression, ThrowException, ThrowModelError, TimedDelay, TimedDelay, TimedPlotter, TimedPlotter, TimedPlotter, Timer, TokenToExpression, TokenToExpression, Transition, TransitionRefinement, TransitionRefinement, TransitionRefinementPort, TransitionRefinementPort, TrigFunction, TrigFunction, TypedAtomicActor, TypedCompositeActor, TypedCompositeActor, TypedCompositeActor, TypedCompositeActor, TypedCompositeActor, TypedIOPort, TypedIOPort, UnaryMathFunction, UnaryMathFunction, Uniform, Uniform, UpSample, Variable, VariableDelay, VariableFIR, VariableLattice, VariableRecursiveLattice, VectorAssembler, VectorAssembler, VectorDisassembler, VectorDisassembler, WallClockTime, XYPlotter, XYScope

public interface ComponentCodeGenerator

Interface for components that can generate code. Classes that implement this interface are helper classes, closely associated with a specific Ptolemy II component (such as an actor), and able to generate code in some language to implement the functionality of that component.

Since:
Ptolemy II 6.0
Version:
$Id: ComponentCodeGenerator.java 57040 2010-01-27 20:52:32Z cxh $
Author:
Christopher Brooks, Edward Lee, Jackie Leung, Gang Zhou, Ye Zhou
Accepted Rating:
Yellow (eal)
Proposed Rating:
Yellow (eal)

Method Summary
 java.lang.String generateInitializeCode()
          Generate and return the code associated with initialization of the component.
 java.lang.String generateWrapupCode()
          Generate and return the code associated with wrapping up the component.
 NamedObj getComponent()
          Return the associated component.
 void setCodeGenerator(CodeGenerator codeGenerator)
          Set the code generator for the helper class implementing this interface.
 

Method Detail

generateInitializeCode

java.lang.String generateInitializeCode()
                                        throws IllegalActionException
Generate and return the code associated with initialization of the component.

Returns:
The initialize code of the component.
Throws:
IllegalActionException - If something goes wrong.

generateWrapupCode

java.lang.String generateWrapupCode()
                                    throws IllegalActionException
Generate and return the code associated with wrapping up the component.

Returns:
The wrapup code of the component.
Throws:
IllegalActionException - If something goes wrong.

getComponent

NamedObj getComponent()
Return the associated component.

Returns:
The component for which this is a helper to generate code.

setCodeGenerator

void setCodeGenerator(CodeGenerator codeGenerator)
Set the code generator for the helper class implementing this interface.

Parameters:
codeGenerator - The code generator to be set.