KVIrc  4.9.2
DeveloperAPIs
Public Member Functions | Protected Attributes | List of all members
KviPointerHashTableIterator< Key, T > Class Template Reference

A fast pointer hash table iterator implementation. More...

#include <KviPointerHashTable.h>

Public Member Functions

T * current () const
 Returs the value pointed by the iterator. More...
 
const Key & currentKey () const
 Returs the key pointed by the iterator. More...
 
 KviPointerHashTableIterator (const KviPointerHashTable< Key, T > &hTable)
 Creates an iterator pointing to the first item in the hash table, if any. More...
 
bool moveFirst ()
 Moves the iterator to the first element of the hash table. More...
 
bool moveLast ()
 Moves the iterator to the last element of the hash table. More...
 
bool moveNext ()
 Moves the iterator to the next element of the hash table. More...
 
bool movePrev ()
 Moves the iterator to the previous element of the hash table. More...
 
T * operator* () const
 Returs the value pointed by the iterator. More...
 
bool operator++ ()
 Moves the iterator to the next element of the hash table. More...
 
bool operator-- ()
 Moves the iterator to the previous element of the hash table. More...
 
void operator= (const KviPointerHashTableIterator< Key, T > &src)
 Creates an iterator copy. More...
 
T * toFirst ()
 Moves the iterator to the first element of the hash table. More...
 
 ~KviPointerHashTableIterator ()
 Destroys the iterator. More...
 

Protected Attributes

const KviPointerHashTable< Key,
T > * 
m_pHashTable
 
KviPointerListIterator
< KviPointerHashTableEntry
< Key, T > > * 
m_pIterator
 
unsigned int m_uEntryIndex
 

Detailed Description

template<typename Key, typename T>
class KviPointerHashTableIterator< Key, T >

A fast pointer hash table iterator implementation.

Constructor & Destructor Documentation

template<typename Key, typename T>
KviPointerHashTableIterator< Key, T >::KviPointerHashTableIterator ( const KviPointerHashTable< Key, T > &  hTable)
inline
template<typename Key, typename T>
KviPointerHashTableIterator< Key, T >::~KviPointerHashTableIterator ( )
inline

Destroys the iterator.

References KviPointerHashTableIterator< Key, T >::m_pIterator.

Member Function Documentation

template<typename Key, typename T>
T* KviPointerHashTableIterator< Key, T >::current ( ) const
inline

Returs the value pointed by the iterator.

If the iterator is not valid it returns a default constructed value This is an alias to operator *() with just a different name.

Returns
T *

References KviPointerListIterator< T >::current(), KviPointerHashTableIterator< Key, T >::m_pIterator, and NULL.

