WXP C++ Library Version 6.74.9
Loading...
Searching...
No Matches
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

◆ 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(), and WXP::CityTool::toWmo().

Referenced by 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

◆ getNum()

int WXP::CityHash::getNum ( )
inline

Returns number of stations in hash

◆ init()

int CityHash::init ( )

Initializes the object

References 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

◆ print()

int CityHash::print ( )

Prints hash table information

References WXP::CityHashData::print().

◆ printData()

int CityHash::printData ( )

Prints the hash table data

◆ setup() [1/2]

◆ setup() [2/2]


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