]> git.tdb.fi Git - libs/gui.git/blobdiff - source/input/hub.h
Use the override specifier where appropriate
[libs/gui.git] / source / input / hub.h
index 4385f27742e83588e59cf686b88a5dd653d33bdc..1abff37a18cc52cc10b6fa20db170f79a91c3a3b 100644 (file)
@@ -1,13 +1,8 @@
-/* $Id$
-
-This file is part of libmspgbase
-Copyright © 2007 Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
-#ifndef MSP_GBASE_INPUTHUB_H_
-#define MSP_GBASE_INPUTHUB_H_
+#ifndef MSP_INPUT_INPUTHUB_H_
+#define MSP_INPUT_INPUTHUB_H_
 
+#include <vector>
+#include <sigc++/trackable.h>
 #include "device.h"
 
 namespace Msp {
@@ -17,7 +12,7 @@ namespace Input {
 The Hub device collects events from multiple input devices and presents an
 aggregate of them.  Button and axis numbers are mapped to unique values.
 */
-class Hub: public Device
+class Hub: public Device, public sigc::trackable
 {
 protected:
        std::vector<Device *> devices;
@@ -25,16 +20,14 @@ protected:
 public:
        Hub();
 
-       /**
-       Attaches an input device to the hub.
-
-       @param   dev  Device to attach
+       /// Attaches an input device to the hub.
+       void attach(Device &dev);
 
-       @return  Index of the device within the hub
-       */
-       unsigned attach(Device &dev);
+       Device *find_subdevice(DeviceType, unsigned = 0) override;
+       Device *find_subdevice(const std::string &) override;
 
-       virtual std::string get_button_name(unsigned) const;
+       std::string get_button_name(unsigned) const override;
+       std::string get_axis_name(unsigned) const override;
 protected:
        void button_press(unsigned, unsigned);
        void button_release(unsigned, unsigned);