/* * Copyright (c) 2015-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. */ #pragma once #include #include #include #include namespace facebook { namespace jni { FBEXPORT const RefPtr& countableFromJava(JNIEnv* env, jobject obj); template RefPtr extractRefPtr(JNIEnv* env, jobject obj) { return static_cast>(countableFromJava(env, obj)); } template RefPtr extractPossiblyNullRefPtr(JNIEnv* env, jobject obj) { return obj ? extractRefPtr(env, obj) : nullptr; } FBEXPORT void setCountableForJava(JNIEnv* env, jobject obj, RefPtr&& countable); void CountableOnLoad(JNIEnv* env); } }