wayland: delete copy ctors and operators
authorMarcus Fritzsch <marcus_fritzsch@mentor.com>
Wed, 28 Jun 2017 14:33:16 +0000 (16:33 +0200)
committerMarcus Fritzsch <marcus_fritzsch@mentor.com>
Tue, 8 Aug 2017 15:24:00 +0000 (17:24 +0200)
Signed-off-by: Marcus Fritzsch <marcus_fritzsch@mentor.com>
src/wayland.hpp

index 2321fff..3516f5e 100644 (file)
@@ -19,6 +19,8 @@
 template <typename ProxyT>
 struct wayland_proxy {
    std::unique_ptr<ProxyT, std::function<void(ProxyT *)>> proxy;
+   wayland_proxy(wayland_proxy const &) = delete;
+   wayland_proxy &operator=(wayland_proxy const &) = delete;
    wayland_proxy(void *p)
       : wayland_proxy(p, [](ProxyT *p) {
            wl_proxy_destroy(reinterpret_cast<struct wl_proxy *>(p));
@@ -45,6 +47,8 @@ struct registry : public wayland_proxy<struct wl_registry> {
    typedef std::function<void(struct wl_registry *, uint32_t, uint32_t)> binder;
    std::unordered_map<std::string, binder> bindings;
 
+   registry(registry const &) = delete;
+   registry &operator=(registry const &) = delete;
    registry(struct wl_display *d);
 
    void add_global_handler(char const *iface, binder bind);
@@ -64,6 +68,8 @@ struct display {
    std::unique_ptr<struct wl_display, void (*)(struct wl_display *)> d;
    struct registry r;
 
+   display(display const &) = delete;
+   display &operator=(display const &) = delete;
    display();
    bool ok() const;
    void roundtrip();
@@ -83,6 +89,8 @@ struct output : wayland_proxy<struct wl_output> {
    int height{};
    int refresh{};
 
+   output(output const &) = delete;
+   output &operator=(output const &) = delete;
    output(struct wl_registry *r, uint32_t name, uint32_t v);
 
    // Events
@@ -122,6 +130,8 @@ struct controller_child {
    struct controller *parent;
    uint32_t id;
 
+   controller_child(controller_child const &) = delete;
+   controller_child &operator=(controller_child const &) = delete;
    controller_child(struct controller *c, uint32_t i) : parent(c), id(i) {}
    virtual ~controller_child() {}
 };
@@ -141,6 +151,8 @@ struct surface : public wayland_proxy<struct ivi_controller_surface>,
    int32_t visibility;
    float opacity;
 
+   surface(surface const &) = delete;
+   surface &operator=(surface const &) = delete;
    surface(uint32_t i, struct controller *c);
 
    // Requests
@@ -172,6 +184,8 @@ struct layer : public wayland_proxy<struct ivi_controller_layer>,
    int32_t visibility;
    float opacity;
 
+   layer(layer const &) = delete;
+   layer &operator=(layer const &) = delete;
    layer(uint32_t i, struct controller *c);
    layer(uint32_t i, int32_t w, int32_t h, struct controller *c);
 
@@ -199,6 +213,8 @@ struct layer : public wayland_proxy<struct ivi_controller_layer>,
 //
 struct screen : public wayland_proxy<struct ivi_controller_screen>,
                 controller_child {
+   screen(screen const &) = delete;
+   screen &operator=(screen const &) = delete;
    screen(uint32_t i, struct controller *c, struct ivi_controller_screen *p);
    void clear();
    void add_layer(layer *l);