ug4
ug::vrl Namespace Reference

Namespaces

 invocation
 
 threading
 

Classes

class  BasicTest
 
struct  Functionality
 
class  MessageBuffer
 
class  NumberArray
 
class  PrintCondUserData2d
 
class  PrintUserData2d
 
class  SmartPtrCls
 
class  TestClass
 
struct  TypeAndArray
 
struct  vrl_traits
 
struct  vrl_traits< number >
 
struct  vrl_traits< ug::MathMatrix< dim, dim > >
 
struct  vrl_traits< ug::MathVector< dim > >
 
class  VRLCondUserNumber
 
class  VRLUserData
 
class  VRLUserLinker
 
class  VTest
 

Functions

jboolean boolC2J (bool b)
 
jobject boolean2JObject (JNIEnv *env, jboolean value)
 
bool boolJ2C (jboolean b)
 
jobject boolVector2JObject (JNIEnv *env, const std::vector< bool > &bv)
 
bool checkException (JNIEnv *env, std::string msg, bool throwCPPException)
 
void ChrisPoliTest ()
 
void ChrisPoliTest (bool array[])
 
void ChrisPoliTest (int i)
 
void ChrisPoliTest (std::vector< bool > vec)
 
void ChrisPoliTestCreateFile ()
 
std::string ChrisPoliTestCreateFile (std::string inPath, std::string outPath)
 
std::string ChrisPoliTestCreateFile (std::string path)
 
std::vector< bool > ChrisPoliTestReturn (std::vector< bool > vec)
 
jobjectArray classes2NativeClasses (JNIEnv *env, const ug::bridge::Registry *reg)
 
jobjectArray classGroups2NativeClassGroups (JNIEnv *env, const ug::bridge::Registry *reg)
 
bool compareParamTypes (JNIEnv *env, jobjectArray params, ug::bridge::Registry *reg, ug::bridge::ParameterInfo const &paramStack, bool allowSmartToRawPtrConversion)
 
jobject constPointer2JObject (JNIEnv *env, const void *value)
 
jobject constPtrVector2JObject (JNIEnv *env, const std::vector< const void * > &pv)
 
jobject constructor2NativeConstructor (JNIEnv *env, const ug::bridge::ExportedConstructor *constructor)
 
jobjectArray constructors2NativeConstructors (JNIEnv *env, const ug::bridge::IExportedClass &eCls)
 
jobject constSmartPointer2JObject (JNIEnv *env, ConstSmartPtr< void > value)
 
jobject constSmartPtrVector2JObject (JNIEnv *env, const std::vector< ConstSmartPtr< void > > &pv)
 
int ConstSmartTestFunction (ConstSmartPtr< TestClass > test)
 
bool contains (std::string str, std::string search)
 
template<std::size_t dim>
jdoubleArray ConvertParametersToJava (JNIEnv *env, const MathVector< dim > &x, const number time)
 
jobjectArray createEmptyJavaArray (JNIEnv *env, jclass elementClass)
 
jobjectArray createEmptyJavaArray (JNIEnv *env, std::string className)
 
jobject createEmptyString (JNIEnv *env)
 
jobject cStringVector2JObject (JNIEnv *env, const std::vector< const char * > &sv)
 
jobject double2JObject (JNIEnv *env, jdouble value)
 
jobject function2NativeFunction (JNIEnv *env, const ug::bridge::ExportedFunction &func)
 
jobjectArray functions2NativeGroups (JNIEnv *env, ug::bridge::Registry *reg)
 
std::vector< const char * > getBaseClassNames (const ug::bridge::ClassNameNode *node)
 
jobject getClass (JNIEnv *env, jobject obj)
 
std::string getClassName (JNIEnv *env, jobject obj)
 
template<typename TVector >
SmartPtr< NumberArraygetDefects (const ug::StdConvCheck< TVector > *convCheck)
 
std::string getExceptionMessageString (JNIEnv *env, jthrowable exception)
 
SmartPtr< BasicTestgetInstanceBySmartPtr (std::string name)
 
JavaVM * getJavaVM ()
 
std::string getParamClassName (JNIEnv *env, jobject obj)
 
std::string getParamTypeAsString (const uint type)
 
std::string getParamTypesAsString (JNIEnv *env, jobjectArray const &array)
 
const std::vector< const ug::bridge::IExportedClass * > getParentClasses (ug::bridge::Registry *reg, const ug::bridge::IExportedClass *clazz)
 
void initJavaVM (JNIEnv *env)
 
jobject int2JObject (JNIEnv *env, jint value)
 
jobject intVector2JObject (JNIEnv *env, const std::vector< int > &iv)
 
void invalidateJConstSmartPointer (JNIEnv *env, jobject obj)
 
void invalidateJSmartPointer (JNIEnv *env, jobject obj)
 
bool isConstJPtr (JNIEnv *env, jobject obj)
 
bool isJObjectAnArray (JNIEnv *env, jobject value)
 
bool isJSmartPointerConst (JNIEnv *env, jobject ptr)
 
jboolean jObject2Boolean (JNIEnv *env, jobject obj)
 
