MoleQueue  0.8.0
 All Classes Functions Variables Enumerations Enumerator Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
JobReferenceBase Class Reference

#include <molequeue/jobreferencebase.h>

Inheritance diagram for JobReferenceBase:
Job

Public Member Functions

 JobReferenceBase (JobData *jobdata=NULL)
 
 JobReferenceBase (JobManager *jobManager, IdType moleQueueId)
 
 JobReferenceBase (const JobReferenceBase &other)
 
bool operator== (const JobReferenceBase &other) const
 
bool isValid () const
 

Protected Member Functions

JobDatajobData () const
 
bool warnIfInvalid () const
 

Protected Attributes

JobDatam_jobData
 
JobManagerm_jobManager
 
IdType m_moleQueueId
 

Detailed Description

Base class for lightweight interfaces to JobData objects.

Author
David C. Lonie

JobData objects, owned by JobManager, each contain data pertaining to a specific job running a Program on a Queue. JobData contains several dynamic properties that change during it's lifetime, e.g. Queue id and JobState. To avoid having out-of-date references in the MoleQueue application, subclasses of JobReferenceBase provide a convenient interface for obtaining and modifying job properties.

JobReferenceBase validates the pointer to the JobData object it represents by querying the JobManager. The validity of the JobData pointer can be checked with isValid(), which will return false if the JobData has been removed from the JobManager. Subclasses of JobReferenceBase, Job on the Server and JobRequest on the Client, will forward requests to the JobData. Certain methods may cause signals to be emitted from JobManager; these cases will be noted in the method documentation.

Constructor & Destructor Documentation

JobReferenceBase ( JobData jobdata = NULL)
explicit

Construct a new JobReferenceBase with the specified JobData.

JobReferenceBase ( JobManager jobManager,
IdType  moleQueueId 
)

Construct a new JobReferenceBase for the job with the MoleQueueId in the indicated JobManager

JobReferenceBase ( const JobReferenceBase other)

Construct a new JobReferenceBase with the same JobData as other.

Member Function Documentation

bool operator== ( const JobReferenceBase other) const

Returns true if both JobReferenceBases are valid and refer to the same JobData instance.

bool isValid ( ) const
Returns
true if the guarded JobData pointer is valid, false otherwise.
bool warnIfInvalid ( ) const
protected

Print a warning with debugging info and return false if isValid() returns false.

Member Data Documentation

JobData* m_jobData
mutableprotected

May be set to NULL during validation.

IdType m_moleQueueId
mutableprotected

Used to speed up lookups and validation.


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