Re: [luabind] Deriving in lua, more then 10 parameters for a method
Brought to you by:
arvidn,
daniel_wallin
From: Roman K. <kub...@gm...> - 2014-09-04 19:41:47
|
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 <Chr...@ba...> 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 <And...@tu...> > 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 lis...@li...https://lists.sourceforge.net/lists/listinfo/luabind-user >> >> >> > > > ------------------------------------------------------------------------------ > Slashdot TV. > Video for Nerds. Stuff that matters. > http://tv.slashdot.org/ > _______________________________________________ > luabind-user mailing list > lua...@li... > https://lists.sourceforge.net/lists/listinfo/luabind-user > > |