33 #ifndef TYPE_CONVERTER_H
34 #define TYPE_CONVERTER_H
70 jstring
stringC2J(JNIEnv *env,
const char* s);
84 std::string
stringJ2C(JNIEnv *env, jstring
const& s);
102 std::vector<std::string>
const& strings);
117 JNIEnv *env, jobjectArray
const& array);
125 return b == JNI_TRUE;
134 return b ? JNI_TRUE : JNI_FALSE;
300 std::vector<std::pair<void*, const ug::bridge::ClassNameNode*> >& pv
411 jobjectArray
const& array);
421 JNIEnv *env, std::string className);
431 JNIEnv *env, jclass elementClass);
449 jobject
getClass(JNIEnv *env, jobject obj);
491 bool allowSmartToRawPtrConversion =
false);
Definition: smart_pointer.h:650
Definition: smart_pointer.h:525
Instances of this class or of derived classes are thrown if errors arise.
Definition: error.h:104
Type
Definition: variant.h:89
node for class names
Definition: class_name_provider.h:65
Base class for exported Classes.
Definition: class.h:499
a stack holding parameter infos about a parameter stack
Definition: parameter_stack.h:73
A stack that can hold values together with their type-id.
Definition: parameter_stack.h:270
Registry for functions and classes that are exported to scripts and visualizations.
Definition: registry.h:138
unsigned int uint
Definition: types.h:114
std::vector< std::string > stringArrayJ2C(JNIEnv *env, jobjectArray const &array)
Definition: type_converter.cpp:146
bool boolJ2C(jboolean b)
Definition: type_converter.h:124
bool isJSmartPointerConst(JNIEnv *env, jobject ptr)
Definition: type_converter.cpp:420
std::string getParamClassName(JNIEnv *env, jobject obj)
Definition: type_converter.cpp:532
void invalidateJSmartPointer(JNIEnv *env, jobject obj)
Definition: type_converter.cpp:312
jobject intVector2JObject(JNIEnv *env, const std::vector< int > &iv)
Definition: type_converter.cpp:1460
bool compareParamTypes(JNIEnv *env, jobjectArray params, ug::bridge::Registry *reg, ug::bridge::ParameterInfo const ¶mStack, bool allowSmartToRawPtrConversion)
Definition: type_converter.cpp:813
std::string getParamTypeAsString(const uint type)
Definition: type_converter.cpp:622
void jObject2stdStringVector(JNIEnv *env, jobject object, std::vector< std::string > &sv)
Definition: type_converter.cpp:1326
void jObject2IntVector(JNIEnv *env, jobject object, std::vector< int > &iv)
Definition: type_converter.cpp:1284
const std::vector< const ug::bridge::IExportedClass * > getParentClasses(ug::bridge::Registry *reg, const ug::bridge::IExportedClass *clazz)
Definition: type_converter.cpp:164
void jObject2SizetVector(JNIEnv *env, jobject object, std::vector< size_t > &stv)
Definition: type_converter.cpp:1298
jobject sizetVector2JObject(JNIEnv *env, const std::vector< size_t > &iv)
Definition: type_converter.cpp:1474
jobject boolean2JObject(JNIEnv *env, jboolean value)
Definition: type_converter.cpp:205
jobjectArray stringArrayC2J(JNIEnv *env, const std::string *strings, const size_t array_length)
Definition: type_converter.cpp:59
jobject boolVector2JObject(JNIEnv *env, const std::vector< bool > &bv)
Definition: type_converter.cpp:1445
jobject getClass(JNIEnv *env, jobject obj)
Definition: type_converter.cpp:508
std::string stringJ2C(JNIEnv *env, jstring const &s)
Definition: type_converter.cpp:52
jobject constSmartPtrVector2JObject(JNIEnv *env, const std::vector< ConstSmartPtr< void > > &pv)
Definition: type_converter.cpp:1572
jobject numberVector2JObject(JNIEnv *env, const std::vector< number > &nv)
Definition: type_converter.cpp:1488
jdouble jObject2Double(JNIEnv *env, jobject obj)
Definition: type_converter.cpp:199
std::vector< const char * > getBaseClassNames(const ug::bridge::ClassNameNode *node)
Definition: type_converter.cpp:217
std::string jPointerGetName(JNIEnv *env, jobject obj)
Definition: type_converter.cpp:249
jint jObject2Int(JNIEnv *env, jobject obj)
Definition: type_converter.cpp:187
void jObject2BoolVector(JNIEnv *env, jobject object, std::vector< bool > &bv)
Definition: type_converter.cpp:1270
jobject int2JObject(JNIEnv *env, jint value)
Definition: type_converter.cpp:181
jobject constSmartPointer2JObject(JNIEnv *env, ConstSmartPtr< void > value)
Definition: type_converter.cpp:397
bool isJObjectAnArray(JNIEnv *env, jobject value)
Definition: type_converter.cpp:1257
void * jObject2Pointer(JNIEnv *env, jobject obj)
Definition: type_converter.cpp:236
jobject smartPointer2JObject(JNIEnv *env, SmartPtr< void > value)
Definition: type_converter.cpp:374
std::string getClassName(JNIEnv *env, jobject obj)
Definition: type_converter.cpp:517
jboolean jObject2Boolean(JNIEnv *env, jobject obj)
Definition: type_converter.cpp:211
jobject pointer2JObject(JNIEnv *env, void *value)
Definition: type_converter.cpp:352
jobject param2JObject(JNIEnv *env, ug::bridge::ParameterStack ¶ms, size_t index)
Definition: type_converter.cpp:1192
jstring stringC2J(JNIEnv *env, const char *s)
Definition: type_converter.cpp:48
jobject constPointer2JObject(JNIEnv *env, const void *value)
Definition: type_converter.cpp:363
void throwUgErrorAsJavaException(JNIEnv *env, ug::UGError error)
Definition: type_converter.cpp:447
jboolean boolC2J(bool b)
Definition: type_converter.h:133
void jobjectArray2ParamStack(JNIEnv *env, ug::bridge::Registry *reg, ug::bridge::ParameterStack ¶msOut, const ug::bridge::ParameterInfo ¶msTemplate, jobjectArray const &array)
Definition: type_converter.cpp:956
jobject smartPtrVector2JObject(JNIEnv *env, const std::vector< SmartPtr< void > > &pv)
Definition: type_converter.cpp:1558
void jObject2ConstSmartPtrVector(JNIEnv *env, jobject object, ug::Variant::Type jo_type, ug::bridge::Registry *reg, std::vector< std::pair< ConstSmartPtr< void >, const ug::bridge::ClassNameNode * > > &pv)
Definition: type_converter.cpp:1409
jobject stdStringVector2JObject(JNIEnv *env, const std::vector< std::string > &sv)
Definition: type_converter.cpp:1516
void jObject2PtrVector(JNIEnv *env, jobject object, ug::Variant::Type jo_type, ug::bridge::Registry *reg, std::vector< std::pair< void *, const ug::bridge::ClassNameNode * > > &pv)
Definition: type_converter.cpp:1341
jobject cStringVector2JObject(JNIEnv *env, const std::vector< const char * > &sv)
Definition: type_converter.cpp:1502
jobject registry2NativeAPI(JNIEnv *env, ug::bridge::Registry *reg)
Definition: type_converter.cpp:2169
jobject constPtrVector2JObject(JNIEnv *env, const std::vector< const void * > &pv)
Definition: type_converter.cpp:1544
void jObject2SmartPtrVector(JNIEnv *env, jobject object, ug::bridge::Registry *reg, std::vector< std::pair< SmartPtr< void >, const ug::bridge::ClassNameNode * > > &pv)
Definition: type_converter.cpp:1382
jobject double2JObject(JNIEnv *env, jdouble value)
Definition: type_converter.cpp:193
void jObject2NumberVector(JNIEnv *env, jobject object, std::vector< number > &nv)
Definition: type_converter.cpp:1312
jobject ptrVector2JObject(JNIEnv *env, const std::vector< void * > &pv)
Definition: type_converter.cpp:1530
void invalidateJConstSmartPointer(JNIEnv *env, jobject obj)
Definition: type_converter.cpp:332
jobjectArray createEmptyJavaArray(JNIEnv *env, std::string className)
Definition: type_converter.cpp:91
TypeAndArray paramClass2ParamType(JNIEnv *env, jobject obj)
Definition: type_converter.cpp:677
bool isConstJPtr(JNIEnv *env, jobject obj)
Definition: type_converter.cpp:226
std::string getParamTypesAsString(JNIEnv *env, jobjectArray const &array)
Definition: type_converter.cpp:922
jobject string2JObject(JNIEnv *env, const char *value)
Definition: type_converter.cpp:439
std::string jObject2String(JNIEnv *env, jobject obj)
Definition: type_converter.cpp:443
Definition: type_converter.h:59
bool isArray
Definition: type_converter.h:61
ug::Variant::Type type
Definition: type_converter.h:60