public class CompiledCompositeActor extends TypedCompositeActor
red (zgang) |
red (zgang) |
CompositeEntity.ContainedObjectsIterator
Modifier and Type | Field and Description |
---|---|
FileParameter |
codeDirectory
The directory in which to put the generated code.
|
Parameter |
executeEmbeddedCode
If true, then invoke the generated code in the action methods
(fire(), etc.).
|
StringParameter |
generatorPackage
The name of the package in which to look for adapter class
code generators.
|
Parameter |
inline
If true, generate file with no functions.
|
Parameter |
overwriteFiles
If true, overwrite preexisting files.
|
_actorFiringListeners, _causalityInterface, _derivedPiggybacks, _initializables, _notifyingActorFiring, _piggybacks, _publishedPorts, _publisherRelations, _stopRequested, _subscribedPorts
_levelCrossingLinks
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
COMPLETED, NOT_READY, STOP_ITERATING
Constructor and Description |
---|
CompiledCompositeActor()
Construct a CodeGenerationCompositeActor in the default workspace
with no container and an empty string as its name.
|
CompiledCompositeActor(CompositeEntity container,
java.lang.String name)
Create an actor with a name and a container.
|
CompiledCompositeActor(Workspace workspace)
Construct a CodeGenerationCompositeActor in the specified workspace
with no container and an empty string as a name.
|
Modifier and Type | Method and Description |
---|---|
protected void |
_compileJNICode()
Compile the Java code.
|
protected void |
_generateAndCompileEmbeddedCode()
Generate and compile Java code.
|
protected void |
_generateAndCompileJNICode()
Generate and compile the JNI code.
|
void |
fire()
If executeEmbeddedCode is true, then execute the fire() method
of the generated code.
|
java.lang.String |
getSanitizedName()
Return the sanitized file name of this actor.
|
void |
initialize()
If executeEmbeddedCode is true, then generate and compile the
code (if necessary), and then execute the initialize() method
of the generated code.
|
void |
wrapup()
If executeEmbeddedCode is true, then execute the wrapup() method
of the generated code.
|
_addEntity, _addPort, _addRelation, _checkTypesFromTo, _destinationTypeConstraints, attributeChanged, attributeTypeChanged, isBackwardTypeInferenceEnabled, newPort, newRelation, resolveTypes, typeConstraintList, typeConstraints
_actorFiring, _actorFiring, _finishedAddEntity, _setDirector, _transferPortParameterInputs, addActorFiringListener, addInitializable, addPiggyback, clone, connectionsChanged, createReceivers, createSchedule, getCausalityInterface, getDirector, getExecutiveDirector, getManager, getPublishedPort, getPublishedPortChannel, getPublishedPorts, getSubscribedPortChannel, inferringWidths, inferWidths, inputPortList, isFireFunctional, isOpaque, isPublishedPort, isStrict, iterate, linkToPublishedPort, linkToPublishedPort, linkToPublishedPort, linkToPublishedPort, needsWidthInference, newInsideReceiver, newReceiver, notifyConnectivityChange, outputPortList, postfire, prefire, preinitialize, recordFiring, registerPublisherPort, registerPublisherPort, removeActorFiringListener, removeInitializable, removePiggyback, requestChange, setContainer, setDirector, setManager, stop, stopFire, terminate, unlinkToPublishedPort, unlinkToPublishedPort, unlinkToPublishedPort, unlinkToPublishedPort, unregisterPublisherPort, unregisterPublisherPort
_adjustDeferrals, _containedDecorators, _deepOpaqueEntityList, _description, _exportMoMLContents, _removeEntity, _removeRelation, _validateSettables, allAtomicEntityList, allowLevelCrossingConnect, classDefinitionList, connect, connect, containedObjectsIterator, deepCompositeEntityList, deepEntityList, deepGetEntities, deepNamedObjList, deepOpaqueEntityList, deepRelationSet, entityList, entityList, exportLinks, exportMoML, getAttribute, getEntities, getEntity, getPort, getRelation, getRelations, isAtomic, lazyAllAtomicEntityList, lazyAllCompositeEntityList, lazyAllCompositeTransparentAndOpaqueEntityList, lazyClassDefinitionList, lazyDeepEntityList, lazyEntityList, lazyRelationList, numberOfEntities, numberOfRelations, numEntities, numRelations, relationList, removeAllEntities, removeAllRelations, setClassDefinition, statistics, uniqueName
_checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, propagateExistence, setName
_removePort, connectedPortList, connectedPorts, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts
_setParent, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition, isWithinClassDefinition
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _executeChangeRequests, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, addHierarchyListener, attributeDeleted, attributeList, attributeList, clone, decorators, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getFullName, getModelErrorHandler, getName, getName, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, notifyOfNameChange, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, validateSettables, workspace
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
createReceivers, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, newReceiver, outputPortList
isFireFunctional, isStrict, iterate, postfire, prefire, stop, stopFire, terminate
addInitializable, preinitialize, removeInitializable
description, getContainer, getDisplayName, getFullName, getName, getName, setName
getDerivedLevel, getDerivedList, propagateValue
public FileParameter codeDirectory
public StringParameter generatorPackage
public Parameter inline
public Parameter executeEmbeddedCode
public Parameter overwriteFiles
public CompiledCompositeActor()
public CompiledCompositeActor(CompositeEntity container, java.lang.String name) throws IllegalActionException, NameDuplicationException
container
- The container actor.name
- The name of this actor.IllegalActionException
- If the container is incompatible
with this actor.NameDuplicationException
- If the name coincides with
an actor already in the container.public CompiledCompositeActor(Workspace workspace)
workspace
- The workspace that will list the actor.public void fire() throws IllegalActionException
fire
in interface Executable
fire
in class CompositeActor
IllegalActionException
- If thrown by the super
class, or if there are problems invoking the fire() method of
wrapper class.public java.lang.String getSanitizedName()
StringUtilities.sanitizeName(String)
,
removing underscores and appending a version number.
The version number is necessary so that we can reload the
shared object.public void initialize() throws IllegalActionException
initialize
in interface Initializable
initialize
in class CompositeActor
IllegalActionException
- If there is no director, or
if the director's initialize() method throws it, or if the
actor is not opaque.public void wrapup() throws IllegalActionException
wrapup
in interface Initializable
wrapup
in class CompositeActor
IllegalActionException
- If there is no director,
or if the director's wrapup() method throws it, or if this
actor is not opaque.protected void _compileJNICode() throws IllegalActionException
javac
and javah
commands are
executed on the the java file.IllegalActionException
- If there is a problem reading
the codeDirectory parameter.protected void _generateAndCompileEmbeddedCode() throws IllegalActionException
IllegalActionException
- If the adapter class cannot
be found, or if the static generateCode(TypedCompositeActor)
method in the adapter class cannot be found or invoked.protected void _generateAndCompileJNICode() throws IllegalActionException
IllegalActionException
- If thrown while getting the path
to the shared object, while writing the Java file, or while
compiling the Java file.