]> git.stg.codes - stg.git/blobdiff - projects/stargazer/actions.h
Move projects back into subfolder.
[stg.git] / projects / stargazer / actions.h
index 53dde92b749aa04c08d2fd56b95c3a1471a9d1c8..eea72b77aa7357b456b955c35f1b3d33aa18a62f 100644 (file)
@@ -14,7 +14,7 @@
 // actionsList.InvokeAll();
 
 #include <pthread.h>
-#include <list>
+#include <vector>
 #include <functional>
 
 // Generalized actor type - a method of some class with one argument
@@ -28,7 +28,7 @@ typedef void (ACTIVE_CLASS::*TYPE)(DATA_TYPE);
 class BASE_ACTION
 {
 public:
-    virtual ~BASE_ACTION() {};
+    virtual ~BASE_ACTION() {}
     virtual void Invoke() = 0;
 };
 
@@ -41,9 +41,12 @@ public:
     ACTION(ACTIVE_CLASS & ac,
            typename ACTOR<ACTIVE_CLASS, DATA_TYPE>::TYPE a,
            DATA_TYPE d)
-        : activeClass(ac), actor(a), data(d) {};
+        : activeClass(ac), actor(a), data(d) {}
     void Invoke();
 private:
+    ACTION(const ACTION<ACTIVE_CLASS, DATA_TYPE> & rvalue);
+    ACTION<ACTIVE_CLASS, DATA_TYPE> & operator=(const ACTION<ACTIVE_CLASS, DATA_TYPE> & rvalue);
+
     ACTIVE_CLASS & activeClass;
     typename ACTOR<ACTIVE_CLASS, DATA_TYPE>::TYPE actor;
     DATA_TYPE data;
@@ -51,16 +54,16 @@ private:
 
 // A list of an actions
 // All methods are thread-safe
-class ACTIONS_LIST : private std::list<BASE_ACTION *>
+class ACTIONS_LIST : private std::vector<BASE_ACTION *>
 {
 public:
     // Just a typedef for parent class
-    typedef std::list<BASE_ACTION *> parent;
+    typedef std::vector<BASE_ACTION *> parent;
 
     // Initialize mutex
     ACTIONS_LIST();
     // Delete actions and destroy mutex
-    ~ACTIONS_LIST();
+    virtual ~ACTIONS_LIST();
 
     parent::iterator begin();
     parent::iterator end();