X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/b28df10f14f16593d75ae05fe82a99ace636b16e..d12e0d85ae649d5c903a61c1150f4e6c48f96309:/projects/stargazer/actions.inl.h?ds=sidebyside diff --git a/projects/stargazer/actions.inl.h b/projects/stargazer/actions.inl.h index 37c7e86e..392626ab 100644 --- a/projects/stargazer/actions.inl.h +++ b/projects/stargazer/actions.inl.h @@ -3,7 +3,7 @@ #include -#include "stg_locker.h" +#include "stg/locker.h" // Polymorphick action invocation template @@ -18,7 +18,7 @@ ACTIONS_LIST::ACTIONS_LIST() : mutex() { pthread_mutex_init(&mutex, NULL); -}; +} // Delete all actions before deleting list inline @@ -26,66 +26,66 @@ ACTIONS_LIST::~ACTIONS_LIST() { { - STG_LOCKER lock(&mutex, __FILE__, __LINE__); + STG_LOCKER lock(&mutex); parent::iterator it(parent::begin()); - while (it != parent::end()) + while (it != parent::end()) { delete *it++; } } pthread_mutex_destroy(&mutex); -}; +} inline ACTIONS_LIST::parent::iterator ACTIONS_LIST::begin() -{ -STG_LOCKER lock(&mutex, __FILE__, __LINE__); +{ +STG_LOCKER lock(&mutex); return parent::begin(); -}; +} inline ACTIONS_LIST::parent::iterator ACTIONS_LIST::end() -{ -STG_LOCKER lock(&mutex, __FILE__, __LINE__); +{ +STG_LOCKER lock(&mutex); return parent::end(); -}; +} inline ACTIONS_LIST::parent::const_iterator ACTIONS_LIST::begin() const -{ -STG_LOCKER lock(&mutex, __FILE__, __LINE__); +{ +STG_LOCKER lock(&mutex); return parent::begin(); -}; +} inline ACTIONS_LIST::parent::const_iterator ACTIONS_LIST::end() const -{ -STG_LOCKER lock(&mutex, __FILE__, __LINE__); +{ +STG_LOCKER lock(&mutex); return parent::end(); -}; +} inline bool ACTIONS_LIST::empty() const { -STG_LOCKER lock(&mutex, __FILE__, __LINE__); +STG_LOCKER lock(&mutex); return parent::empty(); -}; +} inline size_t ACTIONS_LIST::size() const { -STG_LOCKER lock(&mutex, __FILE__, __LINE__); +STG_LOCKER lock(&mutex); return parent::size(); -}; +} inline void ACTIONS_LIST::swap(ACTIONS_LIST & list) { -STG_LOCKER lock(&mutex, __FILE__, __LINE__); +STG_LOCKER lock(&mutex); parent::swap(list); -}; +} template inline @@ -93,19 +93,19 @@ void ACTIONS_LIST::Enqueue(ACTIVE_CLASS & ac, typename ACTOR::TYPE a, DATA_TYPE d) { -STG_LOCKER lock(&mutex, __FILE__, __LINE__); +STG_LOCKER lock(&mutex); push_back(new ACTION(ac, a, d)); } inline void ACTIONS_LIST::InvokeAll() { -STG_LOCKER lock(&mutex, __FILE__, __LINE__); +STG_LOCKER lock(&mutex); std::for_each( parent::begin(), parent::end(), std::mem_fun(&BASE_ACTION::Invoke) ); -}; +} #endif