ptolemy.copernicus.c
Class ClassStructureGenerator

java.lang.Object
  extended by ptolemy.copernicus.c.CodeGenerator
      extended by ptolemy.copernicus.c.ClassStructureGenerator

public class ClassStructureGenerator
extends CodeGenerator

A file that generates code for the C structure corresponding to a class.

Since:
Ptolemy II 4.0
Version:
$Id: ClassStructureGenerator.java,v 1.23 2007/12/06 18:28:33 cxh Exp $
Author:
Ankush Varma
Accepted Rating:
Red (ssb)
Proposed Rating:
Red ()

Field Summary
 
Fields inherited from class ptolemy.copernicus.c.CodeGenerator
_context, _requiredTypeMap
 
Constructor Summary
ClassStructureGenerator(Context context)
          Default constructor.
 
Method Summary
 java.lang.String generate(soot.SootClass source)
          Generate the structure corresponding to a class.
 java.util.HashSet getArrayInstances()
          Get the set of Array instances required by the generated class.
 java.util.HashMap getRequiredTypeMap()
          Get the map of types required by the generated class.
 
Methods inherited from class ptolemy.copernicus.c.CodeGenerator
_comment, _generateArrayInstanceDeclarations, _generateIncludeDirectives, _generateMethodHeader, _generateParameterTypeList, _getRequiredIncludeFiles, _indent, _removeRequiredType, _updateRequiredTypes, _warn, setSingleClassMode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassStructureGenerator

public ClassStructureGenerator(Context context)
Default constructor.

Parameters:
context - The context to use for the generated code.
Method Detail

generate

public java.lang.String generate(soot.SootClass source)
Generate the structure corresponding to a class.

Specified by:
generate in class CodeGenerator
Parameters:
source - The class.
Returns:
The code for the C structure corresponding to this class.

getArrayInstances

public java.util.HashSet getArrayInstances()
Get the set of Array instances required by the generated class.

Returns:
The set of array instances in the local context.

getRequiredTypeMap

public java.util.HashMap getRequiredTypeMap()
Get the map of types required by the generated class.

Returns:
The _requiredTypeMap structure created while generating this class.