|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectptolemy.copernicus.c.NativeMethodGenerator
public class NativeMethodGenerator
A class that handles generation and management of native methods. It uses stub files. A "stub" file for a native method contains an appropriate definition and returns data of the appropriate type, but does not encapsulate any functionality. It is there to allow the code to be compiled. The approach taken is that when a native method's code is asked for, it returns the pre-defined C code for the method from a library. However, if the body of the method has not been defined, then it simply generates a stub for the method. The native method code is stored in a directory (nativeLib). However, this does not contain any body code for the methods. The body codes for methods are stored in the directory nativeBodyLib. If a method's body code exists in nativeBodyLib, then its code in nativeLib will just have a #include for the file containing the body code. If the method's body code does not exist in nativeBodyLib, then its code in nativeLib will be a stub.
| Red (ankush) |
| Red (ankush) |
| Field Summary | |
|---|---|
static java.lang.String |
nativeLib
The location of the native library methods. |
| Constructor Summary | |
|---|---|
NativeMethodGenerator()
|
|
| Method Summary | |
|---|---|
static java.lang.String |
fileContainingCodeFor(soot.SootMethod method)
Return the name of the file where the C code for a native method should be. |
static void |
generateStub(soot.SootMethod method)
Generates a stub file for the given native method. |
static java.lang.String |
getCode(soot.SootMethod method)
Reads the corresponding file for the native method code and returns it. |
static java.lang.String |
getNativeBodyLib()
Returns the location of the hand-coded native library method bodies. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String nativeLib
| Constructor Detail |
|---|
public NativeMethodGenerator()
| Method Detail |
|---|
public static java.lang.String fileContainingCodeFor(soot.SootMethod method)
method - The method.
public static void generateStub(soot.SootMethod method)
method - The method for which a stub is needed.public static java.lang.String getCode(soot.SootMethod method)
method - The Native method for which the code is needed.
public static java.lang.String getNativeBodyLib()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||