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

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

◆ KviPointerHashTableIterator()

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

◆ ~KviPointerHashTableIterator()

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

Destroys the iterator.

References KviPointerHashTableIterator< Key, T >::m_pIterator.

Member Function Documentation

◆ current()

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

Returns 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(), and KviPointerHashTableIterator< Key, T >::m_pIterator.

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::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(), KviKvsVariant::convertToArray(), KviRegisteredUserDataBase::copyFrom(), KviUserIdentityManager::copyFrom(), ClassEditorWidget::createFullClass(), KviCustomToolBarManager::createToolBarsVisibleAtStartup(), dcc_kvs_fnc_sessionList(), KviUserIdentityManager::defaultIdentity(), KviKvsScriptAddonManager::delayedLoad(), KviActionManager::delayedRegisterAccelerators(), KviKvsTimerManager::deleteAllTimers(), KviKvsTreeNodeSwitchList::dump(), KviKvsTreeNodeSwitchList::evaluate(), KviActionDrawer::fill(), KviTextIconWindow::fill(), RegisteredUserPropertiesDialog::fillData(), SharedFilesWindow::fillFileView(), AddonManagementDialog::fillListView(), OptionsWidget_servers::fillServerList(), OptionsWidget_textIcons::fillTable(), KviMainWindow::fillToolBarsPopup(), KviCustomToolBarManager::findDescriptorByInternalId(), KviCustomToolBarManager::firstExistingToolBar(), KviKvsObjectController::flushUserClasses(), KviKvsKernel::getAllFunctionsCommandsCore(), KviKvsModuleInterface::getAllFunctionsCommandsModule(), KviSoundPlayer::getAvailableSoundSystems(), KviModuleManager::hasLockedModules(), HttpFileTransfer::headersReceived(), ListWindow::importList(), KviActionManager::killAllKvsUserActions(), KviClassEditorDialog::KviClassEditorDialog(), KviKvsHash::KviKvsHash(), KviKvsObjectClass::KviKvsObjectClass(), KviKvsCoreSimpleCommands::KVSCSC(), KviActionManager::listActionsByCategory(), KviRegisteredUserDataBase::load(), KviKvsAliasManager::load(), KviKvsPopupManager::load(), KviRegisteredChannelDataBase::load(), KviAvatarCache::load(), KviIrcServerDataBase::load(), KviUserIdentityManager::load(), KviActionManager::load(), KviCustomToolBarManager::load(), KviTextIconManager::load(), ClassEditorWidget::loadNotBuiltClasses(), KviIrcServerDataBase::makeCurrentServer(), KviUserListViewArea::mousePressEvent(), KviNotifyListManager::notifyOffLine(), KviNotifyListManager::notifyOnLine(), objects_kvs_fnc_classAllHandlers(), objects_kvs_fnc_classes(), objects_kvs_fnc_instances(), objects_kvs_fnc_variables(), RegisteredUserEntryDialog::okClicked(), AliasEditorWidget::oneTimeSetup(), ClassEditorWidget::oneTimeSetup(), PopupEditorWidget::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(), KviConfigurationFile::save(), KviRegisteredUserDataBase::save(), KviSharedFilesManager::save(), KviKvsAliasManager::save(), KviKvsPopupManager::save(), KviAvatarCache::save(), KviIrcServerDataBase::save(), KviUserIdentityManager::save(), KviActionManager::save(), KviCustomToolBarManager::save(), KviTextIconManager::save(), KviKvsScriptAddonManager::save(), KviKvsObjectClass::save(), ClassEditorWidget::saveNotBuiltClasses(), KviApplication::saveRecentChannels(), KviMainWindow::saveWindowProperties(), ClassEditorWidget::searchInheritedClasses(), ClassEditorWidget::searchReplace(), KviUserListView::select(), KviKvsHash::serialize(), serverdb_kvs_fnc_serverExists(), KviMainWindow::setButtonStyle(), KviMainWindow::setIconSize(), sharedfile_kvs_cmd_list(), SingleActionEditor::SingleActionEditor(), KviCustomToolBarManager::storeVisibilityState(), texticons_kvs_fnc_get(), KviPointerHashTableIterator< Key, T >::toFirst(), toolbar_kvs_fnc_list(), PluginManager::unloadAll(), KviModuleManager::unloadAllModules(), KviModuleExtensionManager::unregisterExtensionsByModule(), KviCustomToolBarManager::updateVisibleToolBars(), KviCustomToolBarManager::visibleToolBarCount(), and KviActionManager::~KviActionManager().

◆ currentKey()

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

Returns 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(), and KviPointerHashTableIterator< Key, T >::m_pIterator.

Referenced by 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(), ClassEditorWidget::createFullClass(), KviKvsScriptAddonManager::delayedLoad(), KviKvsTreeNodeSwitchList::dump(), KviKvsTreeNodeSwitchList::evaluate(), KviTextIconWindow::fill(), RegisteredUserPropertiesDialog::fillData(), OptionsWidget_textIcons::fillTable(), KviKvsKernel::getAllFunctionsCommandsCore(), KviKvsModuleInterface::getAllFunctionsCommandsModule(), KviSoundPlayer::getAvailableSoundSystems(), HttpFileTransfer::headersReceived(), ListWindow::importList(), KviClassEditorDialog::KviClassEditorDialog(), KviKvsHash::KviKvsHash(), KviKvsObjectClass::KviKvsObjectClass(), KviRegisteredUserDataBase::load(), KviKvsAliasManager::load(), KviKvsPopupManager::load(), KviRegisteredChannelDataBase::load(), KviAvatarCache::load(), KviIrcServerDataBase::load(), KviUserIdentityManager::load(), KviActionManager::load(), KviCustomToolBarManager::load(), KviTextIconManager::load(), ClassEditorWidget::loadNotBuiltClasses(), objects_kvs_fnc_classAllHandlers(), objects_kvs_fnc_classes(), objects_kvs_fnc_variables(), 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(), KviConfigurationFile::save(), KviRegisteredUserDataBase::save(), KviSharedFilesManager::save(), KviAvatarCache::save(), KviTextIconManager::save(), KviKvsObjectClass::save(), ClassEditorWidget::saveNotBuiltClasses(), KviApplication::saveRecentChannels(), KviMainWindow::saveWindowProperties(), KviKvsHash::serialize(), sharedfile_kvs_cmd_list(), texticons_kvs_fnc_get(), PluginManager::unloadAll(), and KviModuleExtensionManager::unregisterExtensionsByModule().

◆ moveFirst()

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

◆ moveLast()

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, and KviPointerListIterator< T >::moveLast().

◆ moveNext()

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

◆ movePrev()

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(), and KviPointerListIterator< T >::movePrev().

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

◆ operator*()

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

Returns 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(), and KviPointerHashTableIterator< Key, T >::m_pIterator.

◆ operator++()

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().

◆ operator--()

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().

◆ operator=()

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, and KviPointerHashTableIterator< Key, T >::m_uEntryIndex.

◆ toFirst()

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 nullptr if the hash table is empty.

Returns
T *

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

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

Member Data Documentation

◆ m_pHashTable

template<typename Key , typename T >
const KviPointerHashTable<Key, T>* KviPointerHashTableIterator< Key, T >::m_pHashTable
protected

◆ m_pIterator

template<typename Key , typename T >
KviPointerListIterator<KviPointerHashTableEntry<Key, T> >* KviPointerHashTableIterator< Key, T >::m_pIterator
protected

◆ m_uEntryIndex

template<typename Key , typename T >
unsigned int KviPointerHashTableIterator< Key, T >::m_uEntryIndex
protected

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