void jObject2BoolVector (JNIEnv *env, jobject object, std::vector< bool > &bv)
 
ConstSmartPtr< void > jObject2ConstSmartPointer (JNIEnv *env, jobject obj)
 
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)
 
jdouble jObject2Double (JNIEnv *env, jobject obj)
 
jint jObject2Int (JNIEnv *env, jobject obj)
 
void jObject2IntVector (JNIEnv *env, jobject object, std::vector< int > &iv)
 
void jObject2NumberVector (JNIEnv *env, jobject object, std::vector< number > &nv)
 
void * jObject2Pointer (JNIEnv *env, jobject obj)
 
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)
 
void jObject2SizetVector (JNIEnv *env, jobject object, std::vector< size_t > &stv)
 
SmartPtr< void > jObject2SmartPointer (JNIEnv *env, jobject obj)
 
void jObject2SmartPtrVector (JNIEnv *env, jobject object, ug::bridge::Registry *reg, std::vector< std::pair< SmartPtr< void >, const ug::bridge::ClassNameNode * > > &pv)
 
void jObject2stdStringVector (JNIEnv *env, jobject object, std::vector< std::string > &sv)
 
std::string jObject2String (JNIEnv *env, jobject obj)
 
void jobjectArray2ParamStack (JNIEnv *env, ug::bridge::Registry *reg, ug::bridge::ParameterStack &paramsOut, const ug::bridge::ParameterInfo &paramsTemplate, jobjectArray const &array)
 
std::string jPointerGetName (JNIEnv *env, jobject obj)
 
void Log (std::string s)
 
void Logln (std::string s)
 
jobject method2NativeMethod (JNIEnv *env, const ug::bridge::ExportedMethod *method)
 
jobjectArray methods2NativeGroups (JNIEnv *env, const ug::bridge::IExportedClass &eCls, bool constMethods)
 
jobject numberVector2JObject (JNIEnv *env, const std::vector< number > &nv)
 
jobject param2JObject (JNIEnv *env, ug::bridge::ParameterStack &params, size_t index)
 
TypeAndArray paramClass2ParamType (JNIEnv *env, jobject obj)
 
jobjectArray params2NativeParams (JNIEnv *env, const ug::bridge::ExportedConstructor &constructor)
 
jobjectArray params2NativeParams (JNIEnv *env, const ug::bridge::ExportedFunctionBase &func)
 
int paramType2Int (const ug::bridge::ParameterInfo &params, size_t index)
 
jobject pointer2JObject (JNIEnv *env, void *value)
 
void printParamType (const uint type, size_t index)
 
jobject ptrVector2JObject (JNIEnv *env, const std::vector< void * > &pv)
 
void registerBasicTest (ug::bridge::Registry &reg)
 
void registerMessaging (ug::bridge::Registry &reg)
 
void registerNumberArray (ug::bridge::Registry &reg)
 
void registerPlayground (ug::bridge::Registry &reg)
 
void registerThrowUtil (ug::bridge::Registry &reg)
 
void registerUGFinalize (ug::bridge::Registry &reg)
 
template<int dim>
void RegisterUserData (ug::bridge::Registry &reg, const char *parentGroup)
 
template<typename TData , int dim>
void RegisterUserDataType (ug::bridge::Registry &reg, const std::string &grp)
 
void RegisterVRLFunctionality (ug::bridge::Registry &reg, std::string grp)
 
jobject registry2NativeAPI (JNIEnv *env, ug::bridge::Registry *reg)
 
std::string replaceAll (std::string target, const std::string oldstr, const std::string newstr)
 
jobject retVal2NativeParam (JNIEnv *env, const ug::bridge::ExportedFunctionBase &func)
 
void SetVRLRegistry (ug::bridge::Registry *pReg)
 
jobject sizetVector2JObject (JNIEnv *env, const std::vector< size_t > &iv)
 
jobject smartPointer2JObject (JNIEnv *env, SmartPtr< void > value)
 
jobject smartPtrVector2JObject (JNIEnv *env, const std::vector< SmartPtr< void > > &pv)
 
int SmartTestFunction (SmartPtr< TestClass > test)
 
std::vector< std::string > split (const std::string &str, const char delimiter)
 
bool startsWith (std::string str, std::string search)
 
jobject stdStringVector2JObject (JNIEnv *env, const std::vector< std::string > &sv)
 
jobject string2JObject (JNIEnv *env, const char *value)
 
jobjectArray stringArrayC2J (JNIEnv *env, const char *const *strings, const unsigned int array_length)
 
jobjectArray stringArrayC2J (JNIEnv *env, const std::string *strings)
 
jobjectArray stringArrayC2J (JNIEnv *env, const std::string *strings, const size_t array_length)
 
jobjectArray stringArrayC2J (JNIEnv *env, const std::vector< const char * > *strings)
 
jobjectArray stringArrayC2J (JNIEnv *env, const std::vector< const char * > strings)
 
jobjectArray stringArrayC2J (JNIEnv *env, std::vector< std::string > const &strings)
 
