Re: Deriving in lua, more then 10 parameters for a method

Roman Kubiak <[email protected]> Fri, 5 Sep 2014 12:51:30 +0200
Newsgroups gmane.comp.lang.lua.bind.user
Message-ID <CACugK=byT31ftTJgm2RL08Pn2uvS8FkEPyzPSriYWf0393aGcw@mail.gmail.com>
--===============5420578174252468356==
Content-Type: multipart/alternative; boundary=f46d04447e27799aae05024f4032

--f46d04447e27799aae05024f4032
Content-Type: text/plain; charset=UTF-8

Thank you very much for that answer, i really didn't want to dig into boost
but i got the courage to do that and it worked.
Now i can just fall back to the original idea that's well documented.

Thanks again.

====================================================================
         _ _                              _           _ _        _
__ _____| | |_ __ _ __ _ ___   __ ___ _ _| |_ _ _ ___| | |___ __| |
\ V / _ \ |  _/ _` / _` / -_) / _/ _ \ ' \  _| '_/ _ \ | / -_) _` |
 \_/\___/_|\__\__,_\__, \___| \__\___/_||_\__|_| \___/_|_\___\__,_|
                   |___/
====================================================================





On Fri, Sep 5, 2014 at 12:00 AM, Chris Byrne <[email protected]> wrote:

> ok, I missed that last bit in your email. When changing LUABIND_MAX_ARITY
> to 20 there are indeed boost related compile errors.
>
> 2>s:\lib\luabind-0.9\luabind/detail/object_call.hpp(38): error C2977:
> 'boost::tuples::tuple' : too many template arguments
> 2>          s:\lib\boost_1_46_1\boost/tuple/detail/tuple_basic.hpp(470) :
> see declaration of 'boost::tuples::tuple'
> 2>          s:\lib\luabind-0.9\luabind/object.hpp(336) : see reference to
> class template instantiation 'luabind::adl::object_interface<T>' being
> compiled
>
> (excuse my super old versions of boost & luabind)
>
>
> Per:
> http://www.boost.org/doc/libs/1_56_0/libs/tuple/doc/tuple_users_guide.html *"The
> current version supports tuples with 0-10 elements"*
>
> and there's
> http://stackoverflow.com/questions/6425178/boost-tuple-increasing-maximum-number-of-elements which
> suggests a couple of options.
>
>
> i) Hack up tuple_basic.hpp and extend declarations out to the number of
> arguments you need
> ii) If your compiler(s) support variadic templates could consider changing
> luabind to use std::tuple
> iii) Changing luabind over to use boost::fusion::tuple which has
> a FUSION_MAX_VECTOR_SIZE definition
>
> Hard to know which is least effort. Sticking with boost (options i & iii)
> would be the most cross platform friendly (at least for now).
>
>
> Hacking up tuplic_basic.hpp is somewhat tedious and a quick search wasn't
> able to find someone who has already done this.
>
> Essentially involves extending out the number of template parameters:
> template <
>   class T0 = null_type, class T1 = null_type, class T2 = null_type,
>   class T3 = null_type, class T4 = null_type, class T5 = null_type,
>   class T6 = null_type, class T7 = null_type, class T8 = null_type,
>   class T9 = null_type, class T10 = null_type, class T11 = null_type,
>   class T12 = null_type, class T13 = null_type, class T14 = null_type>
> class tuple;
>
> along with the several supporting classes:
> // Tuple to cons mapper --------------------------------------------------
> template <class T0, class T1, class T2, class T3, class T4,
>           class T5, class T6, class T7, class T8, class T9,
>           class T10, class T11, class T12, class T13, class T14>
> struct map_tuple_to_cons
>
>
> -
>
> I would still recommend using a facade and avoid the need for more
> arguments.
>
>
> Kind Regards,
>  CB
>
>
> On Thu, Sep 4, 2014 at 12:41 PM, Roman Kubiak <[email protected]>
> wrote:
>
>>  Like i wrote, increasing that constant above 10 is impossible, you'll
>> get flooded with compile errors, if that constant goes above 10 something
>> needs to change in boost to handle that. My question what and how, i'm not
>> a big boost expert, i use it only for luabind so i was wondering if there
>> was a ready solution to get this working.
>>
>> cheers.
>>
>> ====================================================================
>>          _ _                              _           _ _        _
>> __ _____| | |_ __ _ __ _ ___   __ ___ _ _| |_ _ _ ___| | |___ __| |
>> \ V / _ \ |  _/ _` / _` / -_) / _/ _ \ ' \  _| '_/ _ \ | / -_) _` |
>>  \_/\___/_|\__\__,_\__, \___| \__\___/_||_\__|_| \___/_|_\___\__,_|
>>                    |___/
>> ====================================================================
>>
>>
>>
>>
>>
>> On Thu, Sep 4, 2014 at 7:18 PM, Chris Byrne <[email protected]>
>> wrote:
>>
>>> I would second that approach.
>>>
>>>
>>>  If you really want to go down the path of binding functions with more
>>> than 10 arguments, then I think you need to define LUABIND_MAX_ARITY with a
>>> value greater than 10.
>>>
>>>  10 being the default value if LUABIND_MAX_ARITY is not already defined:
>>>  https://github.com/luabind/luabind/blob/master/luabind/config.hpp
>>>
>>>  This is used during pre-processing to expand out and provide the
>>> necessary binding overloads (predating variadic templates).
>>>
>>>
>>>  I haven't tried this, so I can't promise that this is the only
>>> definition (or even the correct one). There is likely a similar
>>> limitation/definition within boost as well.
>>>
>>>
>>>  Kind Regards,
>>>  CB
>>>
>>>
>>>  On Thu, Sep 4, 2014 at 9:51 AM, Andreas Grob <
>>> [email protected]> wrote:
>>>
>>>>  Hi,
>>>>
>>>> How about wrapping the whole L&F class to have a cleaner interface? You
>>>> could store the original L&F inside that wrapper using pimpl and have a
>>>> method to move it out.
>>>>
>>>> Regards,
>>>> Andreas
>>>>
>>>> Am 04.09.2014 16:12, schrieb Roman Kubiak:
>>>>
>>>>   Helo.
>>>>
>>>>
>>>> I'm using a third party library for my application (JUCE), this library
>>>> has a large class called LookAndFeel, i want to expose that class to lua
>>>> via luabind.
>>>>
>>>> I started to do the work following the documentation, and using the
>>>> luabind::wrap_base approach, i got a few methods bound and it's all working
>>>> fine, until i hit a problem. Some of the methods in the original
>>>> LookAndFeel class have more then 10 parameters, and i can't bind those
>>>> methods using this approach.
>>>>
>>>>    One of the solutions i found would be to change the parameters and
>>>> wrap them in a structure, and that would be a good idea but i can't change
>>>> the original LookAndFeel class, and changing the class that derives from
>>>> luabind::wrap_base - that i'm implementing - so that it's methods take a
>>>> structure as a parameter instead of the actual parameters, makes those
>>>> methods unusable (luabind never calls them, since the parameter count and
>>>> type does not match the original LookAndFeel class).
>>>>
>>>>  Is there a way to solve this somehow, can i increase the limit of 10
>>>> parameters in luabind (trying to extend the ARITY macro over 10 causes
>>>> loades of compile errors).
>>>>
>>>>  Any help is welcome.
>>>>
>>>>  My class looks like:
>>>> class LLookAndFeel : public LookAndFeel_V3, public luabind::wrap_base
>>>> {
>>>>      virtual void drawButtonBackground (Graphics &g, Button &b, const
>>>> Colour &c, bool over, bool down) override
>>>>             { call<void>("drawButtonBackground", boost::ref (g),
>>>> boost::ref(b), c, over, down); }
>>>>         static void def_drawButtonBackground (LookAndFeel_V3 *ptr,
>>>> Graphics &g, Button &b, const Colour &c, bool over, bool down)
>>>>             { return (ptr->LookAndFeel_V3::drawButtonBackground
>>>> (g,b,c,over,down)); }
>>>>
>>>>  /* More methods are needed that have more then 10 parameters */
>>>>  }
>>>>
>>>>  Best regards.
>>>>
>>>> Roman Kubiak
>>>> http://ctrlr.org
>>>>  ====================================================================
>>>>          _ _                              _           _ _        _
>>>> __ _____| | |_ __ _ __ _ ___   __ ___ _ _| |_ _ _ ___| | |___ __| |
>>>> \ V / _ \ |  _/ _` / _` / -_) / _/ _ \ ' \  _| '_/ _ \ | / -_) _` |
>>>>  \_/\___/_|\__\__,_\__, \___| \__\___/_||_\__|_| \___/_|_\___\__,_|
>>>>                    |___/
>>>> ====================================================================
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>   ------------------------------------------------------------------------------
>>>> Slashdot TV.
>>>> Video for Nerds.  Stuff that matters.http://tv.slashdot.org/
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> luabind-user mailing [email protected]://lists.sourceforge.net/lists/listinfo/luabind-user
>>>>
>>>>
>>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Slashdot TV.
>>> Video for Nerds.  Stuff that matters.
>>> http://tv.slashdot.org/
>>> _______________________________________________
>>> luabind-user mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/luabind-user
>>>
>>>
>>
>
>
> ------------------------------------------------------------------------------
> Slashdot TV.
> Video for Nerds.  Stuff that matters.
> http://tv.slashdot.org/
> _______________________________________________
> luabind-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/luabind-user
>
>

--f46d04447e27799aae05024f4032
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_default" style=3D"font-family:courier =
new,monospace">Thank you very much for that answer, i really didn&#39;t wan=
t to dig into boost but i got the courage to do that and it worked.<br></di=
v><div class=3D"gmail_default" style=3D"font-family:courier new,monospace">=
Now i can just fall back to the original idea that&#39;s well documented.<b=
r><br>Thanks again.<br></div></div><div class=3D"gmail_extra"><br clear=3D"=
all"><div><font size=3D"1">=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D<br><span style=3D"font-family:courier new,monospace">=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 _ _=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 _=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 _ _=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0 _</span><br style=3D"font-family:courier new,monos=
pace"><span style=3D"font-family:courier new,monospace">__ _____| | |_ __ _=
 __ _ ___=C2=A0=C2=A0 __ ___ _ _| |_ _ _ ___| | |___ __| |</span><br style=
=3D"font-family:courier new,monospace"><span style=3D"font-family:courier n=
ew,monospace">\ V / _ \ |=C2=A0 _/ _` / _` / -_) / _/ _ \ &#39; \=C2=A0 _| =
&#39;_/ _ \ | / -_) _` |</span><br style=3D"font-family:courier new,monospa=
ce"><span style=3D"font-family:courier new,monospace">=C2=A0\_/\___/_|\__\_=
_,_\__, \___| \__\___/_||_\__|_| \___/_|_\___\__,_|</span><br style=3D"font=
-family:courier new,monospace"><span style=3D"font-family:courier new,monos=
pace">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |___/</span><br>=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<br style=3D"font-family:courier new,mo=
nospace"><br style=3D"font-family:courier new,monospace"><br style=3D"font-=
family:courier new,monospace"></font><br></div>
<br><br><div class=3D"gmail_quote">On Fri, Sep 5, 2014 at 12:00 AM, Chris B=
yrne <span dir=3D"ltr">&lt;<a href=3D"mailto:[email protected]" target=
=3D"_blank">[email protected]</a>&gt;</span> wrote:<br><blockquote clas=
s=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;pad=
ding-left:1ex"><div dir=3D"ltr">ok, I missed that last bit in your email. W=
hen changing=C2=A0LUABIND_MAX_ARITY to 20 there are indeed boost related co=
mpile errors.<div><br></div><div><div><font face=3D"courier new, monospace"=
>2&gt;s:\lib\luabind-0.9\luabind/detail/object_call.hpp(38): error C2977: &=
#39;boost::tuples::tuple&#39; : too many template arguments</font></div>