Referenced by action_kvs_cmd_list(), ActionEditor::ActionEditor(), addon_kvs_cmd_list(), ClassEditorWidget::appendAllClassItems(), KviKvsHash::appendAsString(), KviStatusBar::appletsPopupAboutToShow(), KviStatusBar::appletsPopupActivated(), ClassEditorWidget::build(), KviStupidNotifyListManager::buildNickList(), KviIsOnNotifyListManager::buildNotifyList(), KviIsOnNotifyListManager::buildRegUserDict(), KviWatchNotifyListManager::buildRegUserDict(), KviKvsVariant::castToArray(), PluginManager::checkUnload(), KviSharedFilesManager::cleanup(), KviAvatarCache::cleanup(), KviModuleManager::cleanupUnusedModules(), KviKvsObjectController::clearUserClasses(), PopupEditorWidget::commit(), KviKvsAliasManager::completeCommand(), KviKvsKernel::completeFunction(), config_kvs_fnc_filelist(), config_kvs_fnc_id(), config_kvs_fnc_keylist(), config_kvs_fnc_open(), config_kvs_fnc_sectionlist(), KviApplication::connectionExists(), KviKvsVariant::convertToArray(), KviRegisteredUserDataBase::copyFrom(), KviUserIdentityManager::copyFrom(), KviCustomToolBarManager::createToolBarsVisibleAtStartup(), dcc_kvs_fnc_sessionList(), KviUserIdentityManager::defaultIdentity(), KviKvsScriptAddonManager::delayedLoad(), KviActionManager::delayedRegisterAccelerators(), KviKvsTimerManager::deleteAllTimers(), KviTrayIconWidget::doAway(), KviKvsTreeNodeSwitchList::dump(), KviKvsTreeNodeSwitchList::evaluate(), KviActionDrawer::fill(), KviTextIconWindow::fill(), KviTrayIconWidget::fillContextPopup(), RegisteredUserPropertiesDialog::fillData(), SharedFilesWindow::fillFileView(), AddonManagementDialog::fillListView(), OptionsWidget_servers::fillServerList(), OptionsWidget_textIcons::fillTable(), KviMainWindow::fillToolBarsPopup(), KviApplication::findConsole(), KviCustomToolBarManager::findDescriptorByInternalId(), KviApplication::findWindowByCaption(), KviCustomToolBarManager::firstExistingToolBar(), KviKvsObjectController::flushUserClasses(), KviKvsKernel::getAllFunctionsCommandsCore(), KviKvsModuleInterface::getAllFunctionsCommandsModule(), KviSoundPlayer::getAvailableSoundSystems(), KviModuleManager::hasLockedModules(), HttpFileTransfer::headersReceived(), KviApplication::heartbeat(), KviActionManager::killAllKvsUserActions(), KviClassEditorDialog::KviClassEditorDialog(), KviKvsHash::KviKvsHash(), KviKvsObjectClass::KviKvsObjectClass(), KviKvsCoreFunctions::KVSCF(), KviKvsCoreSimpleCommands::KVSCSC(), KviActionManager::listActionsByCategory(), KviRegisteredChannelDataBase::load(), KviKvsPopupManager::load(), KviCustomToolBarManager::load(), KviKvsAliasManager::load(), KviRegisteredUserDataBase::load(), KviActionManager::load(), KviAvatarCache::load(), KviUserIdentityManager::load(), KviIrcServerDataBase::load(), KviTextIconManager::load(), ClassEditorWidget::loadNotBuiltClasses(), KviIrcServerDataBase::makeCurrentServer(), KviUserListViewArea::mousePressEvent(), KviNotifyListManager::notifyOffLine(), KviNotifyListManager::notifyOnLine(), objects_kvs_fnc_classes(), objects_kvs_fnc_instances(), RegisteredUserEntryDialog::okClicked(), AliasEditorWidget::oneTimeSetup(), PopupEditorWidget::oneTimeSetup(), ClassEditorWidget::oneTimeSetup(), options_module_cleanup(), OptionsWidget_textEncoding::OptionsWidget_textEncoding(), package_kvs_fnc_info(), KviPackageWriter::packInternal(), KviUserListView::partAllButOne(), KviIrcUserDataBase::registeredDatabaseCleared(), KviIrcUserDataBase::registeredUserAdded(), KviIrcUserDataBase::registeredUserChanged(), RegisteredUserEntryDialog::RegisteredUserEntryDialog(), reguser_kvs_cmd_showlist(), reguser_kvs_fnc_list(), KviUserListView::removeAllEntries(), KviKvsAliasManager::removeNamespace(), KviConsoleWindow::resetAvatarForMatchingUsers(), KviApplication::resetAvatarForMatchingUsers(), KviApplication::restartLagMeters(), KviApplication::restartNotifyLists(), KviIrcUrl::run(), KviSharedFilesManager::save(), KviKvsPopupManager::save(), KviCustomToolBarManager::save(), KviKvsAliasManager::save(), KviConfigurationFile::save(), KviRegisteredUserDataBase::save(), KviActionManager::save(), KviKvsObjectClass::save(), KviUserIdentityManager::save(), KviAvatarCache::save(), KviKvsScriptAddonManager::save(), KviIrcServerDataBase::save(), KviTextIconManager::save(), ClassEditorWidget::saveNotBuiltClasses(), KviApplication::saveRecentChannels(), KviMainWindow::saveWindowProperties(), ClassEditorWidget::searchInheritedClasses(), ClassEditorWidget::searchReplace(), KviUserListView::select(), KviKvsHash::serialize(), serverdb_kvs_fnc_serverExists(), KviApplication::setAvatarFromOptions(), KviMainWindow::setButtonStyle(), KviMainWindow::setIconSize(), sharedfile_kvs_cmd_list(), SingleActionEditor::SingleActionEditor(), KviWatchNotifyListManager::start(), KviCustomToolBarManager::storeVisibilityState(), texticons_kvs_fnc_get(), KviPointerHashTableIterator< Key, T >::toFirst(), toolbar_kvs_fnc_list(), KviApplication::topmostConnectedConsole(), PluginManager::unloadAll(), KviModuleManager::unloadAllModules(), KviModuleExtensionManager::unregisterExtensionsByModule(), KviCustomToolBarManager::updateVisibleToolBars(), KviCustomToolBarManager::visibleToolBarCount(), window_kvs_fnc_list(), KviApplication::windowExists(), and KviActionManager::~KviActionManager().

