vg
tools for working with variation graphs
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
vg::IndexRegistry Class Reference

#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...
 
IndexFileget_index (const string &identifier)
 access index file More...
 
const IndexFileget_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...
 

Detailed Description

An object that can record methods to produce indexes and design workflows to create a set of desired indexes

Constructor & Destructor Documentation

◆ IndexRegistry()

vg::IndexRegistry::IndexRegistry ( )
default

Member Function Documentation

◆ completed_indexes()

vector< string > vg::IndexRegistry::completed_indexes ( ) const

Get a list of all indexes that have already been completed or provided.

◆ dependency_order()

vector< string > vg::IndexRegistry::dependency_order ( ) const
protected

get a topological ordering of all registered indexes in the dependency DAG

◆ get_index() [1/2]

IndexFile * vg::IndexRegistry::get_index ( const string &  identifier)
protected

access index file

◆ get_index() [2/2]

const IndexFile * vg::IndexRegistry::get_index ( const string &  identifier) const
protected

access const index file

◆ make_indexes()

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.

◆ make_plan()

vector< pair< string, size_t > > vg::IndexRegistry::make_plan ( const vector< string > &  end_products) const
protected

generate a plan to create the indexes

◆ provide() [1/2]

void vg::IndexRegistry::provide ( const string &  identifier,
const string &  filename 
)

Indicate a serialized file that contains some identified index.

◆ provide() [2/2]

void vg::IndexRegistry::provide ( const string &  identifier,
const vector< string > &  filenames 
)

Indicate a list of serialized files that contains some identified index.

◆ register_index()

void vg::IndexRegistry::register_index ( const string &  identifier,
const string &  suffix 
)

Register an index with the given identifier.

◆ register_recipe()

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

◆ set_intermediate_file_keeping()

void vg::IndexRegistry::set_intermediate_file_keeping ( bool  keep_intermediates)

Should intermediate files be saved to the output directory or the temp directory?

◆ set_prefix()

void vg::IndexRegistry::set_prefix ( const string &  prefix)

Prefix for all saved outputs.

◆ to_dot() [1/2]

string vg::IndexRegistry::to_dot ( ) const

Returns the recipe graph in dot format.

◆ to_dot() [2/2]

string vg::IndexRegistry::to_dot ( const vector< string > &  targets) const

Returns the recipe graph in dot format with a plan highlighted.

Member Data Documentation

◆ keep_intermediates

bool vg::IndexRegistry::keep_intermediates = false
protected

should intermediate files end up in the scratch or the output directory?

◆ output_prefix

string vg::IndexRegistry::output_prefix = "index"
protected

filepath that will prefix all saved output

◆ registered_suffixes

unordered_set<string> vg::IndexRegistry::registered_suffixes
protected

◆ registry

unordered_map<string, unique_ptr<IndexFile> > vg::IndexRegistry::registry
protected

the storage struct for named indexes


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