Michele Caini пре 8 година
родитељ
комит
2e6c8d542c

+ 2 - 32
src/entt/signal/bus.hpp

@@ -46,21 +46,6 @@ public:
     /*! @brief Unsigned integer type. */
     /*! @brief Unsigned integer type. */
     using size_type = std::size_t;
     using size_type = std::size_t;
 
 
-    /*! @brief Default constructor, explicit on purpose. */
-    explicit Bus() noexcept = default;
-    /*! @brief Default destructor. */
-    ~Bus() noexcept = default;
-
-    /*! @brief Default copy constructor. */
-    Bus(const Bus &) = default;
-    /*! @brief Default move constructor. */
-    Bus(Bus &&) = default;
-
-    /*! @brief Default copy assignment operator. @return This bus. */
-    Bus & operator=(const Bus &) = default;
-    /*! @brief Default move assignment operator. @return This bus. */
-    Bus & operator=(Bus &&) = default;
-
     /**
     /**
      * @brief Unregisters all the member functions of an instance.
      * @brief Unregisters all the member functions of an instance.
      *
      *
@@ -117,7 +102,7 @@ public:
     }
     }
 
 
     /**
     /**
-     * @brief Returns false is at least a listener is connected to the bus.
+     * @brief Returns false if at least a listener is connected to the bus.
      * @return True if the bus has no listeners connected, false otherwise.
      * @return True if the bus has no listeners connected, false otherwise.
      */
      */
     bool empty() const noexcept {
     bool empty() const noexcept {
@@ -203,21 +188,6 @@ public:
     /*! @brief Unsigned integer type. */
     /*! @brief Unsigned integer type. */
     using size_type = typename signal_type::size_type;
     using size_type = typename signal_type::size_type;
 
 
-    /*! @brief Default constructor, explicit on purpose. */
-    explicit Bus() noexcept = default;
-    /*! @brief Default destructor. */
-    virtual ~Bus() noexcept = default;
-
-    /*! @brief Default copy constructor. */
-    Bus(const Bus &) = default;
-    /*! @brief Default move constructor. */
-    Bus(Bus &&) = default;
-
-    /*! @brief Default copy assignment operator. @return This bus. */
-    Bus & operator=(const Bus &) = default;
-    /*! @brief Default move assignment operator. @return This bus. */
-    Bus & operator=(Bus &&) = default;
-
     /**
     /**
      * @brief Unregisters member functions of instances.
      * @brief Unregisters member functions of instances.
      *
      *
@@ -259,7 +229,7 @@ public:
     }
     }
 
 
     /**
     /**
-     * @brief Returns false is at least a listener is connected to the bus.
+     * @brief Returns false if at least a listener is connected to the bus.
      * @return True if the bus has no listeners connected, false otherwise.
      * @return True if the bus has no listeners connected, false otherwise.
      */
      */
     bool empty() const noexcept {
     bool empty() const noexcept {

+ 3 - 3
src/entt/signal/delegate.hpp

@@ -19,7 +19,7 @@ class Delegate;
 
 
 
 
 /**
 /**
- * @brief A delegate class to send around functions and member functions.
+ * @brief Utility class to send around functions and member functions.
  *
  *
  * Unmanaged delegate for function pointers and member functions. Users of this
  * Unmanaged delegate for function pointers and member functions. Users of this
  * class are in charge of disconnecting instances before deleting them.
  * class are in charge of disconnecting instances before deleting them.
@@ -49,8 +49,8 @@ class Delegate<Ret(Args...)> final {
     }
     }
 
 
 public:
 public:
-    /*! @brief Default constructor, explicit on purpose. */
-    explicit Delegate() noexcept
+    /*! @brief Default constructor. */
+    Delegate() noexcept
         : stub{std::make_pair(nullptr, &fallback)}
         : stub{std::make_pair(nullptr, &fallback)}
     {}
     {}
 
 

+ 2 - 15
src/entt/signal/dispatcher.hpp

@@ -93,24 +93,11 @@ class Dispatcher final {
     }
     }
 
 
 public:
 public:
-    /*! @brief Default constructor, explicit on purpose. */
-    explicit Dispatcher() noexcept
+    /*! @brief Default constructor. */
+    Dispatcher() noexcept
         : wrappers{}, mode{false}
         : wrappers{}, mode{false}
     {}
     {}
 
 
-    /*! @brief Default destructor. */
-    ~Dispatcher() = default;
-
-    /*! @brief Default copy constructor. */
-    Dispatcher(const Dispatcher &) = default;
-    /*! @brief Default move constructor. */
-    Dispatcher(Dispatcher &&) = default;
-
-    /*! @brief Default copy assignment operator. @return This dispatcher. */
-    Dispatcher & operator=(const Dispatcher &) = default;
-    /*! @brief Default move assignment operator. @return This dispatcher. */
-    Dispatcher & operator=(Dispatcher &&) = default;
-
     /**
     /**
      * @brief Registers a listener given in the form of a member function.
      * @brief Registers a listener given in the form of a member function.
      *
      *

+ 14 - 17
src/entt/signal/emitter.hpp

@@ -156,16 +156,8 @@ public:
         /** @brief Event emitters are friend classes of connections. */
         /** @brief Event emitters are friend classes of connections. */
         friend class Emitter;
         friend class Emitter;
 
 
-        /*! @brief Default constructor, explicit on purpose. */
-        explicit Connection() = default;
-
-        /*! @brief Default copy constructor. */
-        Connection(const Connection &) = default;
-        /*! @brief Default move constructor. */
-        Connection(Connection &&) = default;
-
-        /*! @brief Default destructor. */
-        ~Connection() = default;
+        /*! @brief Default constructor. */
+        Connection() noexcept = default;
 
 
         /**
         /**
          * @brief Creates a connection that wraps its underlying instance.
          * @brief Creates a connection that wraps its underlying instance.
@@ -175,6 +167,11 @@ public:
             : Handler<Event>::connection_type{std::move(conn)}
             : Handler<Event>::connection_type{std::move(conn)}
         {}
         {}
 
 
+        /*! @brief Default copy constructor. */
+        Connection(const Connection &) = default;
+        /*! @brief Default move constructor. */
+        Connection(Connection &&) = default;
+
         /**
         /**
          * @brief Default copy assignament operator.
          * @brief Default copy assignament operator.
          * @return This connection.
          * @return This connection.
@@ -188,19 +185,19 @@ public:
         Connection & operator=(Connection &&) = default;
         Connection & operator=(Connection &&) = default;
     };
     };
 
 
-    /*! @brief Default constructor, explicit on purpose. */
-    explicit Emitter() noexcept = default;
-
-    /*! @brief Copying an emitter isn't allowed. */
-    Emitter(const Emitter &) = delete;
-    /*! @brief Default move constructor. */
-    Emitter(Emitter &&) = default;
+    /*! @brief Default constructor. */
+    Emitter() noexcept = default;
 
 
     /*! @brief Default destructor. */
     /*! @brief Default destructor. */
     virtual ~Emitter() noexcept {
     virtual ~Emitter() noexcept {
         static_assert(std::is_base_of<Emitter<Derived>, Derived>::value, "!");
         static_assert(std::is_base_of<Emitter<Derived>, Derived>::value, "!");
     }
     }
 
 
+    /*! @brief Copying an emitter isn't allowed. */
+    Emitter(const Emitter &) = delete;
+    /*! @brief Default move constructor. */
+    Emitter(Emitter &&) = default;
+
     /*! @brief Copying an emitter isn't allowed. @return This emitter. */
     /*! @brief Copying an emitter isn't allowed. @return This emitter. */
     Emitter & operator=(const Emitter &) = delete;
     Emitter & operator=(const Emitter &) = delete;
     /*! @brief Default move assignament operator. @return This emitter. */
     /*! @brief Default move assignament operator. @return This emitter. */

+ 3 - 46
src/entt/signal/sigh.hpp

@@ -91,11 +91,13 @@ class SigH;
  * of this class are in charge of disconnecting instances before deleting them.
  * of this class are in charge of disconnecting instances before deleting them.
  *
  *
  * This class serves mainly two purposes:
  * This class serves mainly two purposes:
+ *
  * * Creating signals used later to notify a bunch of listeners.
  * * Creating signals used later to notify a bunch of listeners.
  * * Collecting results from a set of functions like in a voting system.
  * * Collecting results from a set of functions like in a voting system.
  *
  *
  * The default collector does nothing. To properly collect data, define and use
  * The default collector does nothing. To properly collect data, define and use
  * a class that has a call operator the signature of which is `bool(Param)` and:
  * a class that has a call operator the signature of which is `bool(Param)` and:
+ *
  * * `Param` is a type to which `Ret` can be converted.
  * * `Param` is a type to which `Ret` can be converted.
  * * The return type is true if the handler must stop collecting data, false
  * * The return type is true if the handler must stop collecting data, false
  *   otherwise.
  *   otherwise.
@@ -131,51 +133,6 @@ public:
     template<typename Class>
     template<typename Class>
     using instance_type = Class *;
     using instance_type = Class *;
 
 
-    /*! @brief Default constructor, explicit on purpose. */
-    explicit SigH() noexcept = default;
-
-    /*! @brief Default destructor. */
-    ~SigH() noexcept = default;
-
-    /**
-     * @brief Copy constructor, listeners are also connected to this signal.
-     * @param other A signal to use as source to initialize this instance.
-     */
-    SigH(const SigH &other)
-        : calls{other.calls}
-    {}
-
-    /**
-     * @brief Default move constructor.
-     * @param other A signal to use as source to initialize this instance.
-     */
-    SigH(SigH &&other): SigH{} {
-        swap(*this, other);
-    }
-
-    /**
-     * @brief Copy assignment operator.
-     *
-     * Listeners are also connected to this signal.
-     *
-     * @param other A signal to use as source to initialize this instance.
-     * @return This signal.
-     */
-    SigH & operator=(const SigH &other) {
-        calls = other.calls;
-        return *this;
-    }
-
-    /**
-     * @brief Move assignment operator.
-     * @param other A signal to use as source to initialize this instance.
-     * @return This signal.
-     */
-    SigH & operator=(SigH &&other) {
-        swap(*this, other);
-        return *this;
-    }
-
     /**
     /**
      * @brief Number of listeners connected to the signal.
      * @brief Number of listeners connected to the signal.
      * @return Number of listeners currently connected.
      * @return Number of listeners currently connected.
@@ -185,7 +142,7 @@ public:
     }
     }
 
 
     /**
     /**
-     * @brief Returns false is at least a listener is connected to the signal.
+     * @brief Returns false if at least a listener is connected to the signal.
      * @return True if the signal has no listeners connected, false otherwise.
      * @return True if the signal has no listeners connected, false otherwise.
      */
      */
     bool empty() const noexcept {
     bool empty() const noexcept {

+ 1 - 46
src/entt/signal/signal.hpp

@@ -70,51 +70,6 @@ public:
     template<typename Class>
     template<typename Class>
     using instance_type = std::shared_ptr<Class>;
     using instance_type = std::shared_ptr<Class>;
 
 
-    /*! @brief Default constructor, explicit on purpose. */
-    explicit Signal() noexcept = default;
-
-    /*! @brief Default destructor. */
-    ~Signal() noexcept = default;
-
-    /**
-     * @brief Copy constructor, listeners are also connected to this signal.
-     * @param other A signal to use as source to initialize this instance.
-     */
-    Signal(const Signal &other)
-        : calls{other.calls}
-    {}
-
-    /**
-     * @brief Default move constructor.
-     * @param other A signal to use as source to initialize this instance.
-     */
-    Signal(Signal &&other): Signal{} {
-        swap(*this, other);
-    }
-
-    /**
-     * @brief Copy assignment operator.
-     *
-     * Listeners are also connected to this signal.
-     *
-     * @param other A signal to use as source to initialize this instance.
-     * @return This signal.
-     */
-    Signal & operator=(const Signal &other) {
-        calls = other.calls;
-        return *this;
-    }
-
-    /**
-     * @brief Move assignment operator.
-     * @param other A signal to use as source to initialize this instance.
-     * @return This signal.
-     */
-    Signal & operator=(Signal &&other) {
-        swap(*this, other);
-        return *this;
-    }
-
     /**
     /**
      * @brief Number of listeners connected to the signal.
      * @brief Number of listeners connected to the signal.
      * @return Number of listeners currently connected.
      * @return Number of listeners currently connected.
@@ -124,7 +79,7 @@ public:
     }
     }
 
 
     /**
     /**
-     * @brief Returns false is at least a listener is connected to the signal.
+     * @brief Returns false if at least a listener is connected to the signal.
      * @return True if the signal has no listeners connected, false otherwise.
      * @return True if the signal has no listeners connected, false otherwise.
      */
      */
     bool empty() const noexcept {
     bool empty() const noexcept {