gov.llnl.babel.backend.rmi

Class RMI


public class RMI
extends java.lang.Object

Method Summary

static String
LangSpecificInit()
static void
declareStackArgs(LanguageWriterForC lw, Argument arg, Context context)
static void
declareStackReturn(LanguageWriterForC lw, Type type, boolean isCopy, Context context)
static void
declareStackSymbol(LanguageWriterForC lw, Type type, String var, int mode, boolean isCopy, boolean isReturn, Context context)
static String
getDataExt()
Returns the varialbe extension used to identify a temporary variable of for holding the pointer that inout arguments point to in serialization.
static String
getMethodExtension(Type t)
generate the proper method extension for packing or unpacking
static String
getReturnArgName()
Returns internal name of the return value.
static String
getSerializableExt()
Returns the varialbe extension used to identify a temporary variable of type sidl.io.Serializable.
static String
getStringExt()
Returns the varialbe extension used to identify a temporary variable of type String to be used for object connection.
static void
packArg(LanguageWriterForC lw, Context context, String packer_typename, String packer_varname, Argument arg, boolean reuseable)
generate the method call to pack an argument
static void
packType(LanguageWriterForC lw, Context context, String packer_typename, String packer_varname, Type type, String varname, String var, int mode, boolean isCopy, boolean reuseable, boolean isReturn)
generate the method call to pack an argument
static void
unpackArg(LanguageWriterForC lw, Context context, Extendable ext, String packer_typename, String packer_varname, Argument arg, boolean inIOR)
generate the method call to unpack an argument
static void
unpackType(LanguageWriterForC lw, Context context, Extendable ext, String packer_typename, String packer_varname, Type type, String varname, String var, int mode, boolean isCopy, boolean isReturn, boolean inIOR)
generate the method call to unpack an argument or return value

Method Details

LangSpecificInit

public static String LangSpecificInit()

declareStackArgs

public static void declareStackArgs(LanguageWriterForC lw,
                                    Argument arg,
                                    Context context)
            throws CodeGenerationException

declareStackReturn

public static void declareStackReturn(LanguageWriterForC lw,
                                      Type type,
                                      boolean isCopy,
                                      Context context)
            throws CodeGenerationException

declareStackSymbol

public static void declareStackSymbol(LanguageWriterForC lw,
                                      Type type,
                                      String var,
                                      int mode,
                                      boolean isCopy,
                                      boolean isReturn,
                                      Context context)
            throws CodeGenerationException

getDataExt

public static String getDataExt()
Returns the varialbe extension used to identify a temporary variable of for holding the pointer that inout arguments point to in serialization. ie: if we have an inout argument of type int, it is passed as an int32_t*. However, we must unserialize the actual integer somewhere. So: int32_t x_data = unserialize_int(); int32_t* x = &x_data; _retval = foo(x);

getMethodExtension

public static String getMethodExtension(Type t)
generate the proper method extension for packing or unpacking
Parameters:
t -

getReturnArgName

public static String getReturnArgName()
Returns internal name of the return value.

getSerializableExt

public static String getSerializableExt()
Returns the varialbe extension used to identify a temporary variable of type sidl.io.Serializable. (Used in object serialization)

getStringExt

public static String getStringExt()
Returns the varialbe extension used to identify a temporary variable of type String to be used for object connection.

packArg

public static void packArg(LanguageWriterForC lw,
                           Context context,
                           String packer_typename,
                           String packer_varname,
                           Argument arg,
                           boolean reuseable)
generate the method call to pack an argument
Parameters:
lw - The language writer to write to
packer_typename - The packer type (often sidl_rmi_Serializer)
packer_varname - The name of the packer object
arg - The Argument itself
reuseable - True if (when the argument is an array) babel should attempt to copy the new data into the old array.

packType

public static void packType(LanguageWriterForC lw,
                            Context context,
                            String packer_typename,
                            String packer_varname,
                            Type type,
                            String varname,
                            String var,
                            int mode,
                            boolean isCopy,
                            boolean reuseable,
                            boolean isReturn)
generate the method call to pack an argument
Parameters:
lw - The language writer to write to
packer_typename - The packer type (often sidl_rmi_Serializer)
packer_varname - The name of the packer object
varname - The name the argument is called in the serializer
var - The actual argument name (return = _retval)
mode - IN, OUT, or INOUT
isCopy - Serialize the argument if it is an object.
reuseable - True is (when the argument is an array) babel should attempt to copy the new data into the old array.
isReturn - If it's a return value (not an argument)

unpackArg

public static void unpackArg(LanguageWriterForC lw,
                             Context context,
                             Extendable ext,
                             String packer_typename,
                             String packer_varname,
                             Argument arg,
                             boolean inIOR)
            throws CodeGenerationException
generate the method call to unpack an argument
Parameters:
lw - The language writer to write to
ext - The Extendable this is being generated in
packer_typename - The packer type (often sidl_rmi_Serializer)
packer_varname - The name of the packer object
inIOR - True if this is being generated in thie IOR

unpackType

public static void unpackType(LanguageWriterForC lw,
                              Context context,
                              Extendable ext,
                              String packer_typename,
                              String packer_varname,
                              Type type,
                              String varname,
                              String var,
                              int mode,
                              boolean isCopy,
                              boolean isReturn,
                              boolean inIOR)
            throws CodeGenerationException
generate the method call to unpack an argument or return value
Parameters:
lw - The language writer to write to
ext - The Extendable this is being generated in
packer_typename - The packer type (often sidl_rmi_Serializer)
packer_varname - The name of the packer object
type - The Type
varname - The name the argument is called in the serializer
var - The actual argument name (return = _retval)
mode - IN, OUT, or INOUT
isCopy - Serialize the argument if it is an object.
isReturn - If it's a return value (not an argument)
inIOR - True if this is being generated in thie IOR