|
| BasicJob (std::string input_tag, std::string native_tag, int nstruct=1) |
| You MUST ensure that input_tag is a UNIQUE identifier for this Job! More...
|
|
virtual | ~BasicJob () |
|
virtual int | nstruct () const |
| The number of times this job should be repeated. More...
|
|
virtual std::string | input_tag () const |
| The tag supplied at create time. More...
|
|
virtual std::string | native_tag () const |
| The tag supplied at create time. More...
|
|
virtual std::string | output_tag (int struct_n) const |
| The tag supplied at create time plus the nstruct number (from 1 to nstruct inclusive). More...
|
|
virtual std::string | output_file_name () const |
| The tag supplied at create time plus the nstruct number (from 1 to nstruct inclusive). More...
|
|
void | set_output_file_name (std::string str) |
| The tag supplied at create time plus the nstruct number (from 1 to nstruct inclusive). More...
|
|
template<typename T > |
bool | get (std::string const &key, T &value) |
| Extracts named value. Works for anything that deserializes from string. Returns false on error. More...
|
|
bool | get (std::string const &key, std::string &value) |
| Specialization for strings. More...
|
|
template<typename T > |
void | set (std::string const &key, T const &value) |
| Set named value. Works for anything that serializes to a string. More...
|
|
void | set (std::string const &key, std::string const &value) |
| Specialization for strings. More...
|
|
void | set_preserve_whole_input_tag (bool setting) |
|
Each Job object describes a particular input to Rosetta.
Ordinarily, an input is just a single PDB file. In other cases, e.g. docking, input might be a pair of PDB files. In still other cases, input might be a list of tags to extract from a silent file. And so on. One BasicJob class is defined below that should meet most needs, but if you need to carry additional information, you can subclass it.
Contains a map of strings to strings that can be used to store arbitrary extra data if you're too lazy to make a subclass. Templated get/set functions accept anything that can be read from and written to a C++ stream with >> and << operators. All data is stored as strings internally. Some numeric data may experience slight round-off error, though I think we're storing enough digits to avoid that.
Example: BasicJob jobdata("1abc.pdb", 10); jobdata.set("cmp_to", "1xyz.pdb"); jobdata.set("score", 42.42);
std::string cmp_to; core::Real score; if( jobdata.get("cmp_to", cmp_to) ) std::cout << "cmp_to = " << cmp_to << std::endl; else std::cout << "Unable to recover cmp_to!" << std::endl; if( jobdata.get("score", score) ) std::cout << "score = " << score << std::endl; else std::cout << "Unable to recover score!" << std::endl;
Although Jobs are small objects, it is common for Rosetta to loop many times over the same input. In order to avoid creating (size of -s and -l) * (nstruct) JobData objects, each Job also has an nstruct counter.
So, each Job represents a unique input, and each tuple of (Job, struct_n) represents a unique output.