<div><font face=3D"courier new, monospace">2&gt; =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0s:\lib\boost_1_46_1\boost/tuple/detail/tuple_basic.hpp(470) : see=
 declaration of &#39;boost::tuples::tuple&#39;</font></div><div><font face=
=3D"courier new, monospace">2&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0s:\lib\=
luabind-0.9\luabind/object.hpp(336) : see reference to class template insta=
ntiation &#39;luabind::adl::object_interface&lt;T&gt;&#39; being compiled</=
font></div>

</div><div><br></div><div>(excuse my super old versions of boost &amp; luab=
ind)</div><div><br></div><div><br></div><div>Per: <a href=3D"http://www.boo=
st.org/doc/libs/1_56_0/libs/tuple/doc/tuple_users_guide.html" target=3D"_bl=
ank">http://www.boost.org/doc/libs/1_56_0/libs/tuple/doc/tuple_users_guide.=
html</a> <i>&quot;The current version supports tuples with 0-10 elements&qu=
ot;</i></div>

<div><br></div><div><div>and there&#39;s <a href=3D"http://stackoverflow.co=
m/questions/6425178/boost-tuple-increasing-maximum-number-of-elements" targ=
et=3D"_blank">http://stackoverflow.com/questions/6425178/boost-tuple-increa=
sing-maximum-number-of-elements</a>=C2=A0which suggests a couple of options=
.</div>

</div><div><br></div><div><br></div><div>i) Hack up tuple_basic.hpp and ext=
end declarations out to the number of arguments you need<br></div><div>ii) =
If your compiler(s) support variadic templates could consider changing luab=
ind to use std::tuple</div>

<div>iii) Changing luabind over to use boost::fusion::tuple which has a=C2=
=A0FUSION_MAX_VECTOR_SIZE definition</div><div><br></div><div>Hard to know =
which is least effort. Sticking with boost (options i &amp; iii) would be t=
he most cross platform friendly (at least for now).</div>

<div><br></div><div><br></div><div>Hacking up tuplic_basic.hpp is somewhat =
tedious and a quick search wasn&#39;t able to find someone who has already =
done this.</div><div><br></div><div>Essentially involves extending out the =
number of template parameters:</div>

<div><div><font face=3D"courier new, monospace">template &lt;</font></div><=
div><font face=3D"courier new, monospace">=C2=A0 class T0 =3D null_type, cl=
ass T1 =3D null_type, class T2 =3D null_type,</font></div><div><font face=
=3D"courier new, monospace">=C2=A0 class T3 =3D null_type, class T4 =3D nul=
l_type, class T5 =3D null_type,</font></div>

<div><font face=3D"courier new, monospace">=C2=A0 class T6 =3D null_type, c=
lass T7 =3D null_type, class T8 =3D null_type,</font></div><div><font face=
=3D"courier new, monospace">=C2=A0 class T9 =3D null_type, class T10 =3D nu=
ll_type, class T11 =3D null_type,</font></div>

<div><font face=3D"courier new, monospace">=C2=A0 class T12 =3D null_type, =
class T13 =3D null_type, class T14 =3D null_type&gt;</font></div><div><font=
 face=3D"courier new, monospace">class tuple;</font></div></div><div><br></=
div><div>along with the several supporting classes:</div>

<div><div><font face=3D"courier new, monospace">// Tuple to cons mapper ---=
-----------------------------------------------</font></div><div><font face=
=3D"courier new, monospace">template &lt;class T0, class T1, class T2, clas=
s T3, class T4,</font></div>

<div><font face=3D"courier new, monospace">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 class T5, class T6, class T7, class T8, class T9,</font></div><div><fon=
t face=3D"courier new, monospace">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 class =
T10, class T11, class T12, class T13, class T14&gt;</font></div>

<div><font face=3D"courier new, monospace">struct map_tuple_to_cons</font><=
/div></div><div><br></div><div><br></div><div>-</div><div><br></div><div>I =
would still recommend using a facade and avoid the need for more arguments.=
</div>

<div><br></div><div><br></div><div>Kind Regards,</div><div>=C2=A0CB</div><d=
iv><br></div><div class=3D"gmail_extra"><br><div class=3D"gmail_quote"><spa=
n class=3D"">On Thu, Sep 4, 2014 at 12:41 PM, Roman Kubiak <span dir=3D"ltr=
">&lt;<a href=3D"mailto:[email protected]" target=3D"_blank">kubiak.ro=
[email protected]</a>&gt;</span> wrote:<br>

