COVISE Core
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
Public Member Functions | Private Attributes | List of all members
covise::coStringTable Class Reference

#include <coStringTable.h>

Public Member Functions

 coStringTable ()
 default Constructor More...
 
void insert (int number, const char *str)
 
bool isElement (int x)
 
bool isElement (const char *str)
 
const char * operator[] (int x)
 
int operator[] (const char *str)
 

Private Attributes

std::map< const char *, int,
ltstr > * 
cs_
 
std::map< int, const char
*, ltint > * 
ci_
 

Detailed Description

a coStringTable object may have a string or an integer as index. You can either search for the integer and get the string or search for the string and get the integer. Examples: coStringTable sample; sample.insert(177, "foo");

gives foo cout << sample[177] << endl; gives 177 cout << sample["foo"] << endl;

Constructor & Destructor Documentation

coStringTable::coStringTable ( )

default Constructor

Member Function Documentation

void coStringTable::insert ( int  number,
const char *  str 
)

Insert a pair of integer/string

Parameters
numberthe number belonging to the string
strthe string to be inserted
bool coStringTable::isElement ( int  x)

check whether an integer occurs in the table

Parameters
xthe integer to be found
bool coStringTable::isElement ( const char *  str)

check whether a string occurs in the table

const char * coStringTable::operator[] ( int  x)

get the string belonging to the integer

Parameters
xthe integer in question
Returns
the string belonging to the integer
int coStringTable::operator[] ( const char *  str)

get the integer belonging to the string

Parameters
str

Member Data Documentation

std::map<int, const char *, ltint>* covise::coStringTable::ci_
private
std::map<const char *, int, ltstr>* covise::coStringTable::cs_
private

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