Class PanamaGlobal

java.lang.Object
ai.tegmentum.wasmtime4j.panama.PanamaGlobal
All Implemented Interfaces:
ai.tegmentum.wasmtime4j.WasmGlobal, AutoCloseable

public final class PanamaGlobal extends Object implements ai.tegmentum.wasmtime4j.WasmGlobal, AutoCloseable
Panama FFI implementation of WebAssembly Global with native handle support.
Since:
1.0.0
  • Constructor Summary

    Constructors
    Constructor
    Description
    PanamaGlobal(ai.tegmentum.wasmtime4j.WasmValueType type, boolean mutable, ai.tegmentum.wasmtime4j.WasmValue initialValue, PanamaStore store)
    Creates a new Panama global with a native handle.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    ai.tegmentum.wasmtime4j.WasmValue
    get()
     
    ai.tegmentum.wasmtime4j.type.GlobalType
     
    Gets the native global pointer.
    ai.tegmentum.wasmtime4j.WasmValueType
     
    boolean
    Checks if the global has been closed.
    boolean
     
    void
    set(ai.tegmentum.wasmtime4j.WasmValue value)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface ai.tegmentum.wasmtime4j.WasmGlobal

    getValue
  • Constructor Details

    • PanamaGlobal

      public PanamaGlobal(ai.tegmentum.wasmtime4j.WasmValueType type, boolean mutable, ai.tegmentum.wasmtime4j.WasmValue initialValue, PanamaStore store)
      Creates a new Panama global with a native handle.
      Parameters:
      type - the value type of this global
      mutable - whether this global is mutable
      initialValue - the initial value
      store - the store context
  • Method Details

    • get

      public ai.tegmentum.wasmtime4j.WasmValue get()
      Specified by:
      get in interface ai.tegmentum.wasmtime4j.WasmGlobal
    • set

      public void set(ai.tegmentum.wasmtime4j.WasmValue value)
      Specified by:
      set in interface ai.tegmentum.wasmtime4j.WasmGlobal
    • getType

      public ai.tegmentum.wasmtime4j.WasmValueType getType()
      Specified by:
      getType in interface ai.tegmentum.wasmtime4j.WasmGlobal
    • isMutable

      public boolean isMutable()
      Specified by:
      isMutable in interface ai.tegmentum.wasmtime4j.WasmGlobal
    • getGlobalType

      public ai.tegmentum.wasmtime4j.type.GlobalType getGlobalType()
      Specified by:
      getGlobalType in interface ai.tegmentum.wasmtime4j.WasmGlobal
    • getNativeGlobal

      public MemorySegment getNativeGlobal()
      Gets the native global pointer.
      Returns:
      native global memory segment
    • isClosed

      public boolean isClosed()
      Checks if the global has been closed.
      Returns:
      true if closed, false otherwise
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable