| 97 | } |
| 98 | |
| 99 | const JNINativeMethod *getSignatures() const { |
| 100 | std::lock_guard<std::mutex> lock(mutex_); |
| 101 | if (method_ptr_ == nullptr || size_ != methods_.size()) { |
| 102 | method_ptr_ = std::unique_ptr<JNINativeMethod[]>(new JNINativeMethod[methods_.size()]); |
| 103 | size_ = methods_.size(); |
| 104 | for(int i=0; i < methods_.size(); i++) { |
| 105 | method_ptr_[i].fnPtr = const_cast<void*>(methods_[i].getPointer()); |
| 106 | method_ptr_[i].name = const_cast<char*>(methods_[i].getName()); |
| 107 | method_ptr_[i].signature = const_cast<char*>(methods_[i].getParameters()); |
| 108 | } |
| 109 | } |
| 110 | return method_ptr_.get(); |
| 111 | } |
| 112 | |
| 113 | size_t getSize() const { |
| 114 | return size_; |
no test coverage detected