CStringArrayMapper

public class CStringArrayMapper implements Mapper

Mapper for C string arrays.

Fields

strings2addr

public Map<String[], Pointer> strings2addr

Collection used for caching generated native C string arrays.

Because this is a weak has map, the C string arrays will be released after every Java reference to them is gone.

Methods

toJava

public Object toJava(long peer, JavaObjectConstructionInfo info)

Throws runtime error, because there is no way to support this direction.

toNative

public long toNative(Object instance, NativeObjectConstructionInfo info)

Creates a C string array.

At first it lookups in the cache, if it results in a success, then it uses it as a result. Otherwise, it creates a C string array and cache it in strings2addr and returns it.