ptolemy.actor.lib.jni
Class EmbeddedCFileActor
java.lang.Object
ptolemy.kernel.util.NamedObj
ptolemy.kernel.InstantiableNamedObj
ptolemy.kernel.Entity
ptolemy.kernel.ComponentEntity
ptolemy.kernel.CompositeEntity
ptolemy.actor.CompositeActor
ptolemy.actor.TypedCompositeActor
ptolemy.actor.lib.jni.CompiledCompositeActor
ptolemy.actor.lib.jni.EmbeddedCActor
ptolemy.actor.lib.jni.EmbeddedCFileActor
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, Actor, Executable, FiringsRecordable, Initializable, TypedActor, Changeable, Debuggable, DebugListener, Derivable, Instantiable, ModelErrorHandler, MoMLExportable, Moveable, Nameable
public class EmbeddedCFileActor
- extends EmbeddedCActor
The embeddedCFileActor executes compiled embedded C Code.
This actor extends the EmbeddedCActor and has most of the same
functionality. The only difference is that a file specifying the C
code can be passed into the actor as a parameter to avoid having
multiple instances of the same code in different copies of the
EmbeddedCActor.
- Since:
- Ptolemy II 8.0
- Version:
- $Id: EmbeddedCFileActor.java 57044 2010-01-27 22:41:05Z cxh $
- Author:
- Christine Avanessians, Edward Lee, and Man-Kit Leung
- See Also:
- Serialized Form
- Accepted Rating:
- Proposed Rating:
Field Summary |
FileParameter |
codeBlockFile
The file parameter that specifies the file that contains the C Code that
this actor should use during execution and/or code generation. |
Fields inherited from class ptolemy.kernel.util.NamedObj |
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS |
Method Summary |
protected void |
_generateAndCompileCCode()
Generate and compile the code. |
void |
changeEmbeddedCCode()
Set the embeddedCCode parameter in the EmbeddedCActor to
contain the contents of the file specifed by codeBlockFile. |
protected void |
setEmbeddedActor()
Create a new instance of EmbeddedFileActor and set _embeddedActor in the
embeddedCActor. |
Methods inherited from class ptolemy.actor.CompositeActor |
_actorFiring, _actorFiring, _finishedAddEntity, _getPublishedPort, _setDirector, addActorFiringListener, addInitializable, addPiggyback, clone, connectionsChanged, createReceivers, createSchedule, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inferringWidths, inferWidths, inputPortList, isFireFunctional, isOpaque, isStrict, iterate, linkToPublishedPort, linkToPublishedPort, needsWidthInference, newInsideReceiver, newReceiver, notifyConnectivityChange, outputPortList, postfire, prefire, recordFiring, registerPublisherPort, removeActorFiringListener, removeInitializable, removePiggyback, requestChange, setContainer, setDirector, setManager, stop, stopFire, terminate, unlinkToPublishedPort, unlinkToPublishedPort, unregisterPublisherPort |
Methods inherited from class ptolemy.kernel.CompositeEntity |
_adjustDeferrals, _deepOpaqueEntityList, _description, _exportMoMLContents, _recordDecoratedAttributes, _removeEntity, _removeRelation, _validateSettables, allAtomicEntityList, allCompositeEntityList, allowLevelCrossingConnect, classDefinitionList, connect, connect, containedObjectsIterator, deepEntityList, deepGetEntities, deepOpaqueEntityList, deepRelationSet, entityList, entityList, exportLinks, exportMoML, getAttribute, getEntities, getEntity, getPort, getRelation, getRelations, isAtomic, lazyAllAtomicEntityList, lazyAllCompositeEntityList, lazyClassDefinitionList, lazyDeepEntityList, lazyEntityList, lazyRelationList, numberOfEntities, numberOfRelations, numEntities, numRelations, relationList, removeAllEntities, removeAllRelations, setClassDefinition, statistics, uniqueName |
Methods inherited from class ptolemy.kernel.ComponentEntity |
_checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, propagateExistence, setName |
Methods inherited from class ptolemy.kernel.util.NamedObj |
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _debug, _debug, _debug, _debug, _debug, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, attributeChanged, attributeList, attributeList, attributeTypeChanged, clone, 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, propagateValue, propagateValues, removeChangeListener, removeDebugListener, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, validateSettables, workspace |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
codeBlockFile
public FileParameter codeBlockFile
- The file parameter that specifies the file that contains the C Code that
this actor should use during execution and/or code generation.
EmbeddedCFileActor
public EmbeddedCFileActor(CompositeEntity container,
java.lang.String name)
throws NameDuplicationException,
IllegalActionException
- Construct an actor with the given container and name.
Invoke the super class constructor and create the
codeBlockFile file parameter and initialize
it to the empty string.
- Parameters:
container
- The container.name
- The name of this actor.
- Throws:
NameDuplicationException
- If the container already
has an actor with this name.
IllegalActionException
- If the actor cannot be contained
by the proposed container.
changeEmbeddedCCode
public void changeEmbeddedCCode()
throws IllegalActionException
- Set the embeddedCCode parameter in the EmbeddedCActor to
contain the contents of the file specifed by codeBlockFile.
- Throws:
IllegalActionException
- If there is a problem reading
the code block file.
_generateAndCompileCCode
protected void _generateAndCompileCCode()
throws IllegalActionException
- Generate and compile the code.
This method calls
changeEmbeddedCCode()
and then
generates adn compiles the code.
- Overrides:
_generateAndCompileCCode
in class CompiledCompositeActor
- Throws:
IllegalActionException
- If the helper class cannot
be found, or if the static generateCode(TypedCompositeActor)
method in the helper class cannot be found or invoked.
setEmbeddedActor
protected void setEmbeddedActor()
throws IllegalActionException,
NameDuplicationException
- Create a new instance of EmbeddedFileActor and set _embeddedActor in the
embeddedCActor.
- Overrides:
setEmbeddedActor
in class EmbeddedCActor
- Throws:
NameDuplicationException
- If the container already
has an actor with this name.
IllegalActionException
- If the actor cannot be contained
by the proposed container.