vg
tools for working with variation graphs
|
#include <index_registry.hpp>
Public Member Functions | |
IndexRegistry ()=default | |
Constructor. More... | |
void | set_prefix (const string &prefix) |
Prefix for all saved outputs. More... | |
void | set_intermediate_file_keeping (bool keep_intermediates) |
void | register_index (const string &identifier, const string &suffix) |
Register an index with the given identifier. More... | |
void | register_recipe (const string &identifier, const vector< string > &input_identifiers, const function< vector< string >(const vector< const IndexFile * > &, const string &, const string &)> &exec) |
void | provide (const string &identifier, const string &filename) |
Indicate a serialized file that contains some identified index. More... | |
void | provide (const string &identifier, const vector< string > &filenames) |
Indicate a list of serialized files that contains some identified index. More... | |
vector< string > | completed_indexes () const |
Get a list of all indexes that have already been completed or provided. More... | |
void | make_indexes (const vector< string > &identifiers) |
string | to_dot () const |
Returns the recipe graph in dot format. More... | |
string | to_dot (const vector< string > &targets) const |
Returns the recipe graph in dot format with a plan highlighted. More... | |
Protected Member Functions | |
vector< string > | dependency_order () const |
get a topological ordering of all registered indexes in the dependency DAG More... | |
vector< pair< string, size_t > > | make_plan (const vector< string > &end_products) const |
generate a plan to create the indexes More... | |
IndexFile * | get_index (const string &identifier) |
access index file More... | |
const IndexFile * | get_index (const string &identifier) const |
access const index file More... | |
Protected Attributes | |
unordered_map< string, unique_ptr< IndexFile > > | registry |
the storage struct for named indexes More... | |
unordered_set< string > | registered_suffixes |
string | output_prefix = "index" |
filepath that will prefix all saved output More... | |
bool | keep_intermediates = false |
should intermediate files end up in the scratch or the output directory? More... | |
An object that can record methods to produce indexes and design workflows to create a set of desired indexes
|
default |
vector< string > vg::IndexRegistry::completed_indexes | ( | ) | const |
Get a list of all indexes that have already been completed or provided.
|
protected |
get a topological ordering of all registered indexes in the dependency DAG
|
protected |
access index file
|
protected |
access const index file
void vg::IndexRegistry::make_indexes | ( | const vector< string > & | identifiers | ) |
Create and execute a plan to make the indicated indexes using provided inputs If provided inputs cannot create the desired indexes, throws a InsufficientInputException.
|
protected |
generate a plan to create the indexes
void vg::IndexRegistry::provide | ( | const string & | identifier, |
const string & | filename | ||
) |
Indicate a serialized file that contains some identified index.
void vg::IndexRegistry::provide | ( | const string & | identifier, |
const vector< string > & | filenames | ||
) |
Indicate a list of serialized files that contains some identified index.
void vg::IndexRegistry::register_index | ( | const string & | identifier, |
const string & | suffix | ||
) |
Register an index with the given identifier.
void vg::IndexRegistry::register_recipe | ( | const string & | identifier, |
const vector< string > & | input_identifiers, | ||
const function< vector< string >(const vector< const IndexFile * > &, const string &, const string &)> & | exec | ||
) |
Register a recipe to produce an index using other indexes or input files. Also takes a for output as input
void vg::IndexRegistry::set_intermediate_file_keeping | ( | bool | keep_intermediates | ) |
Should intermediate files be saved to the output directory or the temp directory?
void vg::IndexRegistry::set_prefix | ( | const string & | prefix | ) |
Prefix for all saved outputs.
string vg::IndexRegistry::to_dot | ( | ) | const |
Returns the recipe graph in dot format.
string vg::IndexRegistry::to_dot | ( | const vector< string > & | targets | ) | const |
Returns the recipe graph in dot format with a plan highlighted.
|
protected |
should intermediate files end up in the scratch or the output directory?
|
protected |
filepath that will prefix all saved output
|
protected |
|
protected |
the storage struct for named indexes