at.dms.kjc.slicegraph
Class FileOutputContent

java.lang.Object
  extended by at.dms.kjc.slicegraph.FilterContent
      extended by at.dms.kjc.slicegraph.PredefinedContent
          extended by at.dms.kjc.slicegraph.OutputContent
              extended by at.dms.kjc.slicegraph.FileOutputContent
All Implemented Interfaces:
SIRCodeUnit

public class FileOutputContent
extends OutputContent

Predefined FilterContent for file output, expands to implement a FileWriter.

Author:
jasperln

Field Summary
 
Fields inherited from class at.dms.kjc.slicegraph.FilterContent
initFunction, inputType, my_unique_ID, outputType, prework, steady
 
Constructor Summary
FileOutputContent(FileOutputContent content)
          Copy constructor for FileOutputContent.
FileOutputContent(SIRFileWriter filter)
          Construct FileInputContent from SIRFileWriter.
FileOutputContent(UnflatFilter unflat)
          Construct FileInputContent from UnflatFilter.
 
Method Summary
 JStatement closeFile()
          Return a statement closing the file.
 void createContent()
          Create kopi code that when translated to C will manipulate the file.
 String getFileName()
          Returns filename of FileOutputContent.
 int getOutputs()
          Returns expected number of outputs.
 CType getType()
          Get the type of the file writer .
 boolean isFP()
          Returns if output format of file is floating point.
 void setOutputs(int i)
          Sets expected number of outputs.
 
Methods inherited from class at.dms.kjc.slicegraph.FilterContent
addAField, addAMethod, addField, addFields, addMethod, addMethods, getArray, getBegin, getConstant, getEnd, getFields, getInit, getInitMult, getInitWork, getInputType, getMethods, getName, getOutputType, getPeek, getPeekInt, getPopCount, getPopInt, getPos, getPrework, getPreworkPeek, getPreworkPop, getPreworkPush, getPushInt, getSteadyList, getSteadyMult, getTotal, getWork, initItemsNeeded, initItemsPushed, isLinear, isTwoStage, multSteadyMult, setArray, setBegin, setEnd, setFields, setInitMult, setMethods, setPos, setPrework, setSteadyMult, setTheMethods, setTotal, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FileOutputContent

public FileOutputContent(FileOutputContent content)
Copy constructor for FileOutputContent.

Parameters:
content - The FileOutputContent to copy.

FileOutputContent

public FileOutputContent(SIRFileWriter filter)
Construct FileInputContent from SIRFileWriter.

Parameters:
filter - The SIRFileWriter used to contruct the FileInputContent.

FileOutputContent

public FileOutputContent(UnflatFilter unflat)
Construct FileInputContent from UnflatFilter.

Parameters:
unflat - The UnflatFilter used to contruct the FileInputContent.
Method Detail

getOutputs

public int getOutputs()
Returns expected number of outputs.


setOutputs

public void setOutputs(int i)
Sets expected number of outputs.


getFileName

public String getFileName()
Returns filename of FileOutputContent.


getType

public CType getType()
Get the type of the file writer .

Returns:
The type.

isFP

public boolean isFP()
Returns if output format of file is floating point.


closeFile

public JStatement closeFile()
Return a statement closing the file. Only valid after calling createContent().

Returns:
statement to put in cleanup section of code.

createContent

public void createContent()
Create kopi code that when translated to C will manipulate the file. The C file will need to include

Specified by:
createContent in class OutputContent