</span><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-=
left:1px #ccc solid;padding-left:1ex">



<div><span class=3D"">
<div dir=3D"ltr">
<div style=3D"font-family:courier new,monospace">Like i wrote, increasing t=
hat constant above 10 is impossible, you&#39;ll get flooded with compile er=
rors, if that constant goes above 10 something needs to change in boost to =
handle that. My
 question what and how, i&#39;m not a big boost expert, i use it only for l=
uabind so i was wondering if there was a ready solution to get this working=
.<br>
<br>
cheers.<br>
</div>
</div>
</span><div class=3D"gmail_extra"><div><br clear=3D"all"><span class=3D"">
<div><font size=3D"1">=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D<br>
<span style=3D"font-family:courier new,monospace">=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0 _ _=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 _=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 _ _=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 _</span><br style=3D"font-family:courier new,monospace">
<span style=3D"font-family:courier new,monospace">__ _____| | |_ __ _ __ _ =
___=C2=A0=C2=A0 __ ___ _ _| |_ _ _ ___| | |___ __| |</span><br style=3D"fon=
t-family:courier new,monospace">
<span style=3D"font-family:courier new,monospace">\ V / _ \ |=C2=A0 _/ _` /=
 _` / -_) / _/ _ \ &#39; \=C2=A0 _| &#39;_/ _ \ | / -_) _` |</span><br styl=
e=3D"font-family:courier new,monospace">
<span style=3D"font-family:courier new,monospace">=C2=A0\_/\___/_|\__\__,_\=
__, \___| \__\___/_||_\__|_| \___/_|_\___\__,_|</span><br style=3D"font-fam=
ily:courier new,monospace">
<span style=3D"font-family:courier new,monospace">=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0 |___/</span><br>
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<br style=3D"font-fam=
ily:courier new,monospace">
<br style=3D"font-family:courier new,monospace">
<br style=3D"font-family:courier new,monospace">
</font><br>
</div>
<br>
<br>
</span></div><div><div><div class=3D"gmail_quote"><span class=3D"">On Thu, =
Sep 4, 2014 at 7:18 PM, Chris Byrne <span dir=3D"ltr">
&lt;<a href=3D"mailto:[email protected]" target=3D"_blank">Chris.Byrne@=
barco.com</a>&gt;</span> wrote:<br>
</span><div><div class=3D"h5"><blockquote class=3D"gmail_quote" style=3D"ma=
rgin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir=3D"ltr">I would second that approach.
<div><br>
</div>
<div><br>
</div>
<div>If you really want to go down the path of binding functions with more =
than 10 arguments, then I think you need to define LUABIND_MAX_ARITY with a=
 value greater than 10.</div>
<div><br>
</div>
<div>10 being the default value if LUABIND_MAX_ARITY is not already defined=
:</div>
<div>=C2=A0<a href=3D"https://github.com/luabind/luabind/blob/master/luabin=
d/config.hpp" target=3D"_blank">https://github.com/luabind/luabind/blob/mas=
ter/luabind/config.hpp</a><br>
</div>
<div><br>
</div>
<div>This is used during pre-processing to expand out and provide the neces=
sary binding overloads (predating variadic templates).</div>
<div><br>
</div>
<div><br>
</div>
<div>I haven&#39;t tried this, so I can&#39;t promise that this is the only=
 definition (or even the correct one). There is likely a similar limitation=
/definition within boost as well.</div>
<div><br>
</div>
<div><br>
</div>
<div>Kind Regards,</div>
<div>=C2=A0CB</div>
<div class=3D"gmail_extra"><br>
</div>
<div class=3D"gmail_extra"><br>
<div class=3D"gmail_quote">
<div>On Thu, Sep 4, 2014 at 9:51 AM, Andreas Grob <span dir=3D"ltr">&lt;<a =
href=3D"mailto:[email protected]" target=3D"_blank">Andreas.Grob@=
tu-dortmund.de</a>&gt;</span> wrote:<br>
</div>
<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-=
left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;p=
adding-left:1ex">
<div bgcolor=3D"#FFFFFF">
<div>
<div>Hi,<br>
<br>
How about wrapping the whole L&amp;F class to have a cleaner interface? You=
 could store the original L&amp;F inside that wrapper using pimpl and have =
a method to move it out.<br>
<br>
Regards,<br>
Andreas<br>
<br>
Am 04.09.2014 16:12, schrieb Roman Kubiak:<br>
</div>
</div>
<blockquote type=3D"cite">
<div>
<div>
<div dir=3D"ltr">
<div style=3D"font-family:&#39;courier new&#39;,monospace">Helo.
<div>
<div><br>
<br>
I&#39;m using a third party library for my application (JUCE), this library=
 has a large class called LookAndFeel, i want to expose that class to lua v=
ia luabind.<br>
<br>
I started to do the work following the documentation, and using the luabind=
::wrap_base approach, i got a few methods bound and it&#39;s all working fi=
ne, until i hit a problem. Some of the methods in the original LookAndFeel =
class have more then 10 parameters,
 and i can&#39;t bind those methods using this approach.<br>
<br>
</div>
</div>
</div>
<div>
<div>
<div style=3D"font-family:&#39;courier new&#39;,monospace">One of the solut=
ions i found would be to change the parameters and wrap them in a structure=
, and that would be a good idea but i can&#39;t change the original LookAnd=
Feel class, and changing the class that derives
 from luabind::wrap_base - that i&#39;m implementing - so that it&#39;s met=
hods take a structure as a parameter instead of the actual parameters, make=
s those methods unusable (luabind never calls them, since the parameter cou=
nt and type does not match the original
 LookAndFeel class).<br>
<br>
</div>
<div style=3D"font-family:&#39;courier new&#39;,monospace">Is there a way t=
o solve this somehow, can i increase the limit of 10 parameters in luabind =
(trying to extend the ARITY macro over 10 causes loades of compile errors).=
<br>


