ujf.verimag.bip.codegen
Class InteractionPoint

java.lang.Object
  extended by ujf.verimag.bip.codegen.InteractionPoint

public class InteractionPoint
extends java.lang.Object

Class for describing interaction points within the C code. Interaction points are special function call and are described by their function prototype + function call.


Field Summary
 java.lang.String[] arguments_types
          The arguments types used by this interaction point.
 java.lang.String function_name
          The function name for this interaction point.
 java.lang.String return_type
          The return type for this interaction point
 
Constructor Summary
InteractionPoint(java.lang.String return_type, java.lang.String function_name, java.lang.String[] arguments)
          Creates a new interaction point.
 
Method Summary
 boolean equals(InteractionPoint ip)
          Test for equality between two interaction points.
 PortDefinition getCallPortDefinition(Module module, AtomType atomtype)
          Returns the port definition corresponding to the call part.
 PortDefinition getCallPortDefinition(Module module, AtomType atomtype, java.lang.String typePrefix)
          Returns the port definition corresponding to the call part.
 Variable[] getCallVariables(Module module, AtomType atomtype)
          Returns the data variables corresponding to the call part.
 Variable[] getCallVariables(Module module, AtomType atomtype, java.lang.String typePrefix)
          Returns the data variables corresponding to the call part.
 PortDefinition getReturnPortDefinition(Module module, AtomType atomtype)
          Returns the port definition corresponding to the return part.
 PortDefinition getReturnPortDefinition(Module module, AtomType atomtype, java.lang.String typePrefix)
          Returns the port definition corresponding to the return part.
 Variable getReturnVariable(Module module, AtomType atomtype)
          Returns the data variable corresponding to the return part.
 Variable getReturnVariable(Module module, AtomType atomtype, java.lang.String typePrefix)
          Returns the data variable corresponding to the return part.
<ReturnTypeClass extends CType>
boolean
matchFunctionCall( fcall)
          Checks if the interaction point matches a given function call.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

return_type

public final java.lang.String return_type
The return type for this interaction point


function_name

public final java.lang.String function_name
The function name for this interaction point.


arguments_types

public final java.lang.String[] arguments_types
The arguments types used by this interaction point.

Constructor Detail

InteractionPoint

public InteractionPoint(java.lang.String return_type,
                        java.lang.String function_name,
                        java.lang.String[] arguments)
Creates a new interaction point.

Parameters:
return_type - the return type
function_name - the function name corresponding to the interaction point
arguments - the arguments used by the function corresponding to the interaction point.
Method Detail

equals

public boolean equals(InteractionPoint ip)
Test for equality between two interaction points.

Parameters:
ip - the other interaction point.
Returns:
true if both interaction points are equal.

getCallPortDefinition

public PortDefinition getCallPortDefinition(Module module,
                                            AtomType atomtype,
                                            java.lang.String typePrefix)
Returns the port definition corresponding to the call part. It also creates required data/types within the BIP component.

Parameters:
module - the module in which the port definition should be created/searched for.
atomtype - the atom in that contains the port definition
typePrefix - a prefix to add to the port type name
Returns:
the port definition

getCallPortDefinition

public PortDefinition getCallPortDefinition(Module module,
                                            AtomType atomtype)
Returns the port definition corresponding to the call part. It also creates required data/types within the BIP component (if needed).

Parameters:
module - the module in which the port definition should be created/searched for.
atomtype - the atom that contains the port definition
Returns:
the port definition

getReturnPortDefinition

public PortDefinition getReturnPortDefinition(Module module,
                                              AtomType atomtype)
Returns the port definition corresponding to the return part. It also creates required data/types within the BIP component (if needed).

Parameters:
module - the module in which the port definition should be created/searched for.
atomtype - the atom that contains the port definition
Returns:
the port definition

getReturnPortDefinition

public PortDefinition getReturnPortDefinition(Module module,
                                              AtomType atomtype,
                                              java.lang.String typePrefix)
Returns the port definition corresponding to the return part. It also creates required data/types within the BIP component (if needed).

Parameters:
module - the module in which the port definition should be created/searched for.
atomtype - the atom that contains the port definition
typePrefix - a prefix to add to the port type name
Returns:
the port definition

getReturnVariable

public Variable getReturnVariable(Module module,
                                  AtomType atomtype,
                                  java.lang.String typePrefix)
Returns the data variable corresponding to the return part. It also creates required data/types within the BIP component (if needed).

Parameters:
module - the module in which the port definition should be created/searched for.
atomtype - the atom that contains the data variable
typePrefix - a prefix to add to the port type name
Returns:
the data variable

getReturnVariable

public Variable getReturnVariable(Module module,
                                  AtomType atomtype)
Returns the data variable corresponding to the return part. It also creates required data/types within the BIP component (if needed).

Parameters:
module - the module in which the port definition should be created/searched for.
atomtype - the atom that contains the data variable
Returns:
the data variable

getCallVariables

public Variable[] getCallVariables(Module module,
                                   AtomType atomtype,
                                   java.lang.String typePrefix)
Returns the data variables corresponding to the call part. It also creates required data/types within the BIP component (if needed).

Parameters:
module - the module in which the port definition should be created/searched for.
atomtype - the atom that contains the data variable
typePrefix - a prefix to add to the port type name
Returns:
an array with the data variables

getCallVariables

public Variable[] getCallVariables(Module module,
                                   AtomType atomtype)
Returns the data variables corresponding to the call part. It also creates required data/types within the BIP component (if needed).

Parameters:
module - the module in which the port definition should be created/searched for.
atomtype - the atom that contains the data variable
Returns:
an array with the data variables

matchFunctionCall

public <ReturnTypeClass extends CType> boolean matchFunctionCall( fcall)
Checks if the interaction point matches a given function call.

Type Parameters:
ReturnTypeClass -
Parameters:
fcall - the function call object
Returns:
true if it matches, false if not. It can return false in doubt (eg. function pointer).