#include <molequeue/jobreferencebase.h>
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 | |
JobData * | jobData () const |
bool | warnIfInvalid () const |
Protected Attributes | |
JobData * | m_jobData |
JobManager * | m_jobManager |
IdType | m_moleQueueId |
Base class for lightweight interfaces to JobData objects.
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.
|
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.
bool operator== | ( | const JobReferenceBase & | other | ) | const |
Returns true if both JobReferenceBases are valid and refer to the same JobData instance.
bool isValid | ( | ) | const |
|
protected |
Print a warning with debugging info and return false if isValid() returns false.
|
mutableprotected |
May be set to NULL during validation.
|
mutableprotected |
Used to speed up lookups and validation.