luna-sysmgr-common
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SyncTask Class Reference

#include <SyncTask.h>

Inheritance diagram for SyncTask:
[legend]
Collaboration diagram for SyncTask:
[legend]

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
 
SingletonTimermasterTimer () 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
 
SingletonTimerm_masterTimer
 

Detailed Description

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.

Constructor & Destructor Documentation

SyncTask::SyncTask ( )

Constructs a SyncTask and ties it to the process's global GLib context

Since a GLib context is not given, this constructor fetches one from the global state in HostBase and uses it.

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.

Parameters
ctxtGLib context to tie this task to.
SyncTask::~SyncTask ( )
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.

Member Function Documentation

void SyncTask::quit ( )
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.

void SyncTask::run ( )
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.


The documentation for this class was generated from the following files: