Package 

Interface StateWrapper


  • 
    public interface StateWrapper
    
                        

    This is a wrapper that can be used for passing State objects from Fabric C++ core to platform-specific components in Java. State allows you to break out of uni-directional dataflow by calling updateState, which communicates state back to the C++ layer.

    • Method Summary

      Modifier and Type Method Description
      abstract ReadableMapBuffer getStateDataMapBuffer() Get a ReadableMapBuffer object from the C++ layer, which is a K/V map of short keys to values.
      abstract ReadableNativeMap getStateData() Get a ReadableNativeMap object from the C++ layer, which is a K/V map of string keys to values.
      abstract void updateState(WritableMap map) Pass a map of values back to the C++ layer.
      abstract void destroyState() Mark state as unused and clean up in Java and in native.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • updateState

         abstract void updateState(WritableMap map)

        Pass a map of values back to the C++ layer. The operation is performed synchronously and cannotfail.

      • destroyState

         abstract void destroyState()

        Mark state as unused and clean up in Java and in native. This should be called as early aspossible when you know a StateWrapper will no longer be used. If there's ANY chance of it beingused legitimately, don't destroy it! It is expected that all StateWrappers are destroyedimmediately upon stopSurface.