|
WXP C++ Library Version 6.74.9
|
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 () |
This class sets up a hash table for city database information.
| CityHash::CityHash | ( | const char * | file, |
| Domain & | domain, | ||
| int | prior | ||
| ) |
| CityHash::CityHash | ( | const char * | file | ) |
| CityHash::CityHash | ( | ) |
Constructor. Sets up hash table.
References init().
| CityHash::~CityHash | ( | ) |
Destructor
| int CityHash::first | ( | ) |
Goes to first city in hash table
References WXP::Hash::first().
| int CityHash::get | ( | const char * | id, |
| CityHashData & | data | ||
| ) |
Gets the city data from hash checking id for type of key
| id | City ID to search hash |
| data | CityHashData 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().
| int CityHash::get | ( | int | ind, |
| const char * | id, | ||
| CityHashData & | data | ||
| ) |
Gets the city data from hash
| ind | Type of ID |
| id | City ID to search hash |
| data | CityHashData class containing output data |
References WXP::Hash::search().
|
inline |
Returns number of stations in hash
Referenced by WXP::MdrPlot::draw().
| int CityHash::init | ( | ) |
Initializes the object
References WXP::Hash::init(), and WXP::Const::MISS.
Referenced by CityHash().
| const char * CityHash::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::setup | ( | const char * | file | ) |
Sets up hash table with all stations from file
| file | City database file to use |
References WXP::FileTool::addPath(), WXP::CityHashData::city, WXP::Hash::enter(), WXP::String::get(), WXP::Wxp::getDatabasePath(), WXP::CityData::getId(), WXP::CityData::getLat(), WXP::CityData::getLon(), WXP::CityFile::getNum(), WXP::CityData::getWmo(), WXP::CityFile::isOpen(), WXP::Wxp::outMessage(), WXP::CityFile::read(), WXP::FileAttr::READ, and WXP::Hash::set().
| int CityHash::setup | ( | const char * | file, |
| Domain & | domain, | ||
| int | prior | ||
| ) |
Sets up hash table. Filter based on domain and priority
| file | City database file to use |
| domain | Domain to save cities from |
| prior | Maximum priority to save |
References WXP::FileTool::addPath(), WXP::CityHashData::city, WXP::CityTool::compareData(), WXP::Hash::enter(), WXP::String::get(), WXP::Wxp::getDatabasePath(), WXP::CityData::getId(), WXP::CityData::getLat(), WXP::CityData::getLon(), WXP::CityFile::getNum(), WXP::Strings::getNum(), WXP::CityData::getPrior(), WXP::CityData::getWmo(), WXP::CityFile::isOpen(), WXP::CityFile::read(), WXP::FileAttr::READ, WXP::EarthPoint::set(), WXP::Hash::set(), WXP::Domain::tran(), and WXP::Domain::withinExt().
Referenced by CityHash(), CityHash(), and WXP::MdrPlot::draw().