Twitch SDK (Internal)
Classes | Public Member Functions | Private Attributes | List of all members
ttv::binding::java::JavaNativeProxyRegistry< NativeInstanceType, ContextType > Class Template Reference

#include <java_utility.h>

Classes

struct  Entry
 

Public Member Functions

void Register (const std::shared_ptr< NativeInstanceType > &nativeInstance, const std::shared_ptr< ContextType > &nativeContext, jobject javaInstance)
 
void Unregister (jlong jNativePointer)
 
void Unregister (NativeInstanceType *nativeInstance)
 
void Unregister (jobject javaInstance)
 
std::shared_ptr< NativeInstanceType > LookupNativeInstance (jobject javaInstance)
 
std::shared_ptr< ContextType > LookupNativeContext (jobject javaInstance)
 
std::shared_ptr< ContextType > LookupNativeContext (jlong nativeInstance)
 

Private Attributes

std::vector< std::shared_ptr< Entry > > mRegistry
 
std::shared_ptr< ttv::IMutexmMutex
 

Detailed Description

template<typename NativeInstanceType, typename ContextType>
class ttv::binding::java::JavaNativeProxyRegistry< NativeInstanceType, ContextType >

Manages a mapping of a native pointer to a Java object reference.


Class Documentation

◆ ttv::binding::java::JavaNativeProxyRegistry::Entry

struct ttv::binding::java::JavaNativeProxyRegistry::Entry

template<typename NativeInstanceType, typename ContextType>
struct ttv::binding::java::JavaNativeProxyRegistry< NativeInstanceType, ContextType >::Entry

Class Members
GlobalJavaObjectReference javaInstance
shared_ptr< ContextType > nativeContext
shared_ptr< NativeInstanceType > nativeInstance

Member Function Documentation

◆ LookupNativeContext() [1/2]

template<typename NativeInstanceType, typename ContextType>
std::shared_ptr<ContextType> ttv::binding::java::JavaNativeProxyRegistry< NativeInstanceType, ContextType >::LookupNativeContext ( jobject  javaInstance)
inline

◆ LookupNativeContext() [2/2]

template<typename NativeInstanceType, typename ContextType>
std::shared_ptr<ContextType> ttv::binding::java::JavaNativeProxyRegistry< NativeInstanceType, ContextType >::LookupNativeContext ( jlong  nativeInstance)
inline

◆ LookupNativeInstance()

template<typename NativeInstanceType, typename ContextType>
std::shared_ptr<NativeInstanceType> ttv::binding::java::JavaNativeProxyRegistry< NativeInstanceType, ContextType >::LookupNativeInstance ( jobject  javaInstance)
inline

From the java instance find the corresponding native instance and returns it.

◆ Register()

template<typename NativeInstanceType, typename ContextType>
void ttv::binding::java::JavaNativeProxyRegistry< NativeInstanceType, ContextType >::Register ( const std::shared_ptr< NativeInstanceType > &  nativeInstance,
const std::shared_ptr< ContextType > &  nativeContext,
jobject  javaInstance 
)
inline

◆ Unregister() [1/3]

template<typename NativeInstanceType, typename ContextType>
void ttv::binding::java::JavaNativeProxyRegistry< NativeInstanceType, ContextType >::Unregister ( jlong  jNativePointer)
inline

◆ Unregister() [2/3]

template<typename NativeInstanceType, typename ContextType>
void ttv::binding::java::JavaNativeProxyRegistry< NativeInstanceType, ContextType >::Unregister ( NativeInstanceType *  nativeInstance)
inline

◆ Unregister() [3/3]

template<typename NativeInstanceType, typename ContextType>
void ttv::binding::java::JavaNativeProxyRegistry< NativeInstanceType, ContextType >::Unregister ( jobject  javaInstance)
inline

Member Data Documentation

◆ mMutex

template<typename NativeInstanceType, typename ContextType>
std::shared_ptr<ttv::IMutex> ttv::binding::java::JavaNativeProxyRegistry< NativeInstanceType, ContextType >::mMutex
private

◆ mRegistry

template<typename NativeInstanceType, typename ContextType>
std::vector<std::shared_ptr<Entry> > ttv::binding::java::JavaNativeProxyRegistry< NativeInstanceType, ContextType >::mRegistry
private

The documentation for this class was generated from the following file: