Commit Graph

20 Commits

Author SHA1 Message Date
PrincessNyanara
423e44d6dc all tests compile excepted related to test_table_return_two(), which uses contiguous container std::vector but has key-value pairs inside of it
c++ semantics dictate that it's accessed by index, but the tests seem to want to indicate that it should be accessed like a hashmap (or just using basic lua table semantics)
i have no idea how to make this incompatibility work in the new system...
i will ask repo master if he knows anything
2014-06-09 06:29:03 -04:00
PrincessNyanara
77901bb654 massive rework of stack
get turned into getter<T>, matches pusher<T> and uses same semantics as std::allocator and other things used throughout the codebase
-----
userdata has its traits defined outside in new file of userdata to prevent errors when trying to use those typetraits in places before userdata.hpp gets included
userdata was changed to support returning itself via pointers or references.
rework of stack changes semantics based on T&, T*, and T&& (the last one tries to create a new userdata and move in data)
solves problems maybe presented in https://github.com/Rapptz/sol/issues/25

-----
container.hpp is attempt at solving original problem before going on wild tangent with userdata, stack, and get
is going to attempt to use userdata to allow transporation of containers losslessly, perhaps without copying need
-----
found out trying to return a std::function does not work -- not sure what do exactly?
perhaps should push c closure as last thing, but right now it is tied to a key value (code comes from table.hpp and set_function)
will just have to think over how stack arranges itself and learn what to do
2014-06-09 06:28:55 -04:00
Rapptz
08c94e1a67 Renamed demangling function 2014-05-31 06:08:12 -04:00
ThePhD
0315a43b1b Userdata-classes are now the assumed type for any unmatching T which are not derived from sol::reference or not one of the basic types
tests added to confirm userdata can be passed into C++ function types
demangle is now named lua_demangle, and the core demangle without any replacements (to fit lua) is just named demangle
Formattings fixes everywhere
2014-05-30 19:58:47 -04:00
ThePhD
41e1ca2baa Additions for gitignore for the new files that are necessary to kick around qtCreator
Fix for userdata to accept base classes where the derived class uses the name of a base member function to access it (Derived::get_num, where get_num is only implemented in Base::get_num)
VC++ makes this acceptance easy by taking the name as "Derived", but GCC and Clang
2014-05-25 13:46:23 -04:00
Rapptz
932e29a841 Renamed sol_error to error 2014-05-21 22:24:15 -04:00
ThePhD
be839bdcd2 We no longer need the register_into(const table& s) function: removing~ 2014-04-27 09:13:45 -04:00
Rapptz
0ff295f61e Switch from static member strings to userdata_traits 2014-04-27 05:08:39 -04:00
Rapptz
6a280dc131 Format changes 2014-04-27 03:25:47 -04:00
Rapptz
2f76b96061 Switch member function pointer and string pair in initialisation 2014-04-27 02:35:11 -04:00
Rapptz
b323a62b2a Fix compiler error with cv-qualifiers on member function pointers 2014-04-27 02:26:06 -04:00
Rapptz
8cd3b18f7b Fix test failure 2014-04-27 01:29:37 -04:00
Rapptz
63bc2b06cb Fix compiler errors, tests failing however 2014-04-27 00:53:57 -04:00
ThePhD
0088002abf Class binding now works with multiple functions
Refactoring on function_types.hpp performed to slim down some of the calls: could use more refactoring
Drastically simplified userdata's binding capabilities: constructor supports both `:` and `.` syntax (but member functions DO NOT).
All tests are passing
2014-04-26 18:24:54 -04:00
ThePhD
4d6d39be88 Merge remote-tracking branch 'root/classes' 2014-04-26 00:19:45 -04:00
ThePhD
4c102605e8 Custom constructors, but apparently there's something on the stack and we can't get at its type? 2014-04-26 00:19:36 -04:00
Rapptz
077f5fd258 Massive renaming of lua_function.hpp 2014-04-25 22:05:58 -04:00
Rapptz
c9bf032d36 Fix all compile errors on GCC 2014-04-25 20:53:36 -04:00
Rapptz
6b54f99e50 Do some renaming of lua_function.hpp and fix some compiler errors 2014-04-25 20:42:38 -04:00
ThePhD
2243bec052 userdata<T> now works and compiles on MSVC.
It's going to take serious work to make it happen in GCC, plus the fact that 4.9 is still giving me
so many errors I can't even read it...
 I'll let Rapptz figure it out, but later.
Sexy class bindings, yes!
2014-04-25 20:08:07 -04:00