From da122f52d566e22ae46f5de6b40c998755e6a3cc Mon Sep 17 00:00:00 2001 From: PeiYong Zhang <peiyongz@apache.org> Date: Fri, 17 Oct 2003 21:10:40 +0000 Subject: [PATCH] nextElementKey() added git-svn-id: https://svn.apache.org/repos/asf/xerces/c/trunk@175287 13f79535-47bb-0310-9956-ffa450edef68 --- src/xercesc/util/RefHash2KeysTableOf.c | 21 +++++++++++++++++++++ src/xercesc/util/RefHash2KeysTableOf.hpp | 7 +++++++ 2 files changed, 28 insertions(+) diff --git a/src/xercesc/util/RefHash2KeysTableOf.c b/src/xercesc/util/RefHash2KeysTableOf.c index 40a0032b0..c0262a2c3 100644 --- a/src/xercesc/util/RefHash2KeysTableOf.c +++ b/src/xercesc/util/RefHash2KeysTableOf.c @@ -56,6 +56,9 @@ /** * $Log$ + * Revision 1.5 2003/10/17 21:10:40 peiyongz + * nextElementKey() added + * * Revision 1.4 2003/05/18 14:02:05 knoaman * Memory manager implementation: pass per instance manager. * @@ -438,6 +441,24 @@ template <class TVal> TVal& RefHash2KeysTableOfEnumerator<TVal>::nextElement() return *saveElem->fData; } +template <class TVal> void RefHash2KeysTableOfEnumerator<TVal>::nextElementKey(void*& retKey1, int& retKey2) +{ + // Make sure we have an element to return + if (!hasMoreElements()) + ThrowXML(NoSuchElementException, XMLExcepts::Enum_NoMoreElements); + + // + // Save the current element, then move up to the next one for the + // next time around. + // + RefHash2KeysTableBucketElem<TVal>* saveElem = fCurElem; + findNext(); + + retKey1 = saveElem->fKey1; + retKey2 = saveElem->fKey2; + + return; +} template <class TVal> void RefHash2KeysTableOfEnumerator<TVal>::Reset() { diff --git a/src/xercesc/util/RefHash2KeysTableOf.hpp b/src/xercesc/util/RefHash2KeysTableOf.hpp index da5457975..f819b7250 100644 --- a/src/xercesc/util/RefHash2KeysTableOf.hpp +++ b/src/xercesc/util/RefHash2KeysTableOf.hpp @@ -56,6 +56,9 @@ /* * $Log$ + * Revision 1.6 2003/10/17 21:10:40 peiyongz + * nextElementKey() added + * * Revision 1.5 2003/05/18 14:02:05 knoaman * Memory manager implementation: pass per instance manager. * @@ -253,6 +256,10 @@ public : TVal& nextElement(); void Reset(); + // ----------------------------------------------------------------------- + // New interface + // ----------------------------------------------------------------------- + void nextElementKey(void*&, int&); private : // ----------------------------------------------------------------------- -- GitLab