AnalysisSystemForRadionucli.../CplusToJava.h

45 lines
1.7 KiB
C
Raw Permalink Normal View History

2024-06-04 15:25:02 +08:00
#pragma once
#include "jni.h"
#include <QVector>
#include "armadillo"
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>java<76><61>sig<69><67>Ӧ
#define SIG_STRING "Ljava/lang/String;"
#define SIG_LIST "Ljava/util/List;"
#define SIG_DOUBLE "D"
#define SIG_INT "I"
#define SIG_LONG "J"
#define SIG_SHORT "S"
class CplusToJava
{
public:
static jobjectArray GetjobjectArray(JNIEnv* env, jclass jcls, jobject jstruct, std::string var);
//<2F><>QVector<double>ת<><D7AA>ΪjobjectArray
static jobjectArray QVectorD2jobjectArray(QVector<double> vec, JNIEnv* env);
//<2F><>QVector<QString>ת<><D7AA>ΪjobjectArray
static jobjectArray QVectorQS2jobjectArray(QVector<QString> vec, JNIEnv* env);
//<2F><>QVector<long>ת<><D7AA>ΪjobjectArray
static jobjectArray QVectorL2jobjectArray(QVector<long> vec, JNIEnv* env);
//<2F><>QVector<int>ת<><D7AA>ΪjobjectArray
static jobjectArray QVectorI2jobjectArray(QVector<int> vec, JNIEnv* env);
//<2F><>QVector<short>ת<><D7AA>ΪjobjectArray
static jobjectArray QVectorS2jobjectArray(QVector<short> vec, JNIEnv* env);
//<2F><><EFBFBD><EFBFBD>jobject
static jobject Createjobject(JNIEnv* env, jint esize, jobjectArray array);
//jobjectת<74><D7AA>ΪjobjectArray
static jobjectArray jobject2jobjectArray(JNIEnv* env, jobject array);
//<2F><>jobjectArrayת<79><D7AA>ΪQVector<double>
static QVector<double> jobjectArray2QVectorD(JNIEnv* env, jobjectArray listValue);
//<2F><>jstringת<67><D7AA>ΪQString
static QString jstring2QString(JNIEnv* env, jstring jstr);
//<2F><>jobjectArrayת<79><D7AA>Ϊvector<double>
static std::vector<double> jobjectArray2vectorD(JNIEnv* env, jobjectArray listValue);
//<2F><>vector<double>ת<><D7AA>ΪjobjectArray
static jobjectArray VectorD2jobjectArray(std::vector<double> vec, JNIEnv* env);
//<2F><>uvecתΪjobjectArray
static jobjectArray uvec2jobjectArray(arma::uvec vec, JNIEnv* env);
};