gov.llnl.babel.backend.ucxx

Class CxxStubHeader


public class CxxStubHeader
extends java.lang.Object

Constructor Summary

CxxStubHeader(Extendable ext, Context context)
Create an object capable of generating the header file for a BABEL extendable.
CxxStubHeader(Extendable ext, LanguageWriterForCxx writer, Context context)
Special constructor for generating super methods for IMPL files.

Method Summary

void
generateCode()
Generate the header file for the extendable with which this object was created.
void
generateEndIncludes()
void
generateFrontIncludes()
static void
generateSupers(Class cls, LanguageWriterForCxx writer, Context context)
This is a convenience utility function specifically for the generation of super "Stub" functions in the Impl files.

Constructor Details

CxxStubHeader

public CxxStubHeader(Extendable ext,
                     Context context)
Create an object capable of generating the header file for a BABEL extendable.
Parameters:
ext - an interface or class symbol that needs a header file for a Cxx C extension class.

CxxStubHeader

public CxxStubHeader(Extendable ext,
                     LanguageWriterForCxx writer,
                     Context context)
Special constructor for generating super methods for IMPL files. Since these can only exist for classes, d_self is just "self"
Parameters:
ext - an interface or class symbol that needs a header file for a Cxx C extension class.

Method Details

generateCode

public void generateCode()
            throws CodeGenerationException
Generate the header file for the extendable with which this object was created.
Throws:
CodeGenerationException - this is a catch all exception for problems during the code generation phase.

generateEndIncludes

public void generateEndIncludes()
            throws CodeGenerationException

generateFrontIncludes

public void generateFrontIncludes()
            throws CodeGenerationException

generateSupers

public static void generateSupers(Class cls,
                                  LanguageWriterForCxx writer,
                                  Context context)
            throws CodeGenerationException
This is a convenience utility function specifically for the generation of super "Stub" functions in the Impl files. The output stream is not closed on exit. A code generation exception is thrown if an error is detected.
Parameters:
cls - The class in which these supers are to be generated
writer - the output writer to which the stub source will be written. This will not be closed.
Throws:
CodeGenerationException - this is a catch all exception. It can be caused by I/O trouble or violations of the data type invariants.