// actionsList.InvokeAll();
#include <pthread.h>
-#include <list>
+#include <vector>
#include <functional>
// Generalized actor type - a method of some class with one argument
class BASE_ACTION
{
public:
- virtual ~BASE_ACTION() {};
+ virtual ~BASE_ACTION() {}
virtual void Invoke() = 0;
};
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;
// 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();