Attempt to make vcl::Timer use boost's Signals2

classic Classic list List threaded Threaded
7 messages Options
Chris Sherlock Chris Sherlock
Reply | Threaded
Open this post in threaded view
|

Attempt to make vcl::Timer use boost's Signals2

Hi all, 

I'm attempting to get Timer to use boost's Signals2. When I compile, however, I get a warning and an error:


The error is:

[ CXX ] vcl/source/window/cursor.cxx
[ CXX ] vcl/source/window/debugevent.cxx
In file included from /home/chris/repos/LibreOffice/core/workdir/UnpackedTarball/boost/boost/function/detail/maybe_include.hpp:13:0,
                 from /home/chris/repos/LibreOffice/core/workdir/UnpackedTarball/boost/boost/function/detail/function_iterate.hpp:14,
                 from /home/chris/repos/LibreOffice/core/workdir/UnpackedTarball/boost/boost/preprocessor/iteration/detail/iter/forward1.hpp:47,
                 from /home/chris/repos/LibreOffice/core/workdir/UnpackedTarball/boost/boost/function.hpp:64,
                 from /home/chris/repos/LibreOffice/core/workdir/UnpackedTarball/boost/boost/signals2/signal.hpp:18,
                 from /home/chris/repos/LibreOffice/core/include/vcl/timer.hxx:23,
                 from /home/chris/repos/LibreOffice/core/include/vcl/animate.hxx:24,
                 from /home/chris/repos/LibreOffice/core/include/vcl/graph.hxx:28,
                 from /home/chris/repos/LibreOffice/core/include/vcl/metaact.hxx:32,
                 from /home/chris/repos/LibreOffice/core/include/vcl/outdev.hxx:35,
                 from /home/chris/repos/LibreOffice/core/include/vcl/metric.hxx:25,
                 from /home/chris/repos/LibreOffice/core/include/vcl/svapp.hxx:41,
                 from /home/chris/repos/LibreOffice/core/vcl/source/window/cursor.cxx:20:
/home/chris/repos/LibreOffice/core/workdir/UnpackedTarball/boost/boost/function/function_template.hpp: In instantiation of ‘void boost::function0<R>::assign_to(Functor) [with Functor = void (vcl::Cursor::*)(); R = void]’:
/home/chris/repos/LibreOffice/core/workdir/UnpackedTarball/boost/boost/function/function_template.hpp:722:7:   required from ‘boost::function0<R>::function0(Functor, typename boost::enable_if_c<boost::type_traits::ice_not<boost::is_integral<Functor>::value>::value, int>::type) [with Functor = void (vcl::Cursor::*)(); R = void; typename boost::enable_if_c<boost::type_traits::ice_not<boost::is_integral<Functor>::value>::value, int>::type = int]’
/home/chris/repos/LibreOffice/core/workdir/UnpackedTarball/boost/boost/function/function_template.hpp:1069:16:   required from ‘boost::function<R()>::function(Functor, typename boost::enable_if_c<boost::type_traits::ice_not<boost::is_integral<Functor>::value>::value, int>::type) [with Functor = void (vcl::Cursor::*)(); R = void; typename boost::enable_if_c<boost::type_traits::ice_not<boost::is_integral<Functor>::value>::value, int>::type = int]’
/home/chris/repos/LibreOffice/core/workdir/UnpackedTarball/boost/boost/function/function_template.hpp:1124:5:   required from ‘typename boost::enable_if_c<boost::type_traits::ice_not<boost::is_integral<Functor>::value>::value, boost::function<R()>&>::type boost::function<R()>::operator=(Functor) [with Functor = void (vcl::Cursor::*)(); R = void; typename boost::enable_if_c<boost::type_traits::ice_not<boost::is_integral<Functor>::value>::value, boost::function<R()>&>::type = boost::function<void()>&]’
/home/chris/repos/LibreOffice/core/workdir/UnpackedTarball/boost/boost/signals2/detail/slot_template.hpp:156:24:   required from ‘void boost::signals2::slot<R(Args ...), SlotFunction>::init_slot_function(const F&) [with F = void (vcl::Cursor::*)(); SlotFunction = boost::function<void()>; R = void; Args = {}]’
/home/chris/repos/LibreOffice/core/workdir/UnpackedTarball/boost/boost/signals2/detail/slot_template.hpp:81:29:   required from ‘boost::signals2::slot<R(Args ...), SlotFunction>::slot(const F&) [with F = void (vcl::Cursor::*)(); SlotFunction = boost::function<void()>; R = void; Args = {}]’
/home/chris/repos/LibreOffice/core/vcl/source/window/cursor.cxx:174:83:   required from here
/home/chris/repos/LibreOffice/core/workdir/UnpackedTarball/boost/boost/function/function_template.hpp:924:9: error: no class template named ‘apply’ in ‘struct boost::detail::function::get_invoker0<boost::detail::function::member_ptr_tag>’
         handler_type;
         ^
make[1]: *** [/home/chris/repos/LibreOffice/core/workdir/CxxObject/vcl/source/window/cursor.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [vcl.all] Error 2

Does anyone with any knowledge know where I might be going wrong?

You can review the patch at https://gerrit.libreoffice.org/#/c/12950/

Thanks,
Chris

_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Kohei Yoshida-7 Kohei Yoshida-7
Reply | Threaded
Open this post in threaded view
|

Re: Attempt to make vcl::Timer use boost's Signals2

On Tue, 2014-11-18 at 23:50 +1100, Chris Sherlock wrote:
> Hi all,
>
>
> I'm attempting to get Timer to use boost's Signals2.

When you do that, could you apply "pimpl" pattern to hide its boost
usages from the header?  Timer is used in a lot of call sites, and
adding yet another boost template to such a public header would further
degrade build time and potentially increase the size of the binary.

I've started working on applying pimpl patterns to those public headers
which have recently been converted to use boost, STL etc (these are
quite many in vcl now).  Not adding new ones would be greatly
appreciated.

Thanks!



_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Kohei Yoshida-7 Kohei Yoshida-7
Reply | Threaded
Open this post in threaded view
|

Re: Attempt to make vcl::Timer use boost's Signals2

On Tue, 2014-11-18 at 08:20 -0500, Kohei Yoshida wrote:
> On Tue, 2014-11-18 at 23:50 +1100, Chris Sherlock wrote:
> > Hi all,
> >
> >
> > I'm attempting to get Timer to use boost's Signals2.
>
> When you do that, could you apply "pimpl" pattern to hide its boost
> usages from the header?

If that's easily doable that is.  If not, you can just leave it and I'll
poke at that at some stage...  Either way is fine with me.

Kohei

_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Chris Sherlock Chris Sherlock
Reply | Threaded
Open this post in threaded view
|

Re: Attempt to make vcl::Timer use boost's Signals2

I'll see what I can do :-)

Any ideas about the errors?

Chris

Sent from my iPhone

> On 19 Nov 2014, at 12:51 am, Kohei Yoshida <[hidden email]> wrote:
>
>> On Tue, 2014-11-18 at 08:20 -0500, Kohei Yoshida wrote:
>>> On Tue, 2014-11-18 at 23:50 +1100, Chris Sherlock wrote:
>>> Hi all,
>>>
>>>
>>> I'm attempting to get Timer to use boost's Signals2.
>>
>> When you do that, could you apply "pimpl" pattern to hide its boost
>> usages from the header?
>
> If that's easily doable that is.  If not, you can just leave it and I'll
> poke at that at some stage...  Either way is fine with me.
>
> Kohei
>
_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Kohei Yoshida-7 Kohei Yoshida-7
Reply | Threaded
Open this post in threaded view
|

Re: Attempt to make vcl::Timer use boost's Signals2

On Wed, 2014-11-19 at 07:09 +1100, Chris Sherlock wrote:
> I'll see what I can do :-)
>
> Any ideas about the errors?

Not really, but I'd look at

"/home/chris/repos/LibreOffice/core/vcl/source/window/paint.cxx:324:63:
required from here"

that line and see anything looks funny on that line.  When deciphering a
huge avalanche of template errors like that, normally the key is toward
the end of it where it points to some file within our source tree, and
you can make your best guess on what you are doing wrong...

Alternatively, if you know how to set it up, compiling it using clang
which generates much more human readable template error outputs.  This
can come in handy.

Kohei

_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Luboš Luňák Luboš Luňák
Reply | Threaded
Open this post in threaded view
|

Re: Attempt to make vcl::Timer use boost's Signals2

In reply to this post by Chris Sherlock
On Tuesday 18 of November 2014, Chris Sherlock wrote:
> Hi all,
>
> I'm attempting to get Timer to use boost's Signals2. When I compile,
> however, I get a warning and an error:

 I should finally find the time to write down the howto for this I guess.

 You cannot just use a pointer to a member function, because that one requires
also the this pointer, so you need to go with boost::bind. See e.g. 96369e97.

--
 Lubos Lunak
 [hidden email]
_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Luboš Luňák Luboš Luňák
Reply | Threaded
Open this post in threaded view
|

Re: Attempt to make vcl::Timer use boost's Signals2

In reply to this post by Kohei Yoshida-7
On Tuesday 18 of November 2014, Kohei Yoshida wrote:
> On Tue, 2014-11-18 at 23:50 +1100, Chris Sherlock wrote:
> > Hi all,
> >
> >
> > I'm attempting to get Timer to use boost's Signals2.
>
> When you do that, could you apply "pimpl" pattern to hide its boost
> usages from the header?

 He can't. Signals usually form part of the public API of a class.

--
 Lubos Lunak
 [hidden email]
_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice