2026-01-28 12:00:40 +08:00
|
|
|
import java.util.Vector;
|
|
|
|
|
|
|
|
|
|
public class ExpFctsHelper {
|
|
|
|
|
|
|
|
|
|
/**
|
2026-01-28 13:50:59 +08:00
|
|
|
* The class represent a single parameter (argument) of function.
|
2026-01-28 12:00:40 +08:00
|
|
|
*/
|
|
|
|
|
public static class ExpFctParam {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The type of this parameter.
|
|
|
|
|
*/
|
2026-01-28 13:50:59 +08:00
|
|
|
public String mVarType;
|
2026-01-28 12:00:40 +08:00
|
|
|
/**
|
|
|
|
|
* The name of this parameter.
|
|
|
|
|
*/
|
|
|
|
|
public String mVarName;
|
|
|
|
|
/**
|
2026-01-28 13:50:59 +08:00
|
|
|
* True if this parameter is marked as input parameter, otherwise false.
|
2026-01-28 12:00:40 +08:00
|
|
|
* <p>
|
2026-01-28 13:50:59 +08:00
|
|
|
* Input parameter and output parameter is commonly used in C/C++ code. By using
|
2026-01-28 12:00:40 +08:00
|
|
|
* this feature, each function can receive multiple arguments and return
|
|
|
|
|
* multiple arguments without defining a struct to hold it.
|
|
|
|
|
* <p>
|
|
|
|
|
* The type of input parameter is itself. However, the type of output parameter
|
|
|
|
|
* is the pointer of itself. So you may need get its pointer type when
|
2026-01-28 13:50:59 +08:00
|
|
|
* processing output parameter, especially for the scenario that the target
|
2026-01-28 12:00:40 +08:00
|
|
|
* language do not support explicit output parameter keyword.
|
|
|
|
|
*/
|
|
|
|
|
public boolean mIsInput;
|
|
|
|
|
/**
|
|
|
|
|
* The description of this parameter.
|
|
|
|
|
* <p>
|
|
|
|
|
* This description is generated by this program. It will indicate the
|
2026-01-28 13:50:59 +08:00
|
|
|
* underlying C++ type to tell end user how to treat this parameter because some
|
2026-01-28 12:00:40 +08:00
|
|
|
* target languages' native calling style can not represent these detail.
|
|
|
|
|
* <p>
|
|
|
|
|
* In this program, this field must be written as a annotation of corresponding
|
|
|
|
|
* function.
|
|
|
|
|
*/
|
|
|
|
|
public String mVarDesc;
|
|
|
|
|
|
|
|
|
|
public ExpFctParam() {
|
2026-01-28 13:50:59 +08:00
|
|
|
mVarType = "";
|
2026-01-28 12:00:40 +08:00
|
|
|
mVarName = "";
|
|
|
|
|
mVarDesc = "";
|
|
|
|
|
mIsInput = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The class represent an export BMap function.
|
|
|
|
|
*/
|
|
|
|
|
public static class ExpFct {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The name of this function.
|
|
|
|
|
*/
|
|
|
|
|
public String mFctName;
|
|
|
|
|
/**
|
|
|
|
|
* The return value type of this function.
|
|
|
|
|
*/
|
2026-01-28 13:50:59 +08:00
|
|
|
public String mFctRvType;
|
2026-01-28 12:00:40 +08:00
|
|
|
/**
|
2026-01-28 13:50:59 +08:00
|
|
|
* The parameters (arguments) list of this function. Each item are
|
2026-01-28 12:00:40 +08:00
|
|
|
* {@linkplain ExpFctParam} and represent parameter one by one from left to
|
|
|
|
|
* right.
|
|
|
|
|
*/
|
|
|
|
|
public Vector<ExpFctParam> mFctParams;
|
|
|
|
|
|
|
|
|
|
public ExpFct() {
|
|
|
|
|
mFctName = "";
|
2026-01-28 13:50:59 +08:00
|
|
|
mFctRvType = "";
|
2026-01-28 12:00:40 +08:00
|
|
|
mFctParams = new Vector<ExpFctParam>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The class represent a collection of export BMap functions.
|
|
|
|
|
*/
|
|
|
|
|
public static class ExpFctCollection {
|
|
|
|
|
/**
|
|
|
|
|
* The collection of exported BMap functions.
|
|
|
|
|
*/
|
|
|
|
|
public Vector<ExpFct> mFcts;
|
|
|
|
|
|
|
|
|
|
public ExpFctCollection() {
|
|
|
|
|
mFcts = new Vector<ExpFct>();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|