WXP::CityHash Class Reference

This class sets up a hash table for city database information. More...

#include "../include/CityHash.h"

List of all members.

Public Member Functions

 CityHash (const char *file, Domain &domain, int prior)
 CityHash (const char *file)
 CityHash ()
int init ()
int set (const char *file, Domain &domain, int prior)
int set (const char *file)
int get (const char *id, CityHashData &data)
int get (int ind, const char *id, CityHashData &data)
int first ()
const char * nextKey ()
int getNum ()
int print ()
int printData ()

Detailed Description

This class sets up a hash table for city database information.

Author:
Dan Vietor

Constructor & Destructor Documentation

CityHash::CityHash ( const char *  file,
Domain domain,
int  prior 
)

Constructor. Sets up hash table.

Parameters:
file City database file to use
domain Domain to save cities from
prior Maximum priority to save
CityHash::CityHash ( const char *  file  ) 

Constructor. Sets up hash table.

Parameters:
file City database file to use
CityHash::CityHash (  ) 

Constructor. Sets up hash table.


Member Function Documentation

int CityHash::first (  ) 

Goes to first city in hash table

References WXP::Hash::first().

int CityHash::get ( int  ind,
const char *  id,
CityHashData data 
)

Gets the city data from hash

Parameters:
ind Type of ID
id City ID to search hash
Return values:
data CityHashData class containing output data

References WXP::Hash::search().

int CityHash::get ( const char *  id,
CityHashData data 
)

Gets the city data from hash checking id for type of key

Parameters:
id City ID to search hash
Return values:
data CityHashData class containing output data

References WXP::StrLib::check(), WXP::StrLib::length(), and WXP::Hash::search().

Referenced by WXP::RcmPlot::draw(), and WXP::MdrPlot::draw().

const char * CityHash::nextKey (  ) 

Gets the key of the next city in the hash table

Returns:
City ID

References WXP::Hash::nextKey().

int CityHash::print (  ) 

Prints hash table information

References WXP::Hash::print().

int CityHash::printData (  ) 

Prints the hash table data

References WXP::Hash::print().

int CityHash::set ( const char *  file  ) 
int CityHash::set ( const char *  file,
Domain domain,
int  prior 
)

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

Generated on 8 Jan 2010 for WXP C++ Library by  doxygen 1.6.1