13
0
Commit Graph

93 Commits

Author SHA1 Message Date
dbc3008163
Add Lua Bindings for const shared_ptr lists (295dbd8e1e) 2023-04-12 20:47:35 +02:00
b35518e212 switch from boost::{shared,weak}_ptr to std::{shared,weak}_ptr
This is mostly a simple lexical search+replace but the absence of operator< for
std::weak_ptr<T> leads to some complications, particularly with Evoral::Sequence
and ExportPortChannel.
2023-03-24 14:19:15 -06:00
39ed528e25 std-ize: convert all boost shared/weak ptr includes to <memory>
Also fix stdint.h -> cstdint and alphabetically order std includes
2023-03-24 14:19:15 -06:00
9914732004
Potential fix for C++20 std::set::* ambiguity
(until C++20) bool empty() const noexcept;
(since C++20) [[nodiscard]] bool empty() const noexcept;
2022-10-19 16:06:47 +02:00
46b14498f8
Prepare Lua bindings for std::set::insert 2022-10-17 23:09:04 +02:00
e98fe4729e
LuaBridge - add API to try convert a value
This in in preparation to overload operators
2022-09-26 21:39:21 +02:00
Raphael Isemann
3dfcbf17b2
Fix memory leak in ctorNilPtrPlacementProxy 2022-04-08 18:21:55 +02:00
7bf89ce109 Constification: make Stateful::get_state() const, with all other required const-ness added (libs) 2022-04-06 21:56:59 -06:00
d51a1ccd99
Add API to modify Lua Metatable and set Metamethods
This allows to map C++ operators to be used as Lua
arithmetic and relational operations.
2022-01-24 06:23:16 +01:00
Mads Kiilerich
8bb91099c5 wscript: drop configure statements already present in the top level wscript
Avoid repeated pointless configure messages like:
Checking for 'g++' (C++ compiler!)                   : /usr/lib64/ccache/g++
Checking for 'gcc' (C compiler)                      : /usr/lib64/ccache/gcc
2022-01-22 22:19:03 +01:00
1c0593201c
Allow Lua bindings up to 12 method arguments 2021-12-03 13:32:49 +01:00
115c79874a
Fix Lua bindings for C++17/C++20 -- #8683
std::list/vector/map declarations change, requiring
explicit cast to avoid FuncTraits ambiguities.
2021-05-02 16:36:30 +02:00
John Emmas
b625461132 Guard some code which isn't currently buildable with VS2019
For some unknown reason, VC++2019 won't let us take the address of std::list::unique() - although other std::list members seem okay. I've spent weeks tracking this down but there's no fix available AFAICT.

I've flagged it up to the MSVC development team - just don't hold your breath !!
2021-03-06 11:12:02 +00:00
038307fef6
Allow Lua bindings up to 11 args 2021-01-08 22:50:37 +01:00
7c6eadd84a
Fix some doxygen warnings 2020-03-02 17:58:03 +01:00
34c4602e61
Lua Array, assert indices > 0 2020-02-06 17:30:21 +01:00
fbacb13d2d
Extend Lua binding for static methods
This add support for Lua bindings for static member
functions in weak/share ptr class bindings.
2020-02-06 17:30:21 +01:00
bca825e515
NO-OP: whitespace 2020-01-14 00:52:24 +01:00
5e1a73a28c
Add Lua typecast from C++ vector to C-Array
This is useful for MIDI bytes amongst other things
2019-12-01 21:32:10 +01:00
78cf0e5235
Customize Lua GC, add object-memory-lock API.
Add custom API to prevent Lua Objects from being garbage collected.
This is intended to for Ardour LuaBridge bindings (~1MB Objects:
tables, functions and userdata).
The bindings are persistent and the gc can skip them in mark & sweep
phases. This is a significant performance improvement for garbage
collection.

Note. The next version of Lua (5.4) will come with a generational-gc
rather than an incremental, so extending the API at this point in time
is acceptable.
2019-10-29 05:45:43 +01:00
130211a4bd
Update Lua to upstream 5.3.5 2019-10-29 05:36:24 +01:00
0301c47f6b
Update core library GPL boilerplate and (C) from git log 2019-08-03 15:53:17 +02:00
bed2eb2e33
Fix std::list<hared_ptr<>> front/back methods
Shared pointer reference accessors can't be const
2019-05-17 12:09:07 +02:00
3da07e6736
Special case Lua copy-construction of trackable instances
This fixes an crashing issue with ArdourUI.SelectionList a bug
introduced in 6dc3bdf252 and 35dcd46d7d.

Since removal of the special cases in 35dcd46d7d, when using
a C-pointer in a std::list<>,
  std::list<class*>::push_back(TypeListValue)
