From 5ce0bfb4e209352fd5fb1481e08511b1868f5555 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sat, 25 Mar 2023 00:07:30 +0100 Subject: [PATCH] Update Lua documentation script to use std:: instead of boost --- tools/fmt-luadoc.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tools/fmt-luadoc.php b/tools/fmt-luadoc.php index 8317f53b65..bcb428c85b 100755 --- a/tools/fmt-luadoc.php +++ b/tools/fmt-luadoc.php @@ -82,10 +82,10 @@ function my_die ($msg) { } ##function ptr_strip ($ctype) { -# # boost::shared_ptr> > > +# # std::shared_ptr> > > # # -> std::list -# $ctype = preg_replace ('/boost::shared_ptr<([^>]*)[ ]*>/', '$1', $ctype); -# return preg_replace ('/boost::shared_ptr<([^>]*)[ ]*>/', '$1', $ctype); +# $ctype = preg_replace ('/std::shared_ptr<([^>]*)[ ]*>/', '$1', $ctype); +# return preg_replace ('/std::shared_ptr<([^>]*)[ ]*>/', '$1', $ctype); #} function arg2lua ($argtype, $flags = 0) { @@ -454,7 +454,7 @@ foreach ($classlist as $ns => $cl) { if ($c['lua'] == $ns) { if (strpos ($c['type'], 'Pointer Class') !== false) { $classlist[$ns]['ptr'] = true; - $classlist[$ns]['cdecl'] = 'boost::shared_ptr< '.$c['decl']. ' >, boost::weak_ptr< '.$c['decl']. ' >'; + $classlist[$ns]['cdecl'] = 'std::shared_ptr< '.$c['decl']. ' >, std::weak_ptr< '.$c['decl']. ' >'; break; } else { $classlist[$ns]['cdecl'] = $c['decl']; @@ -519,8 +519,8 @@ function doxydoc ($canonical_declaration) { return $api[$canonical_declaration]['doc']; } // remove template namespace e.g. - // "ARDOUR::Track::bounceable(boost::shared_ptr" - // "ARDOUR::Track::bounceable(boost::shared_ptr" + // "ARDOUR::Track::bounceable(std::shared_ptr" + // "ARDOUR::Track::bounceable(std::shared_ptr" $cn = preg_replace ('/<[^>]*::([^>]*)>/', '<$1>', $canonical_declaration); if (isset ($api[$cn])) { $dox_found++; @@ -943,7 +943,7 @@ print (rv, ref[1], ref[2])

Pointer Classes

-Libardour makes extensive use of reference counted boost::shared_ptr to manage lifetimes. +Libardour makes extensive use of reference counted std::shared_ptr to manage lifetimes. The Lua bindings provide a complete abstraction of this. There are no pointers in Lua. For example a is a pointer in C++, but Lua functions operate on it like it was a class instance.

@@ -957,7 +957,7 @@ Construction may fail. e.g. .newplugin()

-The second case if for boost::weak_ptr. As opposed to boost::shared_ptr weak-pointers are not reference counted. +The second case if for std::weak_ptr. As opposed to std::shared_ptr weak-pointers are not reference counted. The object may vanish at any time. If Lua code calls a method on a nil object, the interpreter will raise an exception and the script will not continue. This is not unlike a = nil a:test() which results in en error "attempt to index a nil value".