ammer.Lib
The ammer.Lib type provides a number of methods for client interaction with ammer libraries. These methods are (by necessity) macro methods. As a result, their signatures displayed below are only approximations.
ammer.Lib.allocStruct(type:Class<Struct>, ?initialValues:{ ... }):Struct
Allocates a struct of the given type, optionally assigning the given initial values to its fields. The type must be annotated with the @:ammer.alloc metadata.
Arguments
type— The name (or full path) of the type to allocate.initialValues— An object literal where the keys and values correspond to fields and their initial values, respectively.
ammer.Lib.createHaxeRef(type:Class<T>, value:T):ammer.ffi.Haxe<T>
Creates a reference to the given Haxe value. See Haxe types.
Arguments
type— The name (or full path) of the Haxe type. This is required to make sure there are no unexpected type mismatch problems e.g. when passing references to anonymous structures.value— The Haxe value to create a reference to.
ammer.Lib.freeStruct(instance:Struct):Void
Deallocates the given pointer. The type must be annotated with the @:ammer.alloc metadata.
Arguments
instance— The value to deallocate.
ammer.Lib.nullPtrStruct(type:Class<Struct>):Struct
Returns a null pointer of the given type.
Arguments
type— The name (or full path) of the type.