AvogadroLibs
1.96.0
|
Simple client-side representation for a MoleQueue job. More...
#include <molequeue/client/jobobject.h>
Public Member Functions | |
void | setValue (const QString &key, const QVariant &value) |
QVariant | value (const QString &key, const QVariant &defaultValue=QVariant()) const |
void | fromJson (const QJsonObject &jsonObject) |
QJsonObject | json () const |
void | setQueue (const QString &queueName) |
QString | queue () const |
void | setProgram (const QString &programName) |
QString | program () const |
void | setDescription (const QString &descriptionText) |
QString | description () const |
void | setInputFile (const QString &fileName, const QString &contents) |
Set the input file for the job. More... | |
void | setInputFile (const QString &path) |
void | setInputFile (const QJsonObject &file) |
QJsonObject | inputFile () const |
void | appendAdditionalInputFile (const QString &fileName, const QString &contents) |
void | appendAdditionalInputFile (const QString &path) |
void | setAdditionalInputFiles (const QJsonArray &files) |
void | clearAdditionalInputFiles () |
QJsonArray | additionalInputFiles () const |
Protected Member Functions | |
QJsonObject | fileSpec (const QString &fileName, const QString &contents) |
QJsonObject | fileSpec (const QString &path) |
Protected Attributes | |
QJsonObject | m_value |
The Job class provides a simple interface to the client side representation of a job to be submitted to MoleQueue. Any fields that are not set/present will be omitted entirely, or set to default values by MoleQueue. The internal representation of a job (and the transport used) is JSON.
The Job class and data structure is very lightweight, and designed to be easily copied, modified and passed around.
void setValue | ( | const QString & | key, |
const QVariant & | value | ||
) |
Set the value
of the specified key
.
QVariant value | ( | const QString & | key, |
const QVariant & | defaultValue = QVariant() |
||
) | const |
Get the value of the specified key
. If the key is not set, return defaultValue
.
void fromJson | ( | const QJsonObject & | jsonObject | ) |
Set the job up using the supplied JSON object. This replaces all previous settings that may have been applied.
QJsonObject json | ( | ) | const |
Get the JSON object with the current job settings in it.
void setQueue | ( | const QString & | queueName | ) |
Set the queue that the job should be submitted to. This must be a valid queue name discovered using the client API.
QString queue | ( | ) | const |
Get the name of the queue that the job will be submitted to. An empty string means that no queue has been set.
void setProgram | ( | const QString & | programName | ) |
Set the program that the job should be submitted to. This must be a valid program in a valid queue as discovered using the client API.
QString program | ( | ) | const |
Get the name of the program that the job will be submitted to. An empty string means that no program has been set.
void setDescription | ( | const QString & | descriptionText | ) |
Set the description of the job, this is free text.
QString description | ( | ) | const |
Get the description of the job.
void setInputFile | ( | const QString & | fileName, |
const QString & | contents | ||
) |
fileName | The file name as it will appear in the working directory. |
contents | The contents of the file specified. |
void setInputFile | ( | const QString & | path | ) |
Set the input file for the job, the file will be copied and the file name used in the working directory of the job submission.
path | The full path to the input file. |
void setInputFile | ( | const QJsonObject & | file | ) |
Set the input file using a JSON object. This must conform to the file specification.
file | A JSON object employing file specification to specify input. |
QJsonObject inputFile | ( | ) | const |
Get the input file for the job. This is a JSON object using the file spec.
void appendAdditionalInputFile | ( | const QString & | fileName, |
const QString & | contents | ||
) |
Append an additional input file for the job.
fileName | The file name as it will appear in the working directory. |
contents | The contents of the file specified. |
void appendAdditionalInputFile | ( | const QString & | path | ) |
Append an additional input file for the job, the file will be copied and the file name used in the working directory of the job submission.
path | The full path to the input file. |
void setAdditionalInputFiles | ( | const QJsonArray & | files | ) |
Set the additional input file using a JSON object. This must conform to the file specification.
files | A JSON array employing file specification to specify input. |
void clearAdditionalInputFiles | ( | ) |
Clear additional input files.
QJsonArray additionalInputFiles | ( | ) | const |
Get the additional input files for the job. This is a JSON object using the file spec.
|
protected |
Generate a filespec JSON object form the supplied file name and contents.
|
protected |
Generate a filespec JSON object form the supplied file path (must exist).