8 #ifndef APP_ANDROID_JNI_PROGRESSIONSTATUS_H_ 9 #define APP_ANDROID_JNI_PROGRESSIONSTATUS_H_ 34 , jvm_(0), rtabmap_(0)
39 registerToEventsManager();
43 void setJavaObjects(JavaVM * jvm, jobject
rtabmap)
51 swiftClassPtr_ = classPtr;
52 swiftCallback = callback;
81 virtual bool callback(
const std::string & msg)
const 104 jint
rs = jvm_->AttachCurrentThread(&env,
NULL);
105 if(rs == JNI_OK && env)
107 jclass clazz = env->GetObjectClass(rtabmap_);
110 jmethodID methodID = env->GetMethodID(clazz,
"updateProgressionCallback",
"(II)V" );
113 env->CallVoidMethod(rtabmap_, methodID,
120 jvm_->DetachCurrentThread();
125 std::function<void()> actualCallback = [&](){
126 swiftCallback(swiftClassPtr_,
count_, max_);
134 UERROR(
"Failed to call rtabmap::updateProgressionCallback");
148 void(*swiftCallback)(
void *, int, int);
static void post(UEvent *event, bool async=true, const UEventsSender *sender=0)
ProgressEvent(int count=1)
virtual ~ProgressionStatus()
virtual bool callback(const std::string &msg) const
virtual std::string getClassName() const =0
void setSwiftCallback(void *classPtr, void(*callback)(void *, int, int))
GLM_FUNC_DECL genType max(genType const &x, genType const &y)
ULogger class and convenient macros.
virtual bool callback(const std::string &msg) const
virtual bool handleEvent(UEvent *event)
void increment(int count=1) const
virtual std::string getClassName() const