Sleipnir
|
A string to integer mapping structure. More...
#include <seekmap.h>
Public Member Functions | |
CSeekStrIntMap () | |
Constructor. | |
~CSeekStrIntMap () | |
Destructor. | |
void | Clear () |
Clear function. | |
void | Set (const string &, const utype &) |
Add a pair to the map. | |
void | SetAll (const vector< string > &) |
Add all the pairs at once. | |
utype | Get (const string &) const |
Get the corresponding integer for the given string. | |
map< string, utype > & | GetMapForward () |
Get the entire map with key=string, value=integer. | |
map< utype, string > & | GetMapReverse () |
Get the entire map with key=integer, value=string. | |
utype | GetSize () const |
Get the genome size. | |
string | Get (const utype &) const |
Get the corresponding string for the given integer. | |
vector< string > | GetAllString () const |
Retrieve all the strings in the map as a vector. | |
vector< utype > | GetAllInteger () const |
Retrieve all the integers in the map as a vector. |
A string to integer mapping structure.
Adds <string, integer> pairs into the map.
Supports two major operations:
Get(string)
: returns the corresponding integer
Get(integer)
: returns the corresponding string
void Sleipnir::CSeekStrIntMap::Set | ( | const string & | s, |
const utype & | i | ||
) |
Add a pair to the map.
s | The string |
i | The integer in utype |
Definition at line 171 of file seekmap.cpp.
Referenced by Sleipnir::CSeekTools::ReadListOneColumn().
void Sleipnir::CSeekStrIntMap::SetAll | ( | const vector< string > & | s | ) |
Add all the pairs at once.
s | A vector of string |
s
. Definition at line 162 of file seekmap.cpp.
References Clear().