TypeListValues<>'s Head was expanded to  "class*& const"
implied by void ::push_back(const T& value);

This resulted in lifetime issues with a classes that derive
from sigc::trackable (e.g. Ardour's Selection).
The reference leaves scope and isn't duplicated when it is pushed back
to the std::list<>.

The script scripts/select_every_2nd_region.lua crashed because entries
in the SelectionList were no longer valid.

Previously (before 6dc3bdf252) TypeListValues explicitly
copy-constructed the value to work around the lifetime issue.
This new solution bypasses the issue by directly using the c-pointer
without dereferencing it.
2019-04-12 05:45:27 +02:00
8ed33f1bc7 remove use of hardcoded -fPIC compiler flag, and use compiler flag dict instead 2018-10-14 22:06:11 -04:00
9506a294c7 Adapt our remaining MSVC projects for 'boost::atomic' (in case it later gets extended to the other libs)
Stage 1 of 3 (more to follow)
2018-09-30 08:56:12 +01:00
79f01bc889 Initial changes needed for building Mixbus (with MSVC) as version 5
(Mixbus itself will probably need extra changes)
2018-09-10 07:14:59 +01:00
f2ca0c144b Customize Lua GC, add object-memory-lock API.
Add custom API to prevent Lua Objects from being garbage collected.
This is intended to for Ardour LuaBridge bindings (~1MB Objects:
tables, functions and userdata).
The bindings are persistent and the gc can skip them in mark & sweep
phases. This is a significant performance improvement for garbage
collection.

Note. The next version of Lua (5.4) will come with a generational-gc
rather than an incremental, so extending the API at this point in time
is acceptable.
2018-03-19 02:23:09 +01:00
89f0604d89 Allow loadfile in non-rt scripts 2018-03-06 21:47:30 +01:00
b9c9777b9a When building with MSVC, allow for the fact that Mixbus and Ardour can be using different versions of the SESSION_FILE format 2018-02-15 09:03:32 +00:00
6f019faaa0 Accommodate the change from libtimecode to libtemporal 2018-02-14 10:02:11 +00:00
77d16999b5 Tweak Lua GC 2017-11-29 12:06:42 +01:00
44cf448839 update to lua-5.3.4 2017-11-29 12:06:42 +01:00
e951e68780 Add luaRef is Boolean 2017-08-18 20:42:55 +02:00
0191a9c4c2 Centralize Lua sandboxing 2017-08-10 02:25:49 +02:00
ea8c6e9fc8 Fix hiding Lua __metatable -- prevent setmetatable() override 2017-03-30 05:06:34 +02:00
412b6a4cb9 Lua: make external (static) functions available for const objects.
This fixes iterators on const std::lists<>& and const std::map<>&
2017-03-30 04:15:28 +02:00
4a180e68ba Special case const std::string& Lua binding.
since 6dc3bdf, a const string reference would leave scope with Lua code
     fn("text")
calling a C++
     fn (const std::string&)
before the C++ function is called.
2017-03-22 16:59:02 +01:00
35dcd46d7d remove cruft (following 6dc3bdf) 2017-03-22 16:55:19 +01:00
6dc3bdf252 Fix LuaBindings TypeList copy-ctor
Determining the class type copy constructed references.
Const-references passed to C++ functions were copies.
2017-03-18 18:30:51 +01:00
bc300ddab7 Make Lua std::set bindings more generic, (prepare for multiset etc) 2017-03-18 14:35:29 +01:00
51d43c6e14 drop lua documentation for deprecated "sameinstance()" 2017-03-16 20:56:32 +01:00
a2094b6831 Lua: provide instance-equal check as '==' comparator.
This deprecated explicit the "sameinstance()" method
2017-03-16 20:08:17 +01:00
71fd94b422 LuaBridge: Dedicated type for pointer-lists and const version
"class C*" cannot be defined nor resolved, so STL containers
to class instance pointers need to be special-cased.
2017-02-23 22:32:32 +01:00
37dc93b40a luaBridge support const references to class-instance pointers
Support passing "T*" as as "const T* &"  argument
e.g. std::list<T*>::push_back ( const T* & )
2017-02-23 22:32:32 +01:00
226b2a526e Add Lua bindings for std::list ::front() and ::back() 2017-02-20 00:30:15 +01:00
659701c59b Fix lua-doc (Null pointer c'tor doc) 2017-02-14 14:44:22 +01:00
6f7f527e1d Lua add an Empty/Nil shared-pointer constructor 2017-01-21 20:18:27 +01:00
d0b42aee0e LuaBindings: prefer shared_ptr over weak_ptr 2017-01-21 20:18:27 +01:00
b25cd7683b Allow Lua bindings up to 10 args 2017-01-20 21:23:05 +01:00