1
/* Copyright (C) 2003 MySQL AB
3
This program is free software; you can redistribute it and/or modify
4
it under the terms of the GNU General Public License as published by
5
the Free Software Foundation; version 2 of the License.
7
This program is distributed in the hope that it will be useful,
8
but WITHOUT ANY WARRANTY; without even the implied warranty of
9
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
GNU General Public License for more details.
12
You should have received a copy of the GNU General Public License
13
along with this program; if not, write to the Free Software
14
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
16
#ifndef DLC_HASHTABLE_HPP
17
#define DLC_HASHTABLE_HPP
19
#include <ndb_global.h>
20
#include "DLHashTable.hpp"
22
// Adds "count" to DLHashTable
23
template <class T, class U = T>
24
class DLCHashTable : public DLHashTable<T, U> {
27
DLCHashTable(ArrayPool<T> & thePool) :
28
DLHashTable<T, U>(thePool),
33
Uint32 count() const { return m_count; }
35
// Redefine methods which do add or remove
37
void add(Ptr<T>& ptr) {
38
DLHashTable<T, U>::add(ptr);
42
void remove(Ptr<T>& ptr, const T & key) {
43
DLHashTable<T, U>::remove(ptr, key);
47
void remove(Uint32 i) {
48
DLHashTable<T, U>::remove(i);
52
void remove(Ptr<T>& ptr) {
53
DLHashTable<T, U>::remove(ptr);
58
DLHashTable<T, U>::removeAll();
62
void release(Ptr<T>& ptr, const T & key) {
63
DLHashTable<T, U>::release(ptr, key);
67
void release(Uint32 i) {
68
DLHashTable<T, U>::release(i);
72
void release(Ptr<T>& ptr) {
73
DLHashTable<T, U>::release(ptr);