std::vector< std::string > stringArrayJ2C (JNIEnv *env, jobjectArray const &array)
 
jstring stringC2J (JNIEnv *env, const char *s)
 
std::string stringJ2C (JNIEnv *env, jstring const &s)
 
std::string svnRevision ()
 
void TestSmartPtr2ConstPtr (const TestClass *t)
 
void ThrowIf (bool b, std::string s)
 
void ThrowIfNot (bool b, std::string s)
 
void throwUgErrorAsJavaException (JNIEnv *env, std::string error)
 
void throwUgErrorAsJavaException (JNIEnv *env, ug::UGError error)
 

Variables

static JavaVM * javaVM = NULL
 
static ug::bridge::RegistryvrlRegistry = NULL
 

Function Documentation

◆ boolC2J()

jboolean ug::vrl::boolC2J ( bool  b)
inline

Converts a native boolean to a Java boolean.

Parameters
bnative boolean to convert
Returns
Java boolean

Referenced by classes2NativeClasses(), constPointer2JObject(), constSmartPointer2JObject(), function2NativeFunction(), pointer2JObject(), and smartPointer2JObject().

◆ boolean2JObject()

jobject ug::vrl::boolean2JObject ( JNIEnv *  env,
jboolean  value 
)

Converts a jboolean to a Java object (jobject).

Parameters
envJVM environment to operate on
valuevalue to convert
Returns
Java object (jobject)

Referenced by boolVector2JObject(), and param2JObject().

◆ boolJ2C()

bool ug::vrl::boolJ2C ( jboolean  b)
inline

Converts a Java boolean to a native boolean.

Parameters
bJava boolean to convert
Returns
native boolean

Referenced by getParamClassName(), isJSmartPointerConst(), Java_edu_gcsc_vrl_ug_UG__1getExportedClassPtrByName(), and Java_edu_gcsc_vrl_ug_UG__1invokeMethod().

◆ boolVector2JObject()

jobject ug::vrl::boolVector2JObject ( JNIEnv *  env,
const std::vector< bool > &  bv 
)

Converts a bool vector to a Java object (jobject).

Parameters
envJVM environment to operate on
bvvector to convert
Returns
Java object (jobject)

References boolean2JObject().

Referenced by param2JObject().

◆ checkException()

◆ ChrisPoliTest() [1/4]

void ug::vrl::ChrisPoliTest ( )

◆ ChrisPoliTest() [2/4]

void ug::vrl::ChrisPoliTest ( bool  array[])

◆ ChrisPoliTest() [3/4]

void ug::vrl::ChrisPoliTest ( int  i)

◆ ChrisPoliTest() [4/4]

void ug::vrl::ChrisPoliTest ( std::vector< bool >  vec)

◆ ChrisPoliTestCreateFile() [1/3]

void ug::vrl::ChrisPoliTestCreateFile ( )

Referenced by registerPlayground().

◆ ChrisPoliTestCreateFile() [2/3]

std::string ug::vrl::ChrisPoliTestCreateFile ( std::string  inPath,
std::string  outPath 
)

◆ ChrisPoliTestCreateFile() [3/3]

std::string ug::vrl::ChrisPoliTestCreateFile ( std::string  path)

◆ ChrisPoliTestReturn()

std::vector<bool> ug::vrl::ChrisPoliTestReturn ( std::vector< bool >  vec)

Referenced by registerPlayground().

◆ classes2NativeClasses()

◆ classGroups2NativeClassGroups()

◆ compareParamTypes()

bool ug::vrl::compareParamTypes ( JNIEnv *  env,
jobjectArray  params,
ug::bridge::Registry reg,
const ug::bridge::ParameterInfo paramStack,
bool  allowSmartToRawPtrConversion = false 
)

◆ constPointer2JObject()

jobject ug::vrl::constPointer2JObject ( JNIEnv *  env,
const void *  value 
)

Converts a native const pointer to a Java object (jobject).

Parameters
envJVM environment to operate on
valueconst pointer to convert
Returns
a Java object (jobject)

References boolC2J(), and JNULL.

Referenced by constPtrVector2JObject(), and param2JObject().

◆ constPtrVector2JObject()

jobject ug::vrl::constPtrVector2JObject ( JNIEnv *  env,
const std::vector< const void * > &  pv 
)

Converts a const-void-pointer vector to a Java object (jobject).

Parameters
envJVM environment to operate on
pvvector to convert
Returns
Java object (jobject)

References constPointer2JObject().

Referenced by param2JObject().

◆ constructor2NativeConstructor()

◆ constructors2NativeConstructors()

jobjectArray ug::vrl::constructors2NativeConstructors ( JNIEnv *  env,
const ug::bridge::IExportedClass eCls 
)

◆ constSmartPointer2JObject()

jobject ug::vrl::constSmartPointer2JObject ( JNIEnv *  env,
ConstSmartPtr< void >  value 
)

Converts a native const smart-pointer to a Java object (jobject).

Parameters
envJVM environment to operate on
valueconst smart-pointer to convert
Returns
a Java object (jobject)

