cumbia 1.x
general purpose multi threaded library
|
This service stores the links between threads, activities and thread listeners. More...
#include <cuactivitymanager.h>
Public Member Functions | |
CuActivityManager () | |
The Cumbia Activity Manager keeps the links between threads, activities and thread listeners. CuActivityManager deals with adding, removing and finding objects connected with each other. More... | |
virtual | ~CuActivityManager () |
void | connect (CuThreadInterface *t, CuActivity *a, CuThreadListener *threadListener) |
void | disconnect (CuActivity *a) |
Removes all links where a is involved. More... | |
void | removeConnections (CuThreadInterface *t) |
Removes all links involving the CuThreadInterface passed as input. More... | |
void | disconnect (CuThreadListener *l) |
CuActivity * | find (const CuData &token) |
finds an activity matching the given token More... | |
CuThreadInterface * | getThread (CuActivity *activity) |
returns the CuThreadInterface that executes the given activity More... | |
bool | isRegistered (const CuActivity *a) |
std::vector< CuActivity * > | activitiesForThread (const CuThreadInterface *ti) |
int | countActivitiesForThread (const CuThreadInterface *ti) |
std::vector< CuThreadListener * > | getThreadListeners (const CuActivity *activity) |
bool | connectionExists (CuThreadInterface *t, CuActivity *a, CuThreadListener *threadListener) |
std::string | getName () const |
return the name of the service More... | |
CuServices::Type | getType () const |
return the type of the service More... | |
Public Member Functions inherited from CuServiceI | |
virtual | ~CuServiceI () |
virtual std::string | getName () const =0 |
return the name of the service More... | |
virtual CuServices::Type | getType () const =0 |
return the type of the service More... | |
This service stores the links between threads, activities and thread listeners.
CuActivityManager::CuActivityManager | ( | ) |
The Cumbia Activity Manager keeps the links between threads, activities and thread listeners. CuActivityManager deals with adding, removing and finding objects connected with each other.
References CuActivityManagerPrivate::mythread.
|
virtual |
References CuActivityManagerPrivate::mythread, and pdelete.
std::vector< CuActivity * > CuActivityManager::activitiesForThread | ( | const CuThreadInterface * | ti | ) |
References CuActivityManagerPrivate::conn_mumap, and CuActivityManagerPrivate::mythread.
Referenced by Cumbia::finish().
void CuActivityManager::connect | ( | CuThreadInterface * | t, |
CuActivity * | a, | ||
CuThreadListener * | threadListener | ||
) |
References CuActivityManagerPrivate::conn_mumap, CuActivityManagerPrivate::mythread, and CuActivityManagerPrivate::th_lis_mumap.
Referenced by Cumbia::registerActivity().
bool CuActivityManager::connectionExists | ( | CuThreadInterface * | t, |
CuActivity * | a, | ||
CuThreadListener * | threadListener | ||
) |
int CuActivityManager::countActivitiesForThread | ( | const CuThreadInterface * | ti | ) |
References CuActivityManagerPrivate::conn_mumap, and CuActivityManagerPrivate::mythread.
Referenced by Cumbia::unregisterActivity().
void CuActivityManager::disconnect | ( | CuActivity * | a | ) |
Removes all links where a is involved.
a | the activity to be removed together with the thread and thread listner(s) it's linked with |
This unbinds threads from activities and thread listeners (CuThreadListener) from activities (CuActivity).
See CuActivityManager::removeConnection
References CuActivityManagerPrivate::conn_mumap, CuActivityManagerPrivate::mythread, and CuActivityManagerPrivate::th_lis_mumap.
Referenced by Cumbia::finish(), and Cumbia::unregisterActivity().
void CuActivityManager::disconnect | ( | CuThreadListener * | l | ) |
References CuActivityManagerPrivate::mythread, and CuActivityManagerPrivate::th_lis_mumap.
CuActivity * CuActivityManager::find | ( | const CuData & | token | ) |
finds an activity matching the given token
References CuActivityManagerPrivate::conn_mumap, and CuActivityManagerPrivate::mythread.
Referenced by Cumbia::findActivity().
|
virtual |
return the name of the service
Implements CuServiceI.
CuThreadInterface * CuActivityManager::getThread | ( | CuActivity * | activity | ) |
returns the CuThreadInterface that executes the given activity
activity | a pointer to the CuActivity you want to get the thread it is run in |
References CuActivityManagerPrivate::conn_mumap, and CuActivityManagerPrivate::mythread.
Referenced by Cumbia::pauseActivity(), Cumbia::postEvent(), Cumbia::resumeActivity(), Cumbia::setActivityPeriod(), and Cumbia::unregisterActivity().
std::vector< CuThreadListener * > CuActivityManager::getThreadListeners | ( | const CuActivity * | activity | ) |
References CuActivityManagerPrivate::mythread, and CuActivityManagerPrivate::th_lis_mumap.
|
virtual |
return the type of the service
Implements CuServiceI.
References CuServices::ActivityManager.
bool CuActivityManager::isRegistered | ( | const CuActivity * | a | ) |
void CuActivityManager::removeConnections | ( | CuThreadInterface * | t | ) |
Removes all links involving the CuThreadInterface passed as input.
t | the CuThreadInterface thread input argument |
This method
References CuActivityManagerPrivate::conn_mumap, CuActivityManagerPrivate::mythread, and CuActivityManagerPrivate::th_lis_mumap.