winft / wrapland

Qt/C++ library wrapping libwayland
GNU Lesser General Public License v2.1
6 stars 2 forks source link

Add resource factory to Wayland::Resource #53

Open romangg opened 4 years ago

romangg commented 4 years ago

It should be possible to add a template factory method to Wayland::Resource such that the version is queried automatically from the parent resource/bind.

That could also nicely catch errors on resource creation and in that case just hand back a nullptr.

romangg commented 4 years ago

One issue is that we would need to make Wayland::Resource friend of every class being created because the ctors are private.

I think we should wait with solving this issue until we have a plan for further layering of the server library. Then the ctors would be likely all public (implementation classes in a detail namespace).