References boolC2J(), ConstSmartPtr< void >::get(), and JNULL.

Referenced by constSmartPtrVector2JObject(), and param2JObject().

◆ constSmartPtrVector2JObject()

jobject ug::vrl::constSmartPtrVector2JObject ( JNIEnv *  env,
const std::vector< ConstSmartPtr< void > > &  pv 
)

Converts a ConstSmartPtr vector to a Java object (jobject).

Parameters
envJVM environment to operate on
pvvector to convert
Returns
Java object (jobject)

References constSmartPointer2JObject().

Referenced by param2JObject().

◆ ConstSmartTestFunction()

int ug::vrl::ConstSmartTestFunction ( ConstSmartPtr< TestClass test)

◆ contains()

bool ug::vrl::contains ( std::string  str,
std::string  search 
)

Checks whether str contains search.

Parameters
strstring
searchstring to search
Returns
true if str contains search; false otherwise

◆ ConvertParametersToJava()

template<std::size_t dim>
jdoubleArray ug::vrl::ConvertParametersToJava ( JNIEnv *  env,
const MathVector< dim > &  x,
const number  time 
)
inline

◆ createEmptyJavaArray() [1/2]

jobjectArray ug::vrl::createEmptyJavaArray ( JNIEnv *  env,
jclass  elementClass 
)

Creates an empty Java array using the specified class as element type.

Parameters
envJVM environment to operate on
elementClasselement class
Returns
emtpy Java array

◆ createEmptyJavaArray() [2/2]

jobjectArray ug::vrl::createEmptyJavaArray ( JNIEnv *  env,
std::string  className 
)

Creates an empty Java array using the specified class as element type.

Parameters
envJVM environment to operate on
classNamename of the element class
Returns
emtpy Java array

◆ createEmptyString()

jobject ug::vrl::createEmptyString ( JNIEnv *  env)

Referenced by stringArrayC2J().

◆ cStringVector2JObject()

jobject ug::vrl::cStringVector2JObject ( JNIEnv *  env,
const std::vector< const char * > &  sv 
)

Converts a c-string vector to a Java object (jobject).

Parameters
envJVM environment to operate on
svvector to convert
Returns
Java object (jobject)

References string2JObject().

Referenced by param2JObject().

◆ double2JObject()

jobject ug::vrl::double2JObject ( JNIEnv *  env,
jdouble  value 
)

Converts a double to a Java object (jobject).

Parameters
envJVM environment to operate on
valuevalue to convert
Returns
a Java object (jobject)

Referenced by numberVector2JObject(), and param2JObject().

◆ function2NativeFunction()

jobject ug::vrl::function2NativeFunction ( JNIEnv *  env,
const ug::bridge::ExportedFunction func 
)

◆ functions2NativeGroups()

◆ getBaseClassNames()

std::vector< const char * > ug::vrl::getBaseClassNames ( const ug::bridge::ClassNameNode node)

Returns the base classes of the given class name node.

Returns
the base classes of the given class name node

References ug::bridge::ExtractClassNameVec().

Referenced by params2NativeParams(), and retVal2NativeParam().

◆ getClass()

jobject ug::vrl::getClass ( JNIEnv *  env,
jobject  obj 
)

Returns the class object of the specified Java object.

Parameters
envJVM environment to operate on
objJava object
Returns
class object of the specified Java object

◆ getClassName()

std::string ug::vrl::getClassName ( JNIEnv *  env,
jobject  obj 
)

Returns the class name of the specified Java object.

Parameters
envJVM environment to operate on
objJava object
Returns
class name of the specified Java object

References jObject2String().

Referenced by isJObjectAnArray(), and paramClass2ParamType().

◆ getDefects()

template<typename TVector >
SmartPtr<NumberArray> ug::vrl::getDefects ( const ug::StdConvCheck< TVector > *  convCheck)

◆ getExceptionMessageString()

std::string ug::vrl::getExceptionMessageString ( JNIEnv *  env,
jthrowable  ex 
)

Returns the message string of the specified Java exception. If no exception occured, an empty String will be returned.

Parameters
envJVM environment
exJava exception
Returns
the message string of the specified Java exception or an empty string if no exception occured

References stringJ2C().

Referenced by checkException().

◆ getInstanceBySmartPtr()

SmartPtr< BasicTest > ug::vrl::getInstanceBySmartPtr ( std::string  name)

References name.

Referenced by registerBasicTest().

◆ getJavaVM()

◆ getParamClassName()

std::string ug::vrl::getParamClassName ( JNIEnv *  env,
jobject  obj 
)

Returns the class name of the specified param object (class UGObject).

Parameters
envJVM environment to operate on
objparam object
Returns
class name of the specified param object

References boolJ2C(), and jObject2String().

Referenced by compareParamTypes(), and getParamTypesAsString().

◆ getParamTypeAsString()

std::string ug::vrl::getParamTypeAsString ( const uint  type)

◆ getParamTypesAsString()

std::string ug::vrl::getParamTypesAsString ( JNIEnv *  env,
jobjectArray const &  array 
)

◆ getParentClasses()

const std::vector< const ug::bridge::IExportedClass * > ug::vrl::getParentClasses ( ug::bridge::Registry reg,
const ug::bridge::IExportedClass clazz 
)

Returns parent classes (super classes) of an exported class.

Parameters
regregistry to search
clazzexported class
Returns
a vector containing all parent classes of the given class

References ug::bridge::IExportedClass::class_names(), and ug::vrl::invocation::getExportedClassPtrByName().

Referenced by ug::vrl::invocation::getMethodBySignature().

◆ initJavaVM()

void ug::vrl::initJavaVM ( JNIEnv *  env)

Defines the JVM to operate on based on the specified JNI environment. The JVM can only be initialized once.

Parameters
envJVM environment

References javaVM, and UG_LOG.

Referenced by Java_edu_gcsc_vrl_ug_UG__1ugInit().

◆ int2JObject()

jobject ug::vrl::int2JObject ( JNIEnv *  env,
jint  value 
)

Converts an integer to a Java object (jobject).

Parameters
envJVM environment to operate on
valuevalue to convert
Returns
Java object (jobject)

Referenced by intVector2JObject(), param2JObject(), and sizetVector2JObject().

◆ intVector2JObject()

jobject ug::vrl::intVector2JObject ( JNIEnv *  env,
const std::vector< int > &  iv 
)

Converts an int vector to a Java object (jobject).

Parameters
envJVM environment to operate on
ivvector to convert
Returns
Java object (jobject)

References int2JObject().

Referenced by param2JObject().

◆ invalidateJConstSmartPointer()

void ug::vrl::invalidateJConstSmartPointer ( JNIEnv *  env,
jobject  obj 
)

Invalidates the native equivalent of the specified Java smart pointer. TODO what about error handling???

Parameters
envJVM environment to operate on
objsmart pointer to invalidate

Referenced by Java_edu_gcsc_vrl_ug_UG__1invalidate().

◆ invalidateJSmartPointer()

void ug::vrl::invalidateJSmartPointer ( JNIEnv *  env,
jobject  obj 
)

Invalidates the native equivalent of the specified Java smart pointer. TODO what about error handling???

Parameters
envJVM environment to operate on
objsmart pointer to invalidate

Referenced by Java_edu_gcsc_vrl_ug_UG__1invalidate().

◆ isConstJPtr()

bool ug::vrl::isConstJPtr ( JNIEnv *  env,
jobject  obj 
)

Finds out whether a java pointer wrapper is const.

Parameters
envJVM environment to operate on
objpointer type to check for constness
Returns
true iff pointer wrapper's readOnly member is true

Referenced by paramClass2ParamType().

◆ isJObjectAnArray()

bool ug::vrl::isJObjectAnArray ( JNIEnv *  env,
jobject  value 
)

References getClassName().

Referenced by paramClass2ParamType().

◆ isJSmartPointerConst()

bool ug::vrl::isJSmartPointerConst ( JNIEnv *  env,
jobject  ptr 
)

Indicates whether the specified smart pointer is const, i.e., if the specified Java object represents a const smart pointer.

Parameters
envJVM environment to operate on
ptrsmart pointer to check
Returns
true if the specified smart pointer is const; false otherwise

References boolJ2C().

Referenced by Java_edu_gcsc_vrl_ug_UG__1invalidate(), and jObject2ConstSmartPointer().

◆ jObject2Boolean()

jboolean ug::vrl::jObject2Boolean ( JNIEnv *  env,
jobject  obj 
)

Converts a Java object to a native boolean value.

Parameters
envJVM environment to operate on
objobject to convert
Returns
a native boolean value

Referenced by jObject2BoolVector(), and jobjectArray2ParamStack().

◆ jObject2BoolVector()

void ug::vrl::jObject2BoolVector ( JNIEnv *  env,
jobject  object,
std::vector< bool > &  bv 
)

References jObject2Boolean().

Referenced by jobjectArray2ParamStack().

◆ jObject2ConstSmartPointer()

ConstSmartPtr<void> ug::vrl::jObject2ConstSmartPointer ( JNIEnv *  env,
jobject  obj 
)

◆ jObject2ConstSmartPtrVector()

void ug::vrl::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 
)

◆ jObject2Double()

jdouble ug::vrl::jObject2Double ( JNIEnv *  env,
jobject  obj 
)

Converts a Java object (jobject) to a native double value.

Parameters
envJVM environment to operate on
objobject to convert
Returns
a native double value

Referenced by jObject2NumberVector(), and jobjectArray2ParamStack().

◆ jObject2Int()

jint ug::vrl::jObject2Int ( JNIEnv *  env,
jobject  obj 
)

Converts a Java object (jobject) to a native int value.

Parameters
envJVM environment to operate on
objobject to convert
Returns
a native int value

Referenced by jObject2IntVector(), jObject2SizetVector(), and jobjectArray2ParamStack().

◆ jObject2IntVector()

void ug::vrl::jObject2IntVector ( JNIEnv *  env,
jobject  object,
std::vector< int > &  iv 
)