template<typename Key, typename T>
const Key& KviPointerHashTableIterator< Key, T >::currentKey ( ) const
inline

Returs the key pointed by the iterator.

If the iterator is not valid it returns a default constructed value

Returns
const Key &

References KviPointerListIterator< T >::current(), kvi_hash_key_default(), KviPointerHashTableIterator< Key, T >::m_pIterator, and NULL.

Referenced by KviIsOnNotifyListManager::buildNotifyList(), PluginManager::checkUnload(), KviSharedFilesManager::cleanup(), KviAvatarCache::cleanup(), PopupEditorWidget::commit(), KviKvsKernel::completeFunction(), config_kvs_fnc_filelist(), config_kvs_fnc_id(), config_kvs_fnc_keylist(), config_kvs_fnc_open(), config_kvs_fnc_sectionlist(), KviRegisteredUserDataBase::copyFrom(), KviKvsScriptAddonManager::delayedLoad(), KviKvsTreeNodeSwitchList::dump(), KviKvsTreeNodeSwitchList::evaluate(), KviTextIconWindow::fill(), RegisteredUserPropertiesDialog::fillData(), OptionsWidget_textIcons::fillTable(), KviKvsKernel::getAllFunctionsCommandsCore(), KviKvsModuleInterface::getAllFunctionsCommandsModule(), KviSoundPlayer::getAvailableSoundSystems(), HttpFileTransfer::headersReceived(), KviClassEditorDialog::KviClassEditorDialog(), KviKvsHash::KviKvsHash(), KviKvsObjectClass::KviKvsObjectClass(), KviRegisteredChannelDataBase::load(), KviKvsPopupManager::load(), KviCustomToolBarManager::load(), KviKvsAliasManager::load(), KviRegisteredUserDataBase::load(), KviActionManager::load(), KviAvatarCache::load(), KviUserIdentityManager::load(), KviIrcServerDataBase::load(), KviTextIconManager::load(), ClassEditorWidget::loadNotBuiltClasses(), objects_kvs_fnc_classes(), RegisteredUserEntryDialog::okClicked(), ClassEditorWidget::oneTimeSetup(), OptionsWidget_textEncoding::OptionsWidget_textEncoding(), package_kvs_fnc_info(), KviPackageWriter::packInternal(), KviUserListView::partAllButOne(), RegisteredUserEntryDialog::RegisteredUserEntryDialog(), reguser_kvs_cmd_showlist(), KviUserListView::removeAllEntries(), KviConsoleWindow::resetAvatarForMatchingUsers(), KviSharedFilesManager::save(), KviConfigurationFile::save(), KviRegisteredUserDataBase::save(), KviKvsObjectClass::save(), KviAvatarCache::save(), KviTextIconManager::save(), ClassEditorWidget::saveNotBuiltClasses(), KviApplication::saveRecentChannels(), KviMainWindow::saveWindowProperties(), KviKvsHash::serialize(), sharedfile_kvs_cmd_list(), KviWatchNotifyListManager::start(), texticons_kvs_fnc_get(), PluginManager::unloadAll(), and KviModuleExtensionManager::unregisterExtensionsByModule().

template<typename Key, typename T>
bool KviPointerHashTableIterator< Key, T >::moveFirst ( )
inline
template<typename Key, typename T>
bool KviPointerHashTableIterator< Key, T >::moveLast ( )
inline

Moves the iterator to the last element of the hash table.

Returns true in case of success or false if the hash table is empty.

Returns
bool

References KviPointerHashTableIterator< Key, T >::m_pHashTable, KviPointerHashTableIterator< Key, T >::m_pIterator, KviPointerHashTableIterator< Key, T >::m_uEntryIndex, KviPointerListIterator< T >::moveLast(), and NULL.

template<typename Key, typename T>
bool KviPointerHashTableIterator< Key, T >::moveNext ( )
inline
template<typename Key, typename T>
bool KviPointerHashTableIterator< Key, T >::movePrev ( )
inline

Moves the iterator to the previous element of the hash table.

The iterator must be actually valid for this function to work. Returns true in case of success or false if there is no previous item.

Returns
bool

References KviPointerHashTableIterator< Key, T >::m_pHashTable, KviPointerHashTableIterator< Key, T >::m_pIterator, KviPointerHashTableIterator< Key, T >::m_uEntryIndex, KviPointerListIterator< T >::moveLast(), KviPointerListIterator< T >::movePrev(), and NULL.

Referenced by KviPointerHashTableIterator< Key, T >::operator--().

template<typename Key, typename T>
T* KviPointerHashTableIterator< Key, T >::operator* ( ) const
inline

Returs the value pointed by the iterator.

If the iterator is not valid it returns a default constructed value This is an alias to current() with just a different name.

Returns
T *

References KviPointerListIterator< T >::current(), KviPointerHashTableIterator< Key, T >::m_pIterator, and NULL.

template<typename Key, typename T>
bool KviPointerHashTableIterator< Key, T >::operator++ ( )
inline

Moves the iterator to the next element of the hash table.

The iterator must be actually valid for this function to work. Returns true in case of success or false if there is no next item. This is just an alias to moveNext().

Returns
bool

References KviPointerHashTableIterator< Key, T >::moveNext().

template<typename Key, typename T>
bool KviPointerHashTableIterator< Key, T >::operator-- ( )
inline

Moves the iterator to the previous element of the hash table.

The iterator must be actually valid for this function to work. Returns true in case of success or false if there is no previous item. This is just an alias to movePrev() with a different name.

Returns
bool

References KviPointerHashTableIterator< Key, T >::movePrev().

template<typename Key, typename T>
void KviPointerHashTableIterator< Key, T >::operator= ( const KviPointerHashTableIterator< Key, T > &  src)
inline

Creates an iterator copy.

The new iterator points exactly to the item pointed by src.

Parameters
srcThe source pointer to copy from
Returns
void

References KviPointerHashTableIterator< Key, T >::m_pHashTable, KviPointerHashTableIterator< Key, T >::m_pIterator, KviPointerHashTableIterator< Key, T >::m_uEntryIndex, and NULL.

template<typename Key, typename T>
T* KviPointerHashTableIterator< Key, T >::toFirst ( )
inline

Moves the iterator to the first element of the hash table.

Returns the first item found or NULL if the hash table is empty.

Returns
T *

References KviPointerHashTableIterator< Key, T >::current(), KviPointerHashTableIterator< Key, T >::moveFirst(), and NULL.

Referenced by KviAvatarCache::cleanup(), and KviIrcServerDataBase::makeCurrentServer().

Member Data Documentation

template<typename Key, typename T>
const KviPointerHashTable<Key, T>* KviPointerHashTableIterator< Key, T >::m_pHashTable
protected
template<typename Key, typename T>
KviPointerListIterator<KviPointerHashTableEntry<Key, T> >* KviPointerHashTableIterator< Key, T >::m_pIterator
protected
template<typename Key, typename T>
unsigned int KviPointerHashTableIterator< Key, T >::m_uEntryIndex
protected

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