Sleipnir
Public Member Functions
Sleipnir::CSeekStrIntMap Class Reference

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.

Detailed Description

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

Definition at line 194 of file seekmap.h.


Member Function Documentation

void Sleipnir::CSeekStrIntMap::Set ( const string &  s,
const utype &  i 
)

Add a pair to the map.

Parameters:
sThe string
iThe 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.

Parameters:
sA vector of string
Remarks:
The corresponding integers are the indices of the strings in the vector s.

Definition at line 162 of file seekmap.cpp.

References Clear().


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