References jObject2Int().

Referenced by jobjectArray2ParamStack().

◆ jObject2NumberVector()

void ug::vrl::jObject2NumberVector ( JNIEnv *  env,
jobject  object,
std::vector< number > &  nv 
)

References jObject2Double().

Referenced by jobjectArray2ParamStack().

◆ jObject2Pointer()

void * ug::vrl::jObject2Pointer ( JNIEnv *  env,
jobject  obj 
)

Converts a Java object (jobject) to a native pointer.

Parameters
envJVM environment to operate on
objobject to convert
Returns
a native pointer

Referenced by jObject2PtrVector(), and jobjectArray2ParamStack().

◆ jObject2PtrVector()

◆ jObject2SizetVector()

void ug::vrl::jObject2SizetVector ( JNIEnv *  env,
jobject  object,
std::vector< size_t > &  stv 
)

References jObject2Int().

Referenced by jobjectArray2ParamStack().

◆ jObject2SmartPointer()

SmartPtr<void> ug::vrl::jObject2SmartPointer ( JNIEnv *  env,
jobject  obj 
)

◆ jObject2SmartPtrVector()

void ug::vrl::jObject2SmartPtrVector ( JNIEnv *  env,
jobject  object,
ug::bridge::Registry reg,
std::vector< std::pair< SmartPtr< void >, const ug::bridge::ClassNameNode * > > &  pv 
)

◆ jObject2stdStringVector()

void ug::vrl::jObject2stdStringVector ( JNIEnv *  env,
jobject  object,
std::vector< std::string > &  sv 
)

References jObject2String().

Referenced by jobjectArray2ParamStack().

◆ jObject2String()

std::string ug::vrl::jObject2String ( JNIEnv *  env,
jobject  obj 
)

Converts a Java object (jobject) to a native string.

Parameters
envJVM environment to operate on
objobject to convert
Returns
a native string

References stringJ2C().

Referenced by getClassName(), getParamClassName(), jObject2stdStringVector(), and jobjectArray2ParamStack().

◆ jobjectArray2ParamStack()

void ug::vrl::jobjectArray2ParamStack ( JNIEnv *  env,
ug::bridge::Registry reg,
ug::bridge::ParameterStack paramsOut,
const ug::bridge::ParameterInfo paramsTemplate,
jobjectArray const &  array 
)

◆ jPointerGetName()

std::string ug::vrl::jPointerGetName ( JNIEnv *  env,
jobject  obj 
)

Pendant of javas getName().

Parameters
envJVM environment to operate on
objobject which class name we want to know
Returns
the class name of the jobject

References name, and stringJ2C().

Referenced by jObject2ConstSmartPtrVector(), jObject2PtrVector(), jObject2SmartPtrVector(), and jobjectArray2ParamStack().

◆ Log()

void ug::vrl::Log ( std::string  s)

References s, and UG_LOG.

Referenced by registerMessaging().

◆ Logln()

void ug::vrl::Logln ( std::string  s)

References s, and UG_LOG.

Referenced by registerMessaging().

◆ method2NativeMethod()

◆ methods2NativeGroups()

◆ numberVector2JObject()

jobject ug::vrl::numberVector2JObject ( JNIEnv *  env,
const std::vector< number > &  nv 
)

Converts a number vector to a Java object (jobject).

Parameters
envJVM environment to operate on
nvvector to convert
Returns
Java object (jobject)

References double2JObject().

Referenced by param2JObject().

◆ param2JObject()

◆ paramClass2ParamType()

TypeAndArray ug::vrl::paramClass2ParamType ( JNIEnv *  env,
jobject  obj 
)

Returns the parameter type (ug::bridge::ParameterTypes) of the specified Java object.

Parameters
envJVM environment to operate on
objJava object
Returns
parameter type (ug::bridge::ParameterTypes) of the specified Java object

References getClassName(), ug::vrl::TypeAndArray::isArray, isConstJPtr(), isJObjectAnArray(), ug::vrl::TypeAndArray::type, UG_LOG, ug::Variant::VT_BOOL, ug::Variant::VT_CONST_POINTER, ug::Variant::VT_CONST_SMART_POINTER, ug::Variant::VT_DOUBLE, ug::Variant::VT_INT, ug::Variant::VT_INVALID, ug::Variant::VT_POINTER, ug::Variant::VT_SMART_POINTER, and ug::Variant::VT_STDSTRING.

Referenced by compareParamTypes(), getParamTypesAsString(), and jobjectArray2ParamStack().

◆ params2NativeParams() [1/2]

◆ params2NativeParams() [2/2]

◆ paramType2Int()

int ug::vrl::paramType2Int ( const ug::bridge::ParameterInfo params,
size_t  index 
)

◆ pointer2JObject()

jobject ug::vrl::pointer2JObject ( JNIEnv *  env,
void *  value 
)

Converts a native pointer to a Java object (jobject).

Parameters
envJVM environment to operate on
valuepointer to convert
Returns
a Java object (jobject)

References boolC2J(), and JNULL.

