Commit Graph

52 Commits

Author SHA1 Message Date
ThePhD
330df79ab9 OoOoOooh and the world exploooodes.
Added new examples to illustrate a few things people were wondering about
HEAVILY fixed up usertypes and inheritance. Again. Sigh. One day it'll all be correct.
2016-09-17 22:15:46 -04:00
OrfeasZ
95ddf46b55 Introduced a new simple_usertype class which derives from usertype.
Exposed an "add" function for it in order to allow adding members one at a time before registration.
Introduced state_view.create_simple_usertype<T>() methods for creating simple_usertypes.
2016-09-17 18:22:19 +03:00
ThePhD
cf76f6baa0 V E T T E D
Slight breaking change, but at the source level almost nothing changes (ipairs is the only thing that changes because for some reason it checks if what is passed is a table and that really doesn't make any fucking sense)
Closes #195
Closes #196
2016-08-23 21:42:27 -04:00
ThePhD
27174aba9c This mega-commit produces simple_usertype to allow for faster compile times by avoiding the use of __index internally. It sacrifices some speed and some storage optimizations and also does not allow variable syntax, but the produced table is directly modifiable.
Adds a `protect()` function to trigger safety for an item.
This commit also optimizes away all instances of virtual function calls for function calls and storage. Will need to test speed to see how it works out.
Closes #133
Closes #134
Closes #135
Closes #136
2016-07-07 16:52:39 -04:00
ThePhD
09ee4db1ed More templated fixes.
Closes #131
Closes #126, for the time being -- we can't make it go any faster without fundamentally breaking the system, and I can't do that to users rn
2016-06-29 14:08:26 -04:00
ThePhD
374acaa7f5 Attempt #1 at reducing compiler overhead for large numbers of template instantiations. 2016-06-27 12:15:32 -04:00
ThePhD
556be8da98 Documentation updates -- require function and add function and size function needed documentation
New `add` function as requested by @EliasD
2016-06-19 17:59:40 -04:00
ThePhD
c458849d29 Many of the tests are still busted, but we're getting closer.
Closes #96
Closes #79
Fixes #105 - but we still need to double-check and add a test to prove it
2016-06-06 15:46:53 -04:00
ThePhD
e35fe6be85 This mega-commit implements the new usertype_metatable while keeping everything else still intact. Blurgh, managing API versions suck... 2016-06-03 21:40:23 -04:00
ThePhD
3b81a7c85f VC++ is a butt, but this Closes #91
It prepares for #97 as well, and blocks out #95 until I can be assed
Now, it's either performance or handling sol::property ...
2016-05-19 02:15:42 -04:00
ThePhD
a4e3caee15 TOPKEK initializers. 2016-05-11 22:09:17 -04:00
ThePhD
f1cedcb922 error on bad usertypes 2016-05-11 15:55:07 -04:00
ThePhD
2aa5ab77a8 Ordering issues make me sad. 2016-05-03 15:17:14 -04:00
ThePhD
9e31119f16 This commit adds some QoI constructor keys / types, as well as implements make_object. The documentation has been updated as well.
Closes #78
Closes #77
Closes #76
Closes #75
2016-05-03 14:19:30 -04:00
ThePhD
38d21827b1 :l Stop finding bugs in my code -- unique_usertype_traits implemented, sol::overloaded work for static functions 2016-04-24 01:39:44 -04:00
ThePhD
69ad2b4c71 better static assert 2016-04-22 17:59:44 -04:00
ThePhD
2cfe74cc7f Better demangling
Userdata pushed before the usertype is pushed will not latch onto the new metatable if its added
Updated tests
2016-04-22 17:06:56 -04:00
ThePhD
88155d44e0 sol::property is implemented for usertypes now
sol::this_state is  a transparent argument that gets the current state at any position in any callback
sol::variadic_args allows a person to get something that can reference the "rest of the arguments", though it doesn't enforce that it has to be the last argument

Closes #57
Closes #59
Closes #60
2016-04-17 02:18:34 -04:00
ThePhD
42f4455383 Allow for "static functions" to be registered on userdata like other parts of the framework, as well as self-contained structs and lambas.
sol::readonly for the ability to make a variable set on a userdata readonly.
No support for property yet: put on issues list for later
2016-04-11 01:02:43 -04:00
ThePhD
5acb33e2bc full-on optional support. so much support it's coming through my eyeballs. Goodness.
Support for c_call wrapper to be a thing.
2016-03-30 00:31:18 -04:00
ThePhD
09a0a5051a Documentation updates and new stack::check_get API. 2016-03-24 15:45:44 -04:00
ThePhD
97e36f70c5 Alright, NOW everything's kosher. Bwuh, byte order marks... 2016-03-14 09:53:24 -04:00
ThePhD
62f082d999 documentation fixes from feedback and fixes! 2016-03-14 02:34:02 -04:00
ThePhD
c42c1bafe5 Documentation fixes, new tests, unique/shared_ptr support.
Closes #32
2016-03-13 08:30:14 -04:00
ThePhD
338278edf7 The docs are here. 2016-03-11 17:47:15 -05:00
ThePhD
1a9c7484b1 Fix up the API; prepare for release. 2016-03-11 11:34:44 -05:00
ThePhD
19578538e7 Inheritance 2016-03-05 01:43:45 -05:00
ThePhD
923c774d5e ability for functions that throw not bound by sol to catch and return lua errors that can be used by a handler function (for protected function). 2016-03-02 20:45:52 -05:00
ThePhD
251e350539 coroutines \o/ 2016-02-27 02:43:53 -05:00
ThePhD
1341aafa27 Unfortunately, exceptions require some overhead in luajit... overhead we can't always accept on behalf of the user. 2016-02-25 13:04:04 -05:00
ThePhD
3d7a93ae1c Put detail classes not part of the interface into deeper namespaces to clear up the to level. 2016-02-23 23:39:46 -05:00
ThePhD
019c7b037b Huge improvements to the library and fixes to compile in g++.
usertype now respects factory functions and does not make default constructors/destructors unless the compiler says its okay
new and __gc functions can be overridden for usertypes to provide handle-like creation and deletion functions
Overloading match fixes
RAII improvements for all usertypes
Added tests to make sure these features stay
2016-02-21 19:26:58 -05:00
ThePhD
b2b73db5cb overloading searching improvements and general refactoring for cleaner implementation. 2016-02-18 22:17:52 -05:00
ThePhD
0ee92c0142 This is hard.... 2016-02-16 21:22:07 -05:00
ThePhD
f62c53f155 x64 build fixes 2016-02-15 09:24:59 -05:00
ThePhD
228609ee17 Addresses derp from refactoring and #12 2016-02-12 12:47:05 -05:00
ThePhD
427194bc92 Improved functions example and adjusted all errors for g++ conformance with -Wall -Werror 2016-02-10 12:12:09 -05:00
ThePhD
2788abb34e Overloading now works and there are tests to back it up. The codebase now relies on some C++14 features explicitly. 2016-02-10 11:36:00 -05:00
ThePhD
9372b54b02 Preparing for overload support
Preparing to benchmarking of several different lua frameworks
2016-02-09 03:38:11 -05:00
ThePhD
b66c7f015a Significant change to how userdata is stored to make access consistent across values/references/pointers. 2016-02-01 11:56:44 -05:00
ThePhD
1d93f560f2 more luajit compatibility fixes - works with Lua 5.1, 5.2, 5.3
additional tests to make sure pass-by-value and copy semantics work as intended
new proxy_base class to reduce code duplication
update function / protected_function usage (to solve starwing's issue while keeping code as clean as possible)
2016-02-01 03:27:06 -05:00
ThePhD
31e7857870 Merge remote-tracking branch 'root/develop' into develop
# Conflicts:
#	examples/usertype.cpp
#	sol.hpp
#	sol/debug.hpp
#	sol/default_construct.hpp
#	sol/demangle.hpp
#	sol/deprecate.hpp
#	sol/error.hpp
#	sol/function.hpp
#	sol/function_types.hpp
#	sol/object.hpp
#	sol/proxy.hpp
#	sol/reference.hpp
#	sol/resolve.hpp
#	sol/stack.hpp
#	sol/state.hpp
#	sol/table.hpp
#	sol/traits.hpp
#	sol/tuple.hpp
#	sol/types.hpp
#	sol/usertype.hpp
#	sol/usertype_traits.hpp
2016-01-24 12:16:38 -05:00
ThePhD
93d532094e object is now more flexible while still supporting the same semantics
indentation an spacing fixes for everything
2015-10-20 21:38:28 -04:00
Rapptz
38d03eef6e Update copyright year. 2015-07-21 19:51:17 -04:00
ThePhD
74677a9125 RIP tabs. 2015-05-27 02:28:31 -04:00
ThePhD
712afc924f Conversions from nil to nullptr and vice-versa now properly work
Fix for really bad derp in metamethod registration
2015-05-27 02:23:37 -04:00
ThePhD
184f16d7fa Updated copyright headers and added compatibility with lua 5.1.5 and luajit!
This means sol can now run on the fastest dynamic language implementation ever!
Wooo!~
2015-05-24 21:29:21 -04:00
ThePhD
bd4492b85b This mega-commit introduces Visual Studio 2015 CTP 6 support.
sol::object had a few reference leaks in the way it retrieved values: it now does it properly without leaving the stack at +1 item
sol::stack was drastically cleaned up, with the following key change:
    * sol::stack::push now returns an integer of the number of things its pushed (usually 1, but can be more) (Thanks, @PrincessNyanara!)
    * sol::stack::call now calls functions flexibly, and getting is done more reliably
    * due to the innovation of stack::call and using absolute indices, we no longer have to use reverse_call style programming to deal with lua
    * sol::reference::get_type is now const-correct
    * sol::state and sol::table now have a cleaned up `get` implementation since it is no longer held back by the ugliness of VC++'s incapability to handle templates
    * the name `sol::userdata` now belongs to a type that actually encapsualtes a void* with a pusher/getter than gets a userdata void* value (TODO: give it a template to make it static_cast to that type on get?)
    * lightuserdata_t -> light_userdata, upvalue_t -> upvalue as type names (mostly details)
    * pushers for various types were updated to return integers
2015-03-01 21:14:42 -05:00
ThePhD
699ae140c8 Use 2 string types to properly filter bad name-based usertype overloads. 2014-09-29 23:10:33 -04:00
ThePhD
a217fa5c7a Proper deprecation to alert users to API name changes. 2014-09-29 23:10:32 -04:00