<br>
</div>
<div style=3D"font-family:&#39;courier new&#39;,monospace">Any help is welc=
ome.<br>
<br>
</div>
<div style=3D"font-family:&#39;courier new&#39;,monospace">My class looks l=
ike:<br>
class LLookAndFeel : public LookAndFeel_V3, public luabind::wrap_base<br>
{<br>
=C2=A0=C2=A0=C2=A0=C2=A0 virtual void drawButtonBackground (Graphics &amp;g=
, Button &amp;b, const Colour &amp;c, bool over, bool down) override<br>
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 { call&lt;void&gt;=
(&quot;drawButtonBackground&quot;, boost::ref (g), boost::ref(b), c, over, =
down); }<br>
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 static void def_drawButtonBackground =
(LookAndFeel_V3 *ptr, Graphics &amp;g, Button &amp;b, const Colour &amp;c, =
bool over, bool down)<br>
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 { return (ptr-&gt;=
LookAndFeel_V3::drawButtonBackground (g,b,c,over,down)); }<br>
<br>
</div>
<div style=3D"font-family:&#39;courier new&#39;,monospace">/* More methods =
are needed that have more then 10 parameters */<br>
</div>
<div style=3D"font-family:&#39;courier new&#39;,monospace">}<br>
<br>
</div>
<div style=3D"font-family:&#39;courier new&#39;,monospace">Best regards.<br=
>
<br>
Roman Kubiak<br>
<a href=3D"http://ctrlr.org" target=3D"_blank">http://ctrlr.org</a><br clea=
r=3D"all">
</div>
<div><font size=3D"1">=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D<br>
<span style=3D"font-family:&#39;courier new&#39;,monospace">=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 _ _=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 _=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 _ _=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0 _</span><br style=3D"font-family:&#39;courier new&=
#39;,monospace">
<span style=3D"font-family:&#39;courier new&#39;,monospace">__ _____| | |_ =
__ _ __ _ ___=C2=A0=C2=A0 __ ___ _ _| |_ _ _ ___| | |___ __| |</span><br st=
yle=3D"font-family:&#39;courier new&#39;,monospace">
<span style=3D"font-family:&#39;courier new&#39;,monospace">\ V / _ \ |=C2=
=A0 _/ _` / _` / -_) / _/ _ \ &#39; \=C2=A0 _| &#39;_/ _ \ | / -_) _` |</sp=
an><br style=3D"font-family:&#39;courier new&#39;,monospace">
<span style=3D"font-family:&#39;courier new&#39;,monospace">=C2=A0\_/\___/_=
|\__\__,_\__, \___| \__\___/_||_\__|_| \___/_|_\___\__,_|</span><br style=
=3D"font-family:&#39;courier new&#39;,monospace">
<span style=3D"font-family:&#39;courier new&#39;,monospace">=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0 |___/</span><br>
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<br style=3D"font-fam=
ily:&#39;courier new&#39;,monospace">
<br style=3D"font-family:&#39;courier new&#39;,monospace">
<br style=3D"font-family:&#39;courier new&#39;,monospace">
</font><br>
</div>
</div>
</div>
</div>
<br>
<fieldset></fieldset> <br>
</div>
</div>
<div>
<pre>----------------------------------------------------------------------=
--------
Slashdot TV. =20
Video for Nerds.  Stuff that matters.
<a href=3D"http://tv.slashdot.org/" target=3D"_blank">http://tv.slashdot.or=
g/</a></pre>
<br>
<fieldset></fieldset> <br>
<pre>_______________________________________________
luabind-user mailing list
<a href=3D"mailto:[email protected]" target=3D"_blank">lua=
[email protected]</a>
<a href=3D"https://lists.sourceforge.net/lists/listinfo/luabind-user" targe=
t=3D"_blank">https://lists.sourceforge.net/lists/listinfo/luabind-user</a>
</pre>
</div>
</blockquote>
<br>
</div>
</blockquote>
</div>
<br>
</div>
</div>
<br>
---------------------------------------------------------------------------=
---<br>
Slashdot TV.<br>
Video for Nerds.=C2=A0 Stuff that matters.<br>
<a href=3D"http://tv.slashdot.org/" target=3D"_blank">http://tv.slashdot.or=
g/</a><br>
_______________________________________________<br>
luabind-user mailing list<br>
<a href=3D"mailto:[email protected]" target=3D"_blank">lua=
[email protected]</a><br>
<a href=3D"https://lists.sourceforge.net/lists/listinfo/luabind-user" targe=
t=3D"_blank">https://lists.sourceforge.net/lists/listinfo/luabind-user</a><=
br>
<br>
</blockquote>
</div></div></div>
<br>
</div></div></div>

</div>

</blockquote></div><br></div></div>
<br>-----------------------------------------------------------------------=
-------<br>
Slashdot TV.<br>
Video for Nerds.=C2=A0 Stuff that matters.<br>
<a href=3D"http://tv.slashdot.org/" target=3D"_blank">http://tv.slashdot.or=
g/</a><br>_______________________________________________<br>
luabind-user mailing list<br>
<a href=3D"mailto:[email protected]">[email protected]=
urceforge.net</a><br>
<a href=3D"https://lists.sourceforge.net/lists/listinfo/luabind-user" targe=
t=3D"_blank">https://lists.sourceforge.net/lists/listinfo/luabind-user</a><=
br>
<br></blockquote></div><br></div>

--f46d04447e27799aae05024f4032--


--===============5420578174252468356==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
--===============5420578174252468356==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
luabind-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/luabind-user

--===============5420578174252468356==--