|
luna-sysmgr-common
|
#include <SyncTask.h>
Public Member Functions | |
| SyncTask () | |
| SyncTask (GMainContext *ctxt) | |
| virtual | ~SyncTask () |
| virtual void | run () |
| virtual void | quit () |
Public Member Functions inherited from TaskBase | |
| TaskBase () | |
| virtual | ~TaskBase () |
| void | postEvent (sptr< Event > event, bool highPriority=false) |
| GMainLoop * | mainLoop () const |
| SingletonTimer * | masterTimer () const |
Public Member Functions inherited from RefCounted | |
| RefCounted () | |
| virtual | ~RefCounted () |
| void | ref () |
| void | deref () |
Additional Inherited Members | |
Protected Attributes inherited from TaskBase | |
| GMainContext * | m_mainCtxt |
| GMainLoop * | m_mainLoop |
| Mutex | m_mutex |
| Mutex | m_eventsMutex |
| std::list< sptr< Event > > | m_eventsList |
| AsyncCaller< TaskBase > * | m_asyncCaller |
| SingletonTimer * | m_masterTimer |
Base class for tying a TaskBase to GLib
Constructs a TaskBase and ties it to the proper GLib structures to it's relatively usable. Also sets up a the master timer and ties it to GLib.
If no GLib info is given upon construction, it asks for it from HostBase, thereby insulating any users of this class from needing to know anything about the underlying GLib structures.
Naming rationale is unknown at this point, since it doesn't appear to have anything to do with synchronization or anything.
| SyncTask::SyncTask | ( | ) |
| SyncTask::SyncTask | ( | GMainContext * | ctxt | ) |
Constructs a SyncTask and ties it to a given GLib context
Allows a SyncTask to be constructed and tied to a different GLib context than the process's global GLib context. This would be handy in the case where a new GLib conext was constructed after the main process starts and sets up its GLib context.
| ctxt | GLib context to tie this task to. |
|
virtual |
Cleans up the resources allocated at construction
Since this ties into GLib and timers at construction, this cleans it all up. Lets the reference counted objects know that the pointers to them that we constructed will no longer be used.
|
virtual |
Terminates this task
At this point, it doesn't appear this is used by any deriving classes. Ideally this would do cleanup from TaskBase::run().
Implements TaskBase.
|
virtual |
Runs this task
The bulk of derived classes' funcionality should reside within this method. This method should not return until the task is complete. For example, WebAppManager runs a QCoreApplication within this method, and when it terminates, this function returns.
Implements TaskBase.