]> git.stg.codes - stg.git/blobdiff - include/stg/notifer.h
Simplify notifiers.
[stg.git] / include / stg / notifer.h
index 6f2133282d355ea081e783a4a19d1f2e184e2921..339b6170e1ae78514bf17dc206a60567dff7252b 100644 (file)
@@ -1,29 +1,17 @@
- /*
- $Revision: 1.6 $
- $Date: 2007/12/03 09:00:17 $
- $Author: nobunaga $
- */
+#pragma once
 
-#ifndef PROPERTY_NOTIFER_H
-#define PROPERTY_NOTIFER_H
-
-//-----------------------------------------------------------------------------
-template <typename varParamType>
-class PROPERTY_NOTIFIER_BASE
+namespace STG
 {
-public:
-    virtual      ~PROPERTY_NOTIFIER_BASE(){}
-    virtual void Notify(const varParamType & oldValue, const varParamType & newValue) = 0;
-};
-//-----------------------------------------------------------------------------
-template <typename varParamType>
-class NOTIFIER_BASE
+
+template <typename... Ts>
+struct NotifierBase
 {
-public:
-    virtual      ~NOTIFIER_BASE(){}
-    virtual void Notify(const varParamType & value) = 0;
+    virtual ~NotifierBase() = default;
+
+    virtual void notify(const Ts&... values) = 0;
 };
-//-----------------------------------------------------------------------------
-#endif //PROPERTY_NOTIFER_H
 
+template <typename T>
+using PropertyNotifierBase = NotifierBase<T, T>;
 
+}