1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153
|
LUABIND 7.1 changes
===================
* Applied patches from Evan Wies to support lua 5.1
* added a new assignment operator and a special value,
luabind::nil, to set table entries to nil.
LUABIND BETA 7 changes
======================
We have introduced a change that may break current code,
nothing will break silently however.
The change is that the previous way of writing virtual class
wrappers was to have it contain an object that refered to
the actual lua object. This would cause a dependency cycle
and result in the object never being garbage collected until
the whole lua state was closed. The new way is to use a newly
introduced type called weak_ref, instead of the object.
See docs for more info.
Changes from beta6
------------------
* renamed get_globals() and get_registry() to globals()
and registry()
* rewrote object and made a few changes:
* moved iterators out of the class and removed
begin/end/raw_begin/raw_end/array_begin/array_end.
See updated docs for how to use the iterators.
* removed array_iterator alltogether
* renamed pushvalue() to push()
* removed set()
* replaced the constructor that creates an object from
a stack value (with better syntax)
* moved out the member functions type(), at() and raw_at()
and made them free functions. (type(), gettable(), settable(),
rawget() and rawset())
* renamed lua_state() to interpreter()
* object now supports nested indexing (with []-operator) as
well as function calls directly on indexed values (i.e.
globals(L)["my_fun"](10)). The indexing has also been made
more efficient through the use of expression templates.
* removed functor (use object with call_function() instead)
* using boost-build, and has better support for building
as a dll. The makefiles still works.
* removed the option LUABIND_DONT_COPY_STRING, this means
that luabind will not provide storage for name strings.
i.e. the strings sent to module, namespace_ and class_
are expected to have global storage (it's no problem as
long as you use string constants)
wrappers
........
Wrapper classes now have to derive from wrap_base and they don't have
to contain any references to the lua-part (this is done by the base
class now). The overload of call_member() that previuosly took a
weak_ref as first parameter is now a member function of the wrap_base
class and no longer takes the self reference argument. Example:
struct A
{
virtual ~A() {}
virtual std::string f() { return "A:f()"; }
};
struct A_wrap : A, wrap_base
{
virtual std::string f()
{
return call_member<std::string>("f");
}
static std::string default_f(A* p)
{
return p->A::f();
}
};
The changes when registering the virtual functions is that you now
have to register both the virtual function _and_ the default
implementation of the function (for static dispatch). Like this:
module(L)
[
class_<A, A_wrap>("A")
.def(constructor<>())
.def("f", &A::f, &A_wrap::default_f)
]
If you update your luabind version without changing the way you register
virtual functions, it will still compile, but may give you runtime
errors.
With these changes adopt will work as expected on wrapped types (the
weak reference will be transformed into a strong reference internally).
These changes will also make dynamic function dispatch work from within
lua (and not just from c++ into lua).
policy placeholders
...................
luabind now handles member functions in a more general way.
The self reference that is passed as first parameter to
member functions is now refered to using the _1 placeholder
(instead of self). This means that the first argument to a
member function is refered to with _2.
additions
.........
* added __newindex metatable entry on c++ classes
* moved more code into cpp-files (hopefully reduces user
compile time slightly)
* the iterators are now true models of ForwardIterator
* error messages when writing non-matching type to a property
or attribute.
* support for inner scopes
* support for nil to holder_type conversion
* wrappers for lua_resume() with the same syntax as
call_function() (resume_function() and resume())
bugfixes
........
* bugs in the overload resolution could give internal errors
in some cases.
* def_readonly and def_readwrite will now return references
if the type is not a primitive type. This will allow
chained . operators.
* object_cast() of uninitialized objects works
* supports strings with extra nulls in them (not for member
names though)
* fixed reference leakage by reducing the amount of explicit
resource management.
* fixed bug where matchers for getters and setters did not
propagate to derived classes.
* fixed leak when using class wrappers. They had a reference
cycle that wouldn't get collected (until the lua_State was
closed).
* lots of other fixes we can't remember
|