The OpenD Programming Language

wrapNativeObject

Wraps a class. If you are manually managing the memory, remember the jsvar may keep a reference to the object; don't free it!

To use this: var a = wrapNativeObject(your_d_object); OR var a = your_d_object;

By default, it will wrap all methods and members with a public or greater protection level. The second template parameter can filter things differently. FIXME implement this

  1. WrappedNativeObject wrapNativeObject(Class obj)
    WrappedNativeObject
    wrapNativeObject
    (
    Class
    bool special = false
    )
    (
    Class obj
    )
    if (
    is(Class == class) ||
    is(Class == interface)
    )
  2. WrappedNativeObject wrapNativeObject(Struct* obj)

Meta

History

This became the default after April 24, 2020. Previously, var.opAssign would wrapOpaquely instead.