X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/641204dfbdb9fc870cdd2e7f9e3169a44693e7bf..0907aa4037b12b6b88ee24495d4577a064d4f8db:/projects/stargazer/actions.h diff --git a/projects/stargazer/actions.h b/projects/stargazer/actions.h index 53dde92b..eea72b77 100644 --- a/projects/stargazer/actions.h +++ b/projects/stargazer/actions.h @@ -14,7 +14,7 @@ // actionsList.InvokeAll(); #include -#include +#include #include // 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::TYPE a, DATA_TYPE d) - : activeClass(ac), actor(a), data(d) {}; + : activeClass(ac), actor(a), data(d) {} void Invoke(); private: + ACTION(const ACTION & rvalue); + ACTION & operator=(const ACTION & rvalue); + ACTIVE_CLASS & activeClass; typename ACTOR::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 +class ACTIONS_LIST : private std::vector { public: // Just a typedef for parent class - typedef std::list parent; + typedef std::vector parent; // Initialize mutex ACTIONS_LIST(); // Delete actions and destroy mutex - ~ACTIONS_LIST(); + virtual ~ACTIONS_LIST(); parent::iterator begin(); parent::iterator end();