summaryrefslogtreecommitdiff
path: root/soltools/ldump
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2006-06-20 04:08:26 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2006-06-20 04:08:26 +0000
commitfdb5c297234f57e4acb4e7fb6af64ca8ae525db0 (patch)
treeaa7b27ce8b1012891fc66a296c5ba5c9f5abaebb /soltools/ldump
parent572da484bdf8200cd34e0b3ed3d5b99a581b7cd4 (diff)
INTEGRATION: CWS warnings01 (1.1.146); FILE MERGED
2005/09/23 02:15:06 sb 1.1.146.2: RESYNC: (1.1-1.2); FILE MERGED 2005/09/02 14:57:36 sb 1.1.146.1: #i53898# Made code warning-free.
Diffstat (limited to 'soltools/ldump')
-rw-r--r--soltools/ldump/hashtbl.hxx88
1 files changed, 5 insertions, 83 deletions
diff --git a/soltools/ldump/hashtbl.hxx b/soltools/ldump/hashtbl.hxx
index 2c472ac11161..6a13b5bd90af 100644
--- a/soltools/ldump/hashtbl.hxx
+++ b/soltools/ldump/hashtbl.hxx
@@ -4,9 +4,9 @@
*
* $RCSfile: hashtbl.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: rt $ $Date: 2005-09-08 07:28:12 $
+ * last change: $Author: hr $ $Date: 2006-06-20 05:08:26 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -82,7 +82,7 @@ public:
double dGrowFactor = HashTable::m_defDefGrowFactor /* 2.0 */
);
- ~HashTable();
+ virtual ~HashTable();
bool IsFull() const;
unsigned long GetSize() const { return m_lSize; }
@@ -101,6 +101,8 @@ class HashTableIterator
unsigned long m_lAt;
HashTable const& m_aTable;
+ void operator =(HashTableIterator &); // not defined
+
void* FindValidObject(bool bForward);
protected:
@@ -113,85 +115,5 @@ public:
HashTableIterator(HashTable const&);
};
-// typsichere Makros ---------------------------------------------------
-
-#define DECLARE_HASHTABLE_INTERN(ClassName,Owner,KeyType,ObjType) \
- class ClassName : public HashTable \
- { \
- public: \
- ClassName \
- ( \
- unsigned long lSize, \
- double dMaxLoadFactor = HashTable::m_defMaxLoadFactor, \
- double dGrowFactor = HashTable::m_defDefGrowFactor \
- ) \
- : HashTable(lSize,Owner,dMaxLoadFactor,dGrowFactor) {} \
- \
- ObjType Find (KeyType const& Key) const \
- { return (ObjType) HashTable::Find((char *) Key); } \
- \
- bool Insert (KeyType const& Key, ObjType Object) \
- { return HashTable::Insert((char *) Key, (void*) Object); } \
- \
- ObjType Delete (KeyType const&Key) \
- { return (ObjType) HashTable::Delete ((char *) Key); } \
- };
-
-// HashTable OHNE Owner-Verhalten
-#define DECLARE_HASHTABLE(ClassName,KeyType,ObjType) \
- DECLARE_HASHTABLE_INTERN(ClassName,false,KeyType,ObjType)
-
-// HashTable MIT Owner-Verhalten
-#define DECLARE_HASHTABLE_OWNER(ClassName,KeyType,ObjType) \
- DECLARE_HASHTABLE_INTERN(ClassName##2,true,KeyType,ObjType) \
- class ClassName : public ClassName##2 \
- { \
- protected: \
- virtual void OnDeleteObject(void* pObject); \
- public: \
- ClassName \
- ( \
- unsigned long lSize, \
- double dMaxLoadFactor = HashTable::m_defMaxLoadFactor, \
- double dGrowFactor = HashTable::m_defDefGrowFactor \
- ) \
- : ClassName##2(lSize,dMaxLoadFactor,dGrowFactor) {} \
- ~ClassName(); \
- };
-
-#define IMPLEMENT_HASHTABLE_OWNER(ClassName,KeyType,ObjType) \
- void ClassName::OnDeleteObject(void* pObject) \
- { delete (ObjType) pObject; } \
- \
- ClassName::~ClassName() \
- { \
- for (unsigned long i=0; i<GetSize(); i++) \
- { \
- void *pObject = GetObjectAt(i); \
- if (pObject != NULL) \
- OnDeleteObject(pObject); \
- } \
- }
-
-// Iterator-Makros --------------------------------------------------
-
-#define DECLARE_HASHTABLE_ITERATOR(ClassName,ObjType) \
- class ClassName : public HashTableIterator \
- { \
- public: \
- ClassName(HashTable const& aTable) \
- : HashTableIterator(aTable) {} \
- \
- ObjType GetFirst() \
- { return (ObjType)HashTableIterator::GetFirst(); } \
- ObjType GetNext() \
- { return (ObjType)HashTableIterator::GetNext(); } \
- ObjType GetLast() \
- { return (ObjType)HashTableIterator::GetLast(); } \
- ObjType GetPrev() \
- { return (ObjType)HashTableIterator::GetPrev(); } \
- };
-
-
#endif // _HASHTBL_HXX