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

#include <index_registry.hpp>

Public Member Functions

 IndexFile (const IndexName &identifier, const string &suffix)
 Create a new IndexFile with a unique identifier. More...
 
 IndexFile (const IndexName &identifier, const vector< string > &suffixes)
 Create a new IndexFile with a unique identifier, which may use one of several suffixes. More...
 
const IndexNameget_identifier () const
 Get the globally unique identifier for this index. More...
 
const vector< string > & get_suffixes () const
 Returns the suffixes that can used for this index. More...
 
const vector< string > & get_filenames () const
 Get the filename(s) that contain this index. More...
 
void provide (const vector< string > &filenames)
 Identify a serialized file that already contains this index. More...
 
void assign_constructed (const vector< string > &filenames)
 Assign constructed filenames to this index. More...
 
void add_scope (const string &key, const string &value)
 
const map< string, string > & get_scopes () const
 Get all scopes qualifying the index (such as a sample name). More...
 
bool is_finished () const
 Returns true if the index has already been built or provided. More...
 
bool was_provided_directly () const
 Returns true if the index was provided through provide method. More...
 
void reset ()
 Discard any constructed or provided indexes. More...
 

Private Attributes

IndexName identifier
 
const vector< string > suffixes
 
vector< string > filenames
 
map< string, string > scopes
 
bool provided_directly = false
 

Detailed Description

An object that generically represents a serializable index or input file

Constructor & Destructor Documentation

◆ IndexFile() [1/2]

vg::IndexFile::IndexFile ( const IndexName identifier,
const string &  suffix 
)

Create a new IndexFile with a unique identifier.

◆ IndexFile() [2/2]

vg::IndexFile::IndexFile ( const IndexName identifier,
const vector< string > &  suffixes 
)

Create a new IndexFile with a unique identifier, which may use one of several suffixes.

Member Function Documentation

◆ add_scope()

void vg::IndexFile::add_scope ( const string &  key,
const string &  value 
)

Add a new scope to qualify the files in the index, if the scope is not already on the index.

Should only be used on files that are actually filled in already; scopes for files that don't exist yet are the responsibility of the IndexingPlan.

◆ assign_constructed()

void vg::IndexFile::assign_constructed ( const vector< string > &  filenames)

Assign constructed filenames to this index.

◆ get_filenames()

const vector< string > & vg::IndexFile::get_filenames ( ) const

Get the filename(s) that contain this index.

◆ get_identifier()

const IndexName & vg::IndexFile::get_identifier ( ) const

Get the globally unique identifier for this index.

◆ get_scopes()

const map< string, string > & vg::IndexFile::get_scopes ( ) const

Get all scopes qualifying the index (such as a sample name).

◆ get_suffixes()

const vector< string > & vg::IndexFile::get_suffixes ( ) const

Returns the suffixes that can used for this index.

◆ is_finished()

bool vg::IndexFile::is_finished ( ) const

Returns true if the index has already been built or provided.

◆ provide()

void vg::IndexFile::provide ( const vector< string > &  filenames)

Identify a serialized file that already contains this index.

◆ reset()

void vg::IndexFile::reset ( )

Discard any constructed or provided indexes.

◆ was_provided_directly()

bool vg::IndexFile::was_provided_directly ( ) const

Returns true if the index was provided through provide method.

Member Data Documentation

◆ filenames

vector<string> vg::IndexFile::filenames
private

◆ identifier

IndexName vg::IndexFile::identifier
private

◆ provided_directly

bool vg::IndexFile::provided_directly = false
private

◆ scopes

map<string, string> vg::IndexFile::scopes
private

◆ suffixes

const vector<string> vg::IndexFile::suffixes
private

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