WXP C++ Library Version 6.74.6
Loading...
Searching...
No Matches
Public Member Functions | List of all members
WXP::CityHash Class Reference

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

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

Public Member Functions

 CityHash (const char *file, Domain &domain, int prior)
 
 CityHash (const char *file)
 
 CityHash ()
 
 ~CityHash ()
 
int init ()
 
int setup (const char *file, Domain &domain, int prior)
 
int setup (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() [1/3]

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

Constructor. Sets up hash table.

Parameters
fileCity database file to use
domainDomain to save cities from
priorMaximum priority to save

References setup().

◆ CityHash() [2/3]

CityHash::CityHash ( const char *  file)

Constructor. Sets up hash table.

Parameters
fileCity database file to use

References setup().

◆ CityHash() [3/3]

CityHash::CityHash ( )

Constructor. Sets up hash table.

References init().

◆ ~CityHash()

CityHash::~CityHash ( )

Destructor

Member Function Documentation

◆ first()

int CityHash::first ( )

Goes to first city in hash table

References WXP::Hash::first().

◆ get() [1/2]

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

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

Parameters
idCity ID to search hash
Return values
dataCityHashData class containing output data

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

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

◆ get() [2/2]

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

Gets the city data from hash

Parameters
indType of ID
idCity ID to search hash
Return values
dataCityHashData class containing output data

References WXP::Hash::search().

◆ getNum()

int WXP::CityHash::getNum ( )
inline

Returns number of stations in hash

Referenced by WXP::MdrPlot::draw().

◆ init()

int CityHash::init ( )

Initializes the object

References WXP::Hash::init(), and WXP::Const::MISS.

Referenced by CityHash().

◆ nextKey()

const char * CityHash::nextKey ( )

Gets the key of the next city in the hash table

Returns
City ID

References WXP::Hash::nextKey().

◆ print()

int CityHash::print ( )

Prints hash table information

References WXP::Hash::print().

◆ printData()

int CityHash::printData ( )

Prints the hash table data

References WXP::Hash::print().

◆ setup() [1/2]

int CityHash::setup ( const char *  file)

◆ setup() [2/2]

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

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