Referenced by Java_edu_gcsc_vrl_ug_UG__1newInstance(), param2JObject(), and ptrVector2JObject().

◆ printParamType()

◆ ptrVector2JObject()

jobject ug::vrl::ptrVector2JObject ( JNIEnv *  env,
const std::vector< void * > &  pv 
)

Converts a void-pointer vector to a Java object (jobject).

Parameters
envJVM environment to operate on
pvvector to convert
Returns
Java object (jobject)

References pointer2JObject().

Referenced by param2JObject().

◆ registerBasicTest()

◆ registerMessaging()

void ug::vrl::registerMessaging ( ug::bridge::Registry reg)

◆ registerNumberArray()

◆ registerPlayground()

◆ registerThrowUtil()

void ug::vrl::registerThrowUtil ( ug::bridge::Registry reg)

◆ registerUGFinalize()

void ug::vrl::registerUGFinalize ( ug::bridge::Registry reg)

◆ RegisterUserData()

template<int dim>
void ug::vrl::RegisterUserData ( ug::bridge::Registry reg,
const char *  parentGroup 
)

◆ RegisterUserDataType()

template<typename TData , int dim>
void ug::vrl::RegisterUserDataType ( ug::bridge::Registry reg,
const std::string &  grp 
)

◆ RegisterVRLFunctionality()

◆ registry2NativeAPI()

jobject ug::vrl::registry2NativeAPI ( JNIEnv *  env,
ug::bridge::Registry reg 
)

Converts registry information to Java objects.

Parameters
envJVM environment to operate on
regregistry to convert
Returns
native api info

References ug::bridge::Registry::check_consistency(), classes2NativeClasses(), classGroups2NativeClassGroups(), ug::LogAssistant::flush_error_log(), functions2NativeGroups(), ug::GetLogAssistant(), and UG_LOG.

Referenced by Java_edu_gcsc_vrl_ug_UG__1convertRegistryInfo().

◆ replaceAll()

std::string ug::vrl::replaceAll ( std::string  target,
const std::string  oldstr,
const std::string  newstr 
)

Replaces each substring of target string that is equal to oldstr with newstr

Parameters
targetstring to modify
oldstrstring to raplace
newstrreplacement string
Returns
a copy of the specified target string where all occurences of oldstr are replaced with newstr

References boost::target().

Referenced by ug::vrl::MessageBuffer::addMessage().

◆ retVal2NativeParam()

◆ SetVRLRegistry()

void ug::vrl::SetVRLRegistry ( ug::bridge::Registry pReg)

Defines the registry to use for VRL.

Parameters
pRegregistry

References vrlRegistry.

Referenced by Java_edu_gcsc_vrl_ug_UG__1ugInit().

◆ sizetVector2JObject()

jobject ug::vrl::sizetVector2JObject ( JNIEnv *  env,
const std::vector< size_t > &  iv 
)

Converts a size_t vector to a Java object (jobject).

Parameters
envJVM environment to operate on
ivvector to convert
Returns
Java object (jobject)

References int2JObject().

Referenced by param2JObject().

◆ smartPointer2JObject()

jobject ug::vrl::smartPointer2JObject ( JNIEnv *  env,
SmartPtr< void >  value 
)

Converts a native smart-pointer to a Java object (jobject).

Parameters
envJVM environment to operate on
valuesmart-pointer to convert
Returns
a Java object (jobject)

References boolC2J(), SmartPtr< void >::get(), and JNULL.

Referenced by Java_edu_gcsc_vrl_ug_UG__1newInstance(), param2JObject(), and smartPtrVector2JObject().

◆ smartPtrVector2JObject()

jobject ug::vrl::smartPtrVector2JObject ( JNIEnv *  env,
const std::vector< SmartPtr< void > > &  pv 
)

Converts a SmartPtr vector to a Java object (jobject).

Parameters
envJVM environment to operate on
pvvector to convert
Returns
Java object (jobject)

References smartPointer2JObject().

Referenced by param2JObject().

◆ SmartTestFunction()

int ug::vrl::SmartTestFunction ( SmartPtr< TestClass test)

◆ split()

std::vector< std::string > ug::vrl::split ( const std::string &  str,
const char  delimiter 
)

Splits string around given delimiter.

Parameters
strstring to split
delimiterdelimiter
Returns
vector of strings computed by splitting this string around matches of the given delimiter

Referenced by ug::QualityGridGeneration(), ug::MatrixIOMtx::query_matrix_characteristics(), ug::MatrixIOMtx::read_entry(), and svnRevision().

◆ startsWith()

bool ug::vrl::startsWith ( std::string  str,
std::string  search 
)

Checks whether str starts with search.

Parameters
strstring
searchstring to search
Returns
true if str starts with search; false otherwise

◆ stdStringVector2JObject()

jobject ug::vrl::stdStringVector2JObject ( JNIEnv *  env,
const std::vector< std::string > &  sv 
)

Converts a std::string vector to a Java object (jobject).

Parameters
envJVM environment to operate on
svvector to convert
Returns
Java object (jobject)

References string2JObject().

Referenced by param2JObject().

◆ string2JObject()

jobject ug::vrl::string2JObject ( JNIEnv *  env,
const char *  value 
)

Converts a string to a Java object (jobject).

Parameters
envJVM environment to operate on
valuevalue to convert
Returns
a Java object (jobject)

Referenced by cStringVector2JObject(), param2JObject(), and stdStringVector2JObject().

◆ stringArrayC2J() [1/6]

jobjectArray ug::vrl::stringArrayC2J ( JNIEnv *  env,
const char *const *  strings,
const unsigned int  array_length 
)

References s.

◆ stringArrayC2J() [2/6]

jobjectArray ug::vrl::stringArrayC2J ( JNIEnv *  env,
const std::string *  strings 
)

Converts a native string array to a Java object array.

Parameters
envJVM environment to operate on
stringsarray to convert
Returns
a java object array

◆ stringArrayC2J() [3/6]

jobjectArray ug::vrl::stringArrayC2J ( JNIEnv *  env,
const std::string *  strings,
const size_t  array_length 
)

◆ stringArrayC2J() [4/6]

jobjectArray ug::vrl::stringArrayC2J ( JNIEnv *  env,
const std::vector< const char * > *  strings 
)

◆ stringArrayC2J() [5/6]

jobjectArray ug::vrl::stringArrayC2J ( JNIEnv *  env,
const std::vector< const char * >  strings 
)

◆ stringArrayC2J() [6/6]

jobjectArray ug::vrl::stringArrayC2J ( JNIEnv *  env,
std::vector< std::string > const &  strings 
)

Converts a native string array to a java object array.

Parameters
envJVM environment to operate on
stringsarray to convert
Returns
a java object array

References createEmptyString(), and stringArrayC2J().

◆ stringArrayJ2C()

std::vector< std::string > ug::vrl::stringArrayJ2C ( JNIEnv *  env,
jobjectArray const &  array 
)

Converts a Java string array to a native string array.

Note: this function must not be used to convert large amounts of strings because of inefficient memory handling.

Parameters
envJVM environment to operate on
arrayarray to convert
Returns
a native string array

References stringJ2C().

Referenced by Java_edu_gcsc_vrl_ug_UG__1ugInit().

◆ stringC2J()

◆ stringJ2C()

std::string ug::vrl::stringJ2C ( JNIEnv *  env,
jstring const &  s 
)

Converts a Java string to a native string.

Note: this function must not be used to convert large amounts of strings because of inefficient memory handling.

Parameters
envJVM environment to operate on
sstring to convert
Returns
a native string

References s.

Referenced by getExceptionMessageString(), Java_edu_gcsc_vrl_ug_UG__1getDefaultClassNameFromGroup(), Java_edu_gcsc_vrl_ug_UG__1getExportedClassPtrByName(), Java_edu_gcsc_vrl_ug_UG__1invokeFunction(), Java_edu_gcsc_vrl_ug_UG__1invokeMethod(), jObject2String(), jPointerGetName(), and stringArrayJ2C().

◆ svnRevision()

std::string ug::vrl::svnRevision ( )
inline

Returns the global SVN revision of this build.

Returns
global SVN revision of this build

References split(), and ug::UGSvnRevision().

Referenced by ug::vrl::TestClass::getRev(), and Java_edu_gcsc_vrl_ug_UG__1getSvnRevision().

◆ TestSmartPtr2ConstPtr()

void ug::vrl::TestSmartPtr2ConstPtr ( const TestClass t)

◆ ThrowIf()

void ug::vrl::ThrowIf ( bool  b,
std::string  s 
)

References s.

Referenced by registerThrowUtil().

◆ ThrowIfNot()

void ug::vrl::ThrowIfNot ( bool  b,
std::string  s 
)

References s.

Referenced by registerThrowUtil().

◆ throwUgErrorAsJavaException() [1/2]

void ug::vrl::throwUgErrorAsJavaException ( JNIEnv *  env,
std::string  error 
)

Converts the specified message to its equivalent Java representation and throws it as Java exception.

Parameters
envJVM environment to operate on
errorthe error to convert/throw

◆ throwUgErrorAsJavaException() [2/2]

void ug::vrl::throwUgErrorAsJavaException ( JNIEnv *  env,
ug::UGError  error 
)

Converts the specified ug error to its equivalent Java representation and throws it as Java exception.

Parameters
envJVM environment to operate on
errorthe error to convert/throw

References ug::UGError::get_file(), ug::UGError::get_line(), ug::UGError::get_msg(), and ug::UGError::num_msg().

Referenced by compareParamTypes(), Java_edu_gcsc_vrl_ug_UG__1getDefaultClassNameFromGroup(), Java_edu_gcsc_vrl_ug_UG__1getExportedClassPtrByName(), Java_edu_gcsc_vrl_ug_UG__1invokeFunction(), Java_edu_gcsc_vrl_ug_UG__1invokeMethod(), and Java_edu_gcsc_vrl_ug_UG__1newInstance().

Variable Documentation

◆ javaVM

◆ vrlRegistry