diff options
author | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-04-27 22:07:05 +0000 |
---|---|---|
committer | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-04-27 22:07:05 +0000 |
commit | 355ab976f7145c5df1019138a50913d4e91dd815 (patch) | |
tree | 0b4bbae22cd6275d19ed6f1373c49ce66acc1fc7 | |
parent | 1f0a6d6974c5078ce1619b98cb03f02d61fe059e (diff) | |
download | ATCD-355ab976f7145c5df1019138a50913d4e91dd815.tar.gz |
ChangeLogTag: Thu Apr 27 16:53:49 2000 Irfan Pyarali <irfan@cs.wustl.edu>
-rw-r--r-- | ChangeLog | 51 | ||||
-rw-r--r-- | ChangeLogs/ChangeLog-02a | 51 | ||||
-rw-r--r-- | ChangeLogs/ChangeLog-03a | 51 | ||||
-rw-r--r-- | ace/Hash_Map_Manager_T.cpp | 61 | ||||
-rw-r--r-- | ace/Hash_Map_Manager_T.h | 7 | ||||
-rw-r--r-- | ace/Hash_Map_Manager_T.i | 8 | ||||
-rw-r--r-- | tests/Hash_Map_Manager_Test.cpp | 17 |
7 files changed, 161 insertions, 85 deletions
diff --git a/ChangeLog b/ChangeLog index 27e2c7c3c62..dbc2e971285 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,16 @@ +Thu Apr 27 16:53:49 2000 Irfan Pyarali <irfan@cs.wustl.edu> + + * ace/Hash_Map_Manager_T.cpp (unbind_all_i): Added new method + unbind_all() for removing all the entries in one shot. Thanks + to Boris Sukholitko <boris@WebGlide.com> for providing this + enhancement. + + * tests/Hash_Map_Manager_Test.cpp: Added test for unbind_all(). + Thu Apr 27 14:17:52 2000 Darrell Brunsch <brunsch@uci.edu> - * ace/OS.i: - + * ace/OS.i: + isatty (): Messed up on my CE change, so the version that takes an int was hidden by a ACE_WIN32 block. This has been moved outside again. @@ -13,8 +22,8 @@ Thu Apr 27 14:17:52 2000 Darrell Brunsch <brunsch@uci.edu> Thu Apr 27 13:08:00 2000 Darrell Brunsch <brunsch@uci.edu> - * bin/msvc_auto_compile.pl: - + * bin/msvc_auto_compile.pl: + Changed the code style and made it consistent. Also changed the core build to build all of the orbsvcs and @@ -25,10 +34,10 @@ Thu Apr 27 13:08:00 2000 Darrell Brunsch <brunsch@uci.edu> For some reason, I had trouble with the libraries when the ACE_Cleanup destructor was in the .i file. So I moved it to - the .cpp file instead. + the .cpp file instead. * ace/ace_dll.dsp: - + Was defining ACE_ACE_HAS_DLL=1, which is #1, not needed and, #2, the wrong macro name. @@ -72,28 +81,28 @@ Thu Apr 27 10:55:11 2000 Darrell Brunsch <brunsch@uci.edu> * ace/ace_dll_ce.dsp: (added) * ace/ace_ce_dll.dsp: (removed) * ace/ace_ce.dsw: - + Created a new dsp file from scratch from CE to see how the toolkit sets up the projects. Removed the old one. * ace/ACE.cpp: - + format_hexdump (): Changed usage of isprint to ACE_OS::ace_isprint. - get_ip_interfaces (): Changed use of deprecated ACE_TEXT_STRING to + get_ip_interfaces (): Changed use of deprecated ACE_TEXT_STRING to ACE_TString. Also added an ACE_TEXT_CHAR_TO_TCHAR to a use of the ACE_INET_Addr constructor. * ace/ARGV.cpp: - create_buf_from_queue (): We were not adjusting the size of a + create_buf_from_queue (): We were not adjusting the size of a ACE_TCHAR buffer by sizeof ACE_TCHAR when we did a memcopy. Thanks to Valery Arkhangorodsky <valerya@servicesoft.com> for reporting this. - * ace/Memory_Pool.cpp: + * ace/Memory_Pool.cpp: - seh_selector (): Changed use of LPEXCEPTION_POINTERS to + seh_selector (): Changed use of LPEXCEPTION_POINTERS to EXCEPTION_POINTERS * since it seems like that definition is missing in some WinCE configs. @@ -101,18 +110,18 @@ Thu Apr 27 10:55:11 2000 Darrell Brunsch <brunsch@uci.edu> Added deprecated definition of ACE_TEXT_STRING. - convert (): Changed the conversions from CharToOem to + convert (): Changed the conversions from CharToOem to MultiByteToWideChar, since it is more widely supported in Win32. Also removed the loading of user32.lib since it was only needed for CharToOem. * ace/config-win32-common.h: - Changed the _MT check so it doesn't do anything on CE. Some + Changed the _MT check so it doesn't do anything on CE. Some CE targets do not have the Multithreaded DLL generation option. * ace/config-WinCE.h: - + Changed ACE_DEFAULT_LD_SEARCH_PATH to use ACE_TEXT. Added a define for ACE_HAS_WCHAR and a check to always define @@ -126,11 +135,11 @@ Thu Apr 27 10:55:11 2000 Darrell Brunsch <brunsch@uci.edu> older SDK's. Removed some UNDER_CE < 2.11 defines. < 2.11 CE will not be - supported anymore. + supported anymore. Removed definition of is_print, since it was moved into ACE_OS. - Added a definition for the operator placement new, which is + Added a definition for the operator placement new, which is missing when MFC isn't used. * ace/OS.h: @@ -146,12 +155,12 @@ Thu Apr 27 10:55:11 2000 Darrell Brunsch <brunsch@uci.edu> abort (): changed ::exit to exit to get it to compile. - ace_isspace (): Changed to use ACE_TCHAR, but also made it + ace_isspace (): Changed to use ACE_TCHAR, but also made it NOTSUP on CE 2.11. ace_isprint (): Added, but NOTSUP on CE 2.11. - sema_init (): Needed to cast an void *arg to ACE_mutexattr_t. + sema_init (): Needed to cast an void *arg to ACE_mutexattr_t. dlsym (): Changed the way ACE declares symbolname so it uses the right one on Win32 (WinNT always uses char *, CE always uses @@ -160,7 +169,7 @@ Thu Apr 27 10:55:11 2000 Darrell Brunsch <brunsch@uci.edu> Removed a few global function definitions that were just for CE (like fwrite, fread, getc, etc.). These are either supported - in newer CE's or is disabled in the ACE_OS methods. + in newer CE's or is disabled in the ACE_OS methods. is_atty (): Enabled on CE. @@ -183,7 +192,7 @@ Thu Apr 27 10:55:11 2000 Darrell Brunsch <brunsch@uci.edu> * ace/Svc_Conf.y: * ace/Svc_Conf_y.cpp: - ace_yyerror (): Takes an ACE_TCHAR * instead of char * now. + ace_yyerror (): Takes an ACE_TCHAR * instead of char * now. Thanks to Valery Arkhangorodsky <valerya@servicesoft.com> for also reporting this. diff --git a/ChangeLogs/ChangeLog-02a b/ChangeLogs/ChangeLog-02a index 27e2c7c3c62..dbc2e971285 100644 --- a/ChangeLogs/ChangeLog-02a +++ b/ChangeLogs/ChangeLog-02a @@ -1,7 +1,16 @@ +Thu Apr 27 16:53:49 2000 Irfan Pyarali <irfan@cs.wustl.edu> + + * ace/Hash_Map_Manager_T.cpp (unbind_all_i): Added new method + unbind_all() for removing all the entries in one shot. Thanks + to Boris Sukholitko <boris@WebGlide.com> for providing this + enhancement. + + * tests/Hash_Map_Manager_Test.cpp: Added test for unbind_all(). + Thu Apr 27 14:17:52 2000 Darrell Brunsch <brunsch@uci.edu> - * ace/OS.i: - + * ace/OS.i: + isatty (): Messed up on my CE change, so the version that takes an int was hidden by a ACE_WIN32 block. This has been moved outside again. @@ -13,8 +22,8 @@ Thu Apr 27 14:17:52 2000 Darrell Brunsch <brunsch@uci.edu> Thu Apr 27 13:08:00 2000 Darrell Brunsch <brunsch@uci.edu> - * bin/msvc_auto_compile.pl: - + * bin/msvc_auto_compile.pl: + Changed the code style and made it consistent. Also changed the core build to build all of the orbsvcs and @@ -25,10 +34,10 @@ Thu Apr 27 13:08:00 2000 Darrell Brunsch <brunsch@uci.edu> For some reason, I had trouble with the libraries when the ACE_Cleanup destructor was in the .i file. So I moved it to - the .cpp file instead. + the .cpp file instead. * ace/ace_dll.dsp: - + Was defining ACE_ACE_HAS_DLL=1, which is #1, not needed and, #2, the wrong macro name. @@ -72,28 +81,28 @@ Thu Apr 27 10:55:11 2000 Darrell Brunsch <brunsch@uci.edu> * ace/ace_dll_ce.dsp: (added) * ace/ace_ce_dll.dsp: (removed) * ace/ace_ce.dsw: - + Created a new dsp file from scratch from CE to see how the toolkit sets up the projects. Removed the old one. * ace/ACE.cpp: - + format_hexdump (): Changed usage of isprint to ACE_OS::ace_isprint. - get_ip_interfaces (): Changed use of deprecated ACE_TEXT_STRING to + get_ip_interfaces (): Changed use of deprecated ACE_TEXT_STRING to ACE_TString. Also added an ACE_TEXT_CHAR_TO_TCHAR to a use of the ACE_INET_Addr constructor. * ace/ARGV.cpp: - create_buf_from_queue (): We were not adjusting the size of a + create_buf_from_queue (): We were not adjusting the size of a ACE_TCHAR buffer by sizeof ACE_TCHAR when we did a memcopy. Thanks to Valery Arkhangorodsky <valerya@servicesoft.com> for reporting this. - * ace/Memory_Pool.cpp: + * ace/Memory_Pool.cpp: - seh_selector (): Changed use of LPEXCEPTION_POINTERS to + seh_selector (): Changed use of LPEXCEPTION_POINTERS to EXCEPTION_POINTERS * since it seems like that definition is missing in some WinCE configs. @@ -101,18 +110,18 @@ Thu Apr 27 10:55:11 2000 Darrell Brunsch <brunsch@uci.edu> Added deprecated definition of ACE_TEXT_STRING. - convert (): Changed the conversions from CharToOem to + convert (): Changed the conversions from CharToOem to MultiByteToWideChar, since it is more widely supported in Win32. Also removed the loading of user32.lib since it was only needed for CharToOem. * ace/config-win32-common.h: - Changed the _MT check so it doesn't do anything on CE. Some + Changed the _MT check so it doesn't do anything on CE. Some CE targets do not have the Multithreaded DLL generation option. * ace/config-WinCE.h: - + Changed ACE_DEFAULT_LD_SEARCH_PATH to use ACE_TEXT. Added a define for ACE_HAS_WCHAR and a check to always define @@ -126,11 +135,11 @@ Thu Apr 27 10:55:11 2000 Darrell Brunsch <brunsch@uci.edu> older SDK's. Removed some UNDER_CE < 2.11 defines. < 2.11 CE will not be - supported anymore. + supported anymore. Removed definition of is_print, since it was moved into ACE_OS. - Added a definition for the operator placement new, which is + Added a definition for the operator placement new, which is missing when MFC isn't used. * ace/OS.h: @@ -146,12 +155,12 @@ Thu Apr 27 10:55:11 2000 Darrell Brunsch <brunsch@uci.edu> abort (): changed ::exit to exit to get it to compile. - ace_isspace (): Changed to use ACE_TCHAR, but also made it + ace_isspace (): Changed to use ACE_TCHAR, but also made it NOTSUP on CE 2.11. ace_isprint (): Added, but NOTSUP on CE 2.11. - sema_init (): Needed to cast an void *arg to ACE_mutexattr_t. + sema_init (): Needed to cast an void *arg to ACE_mutexattr_t. dlsym (): Changed the way ACE declares symbolname so it uses the right one on Win32 (WinNT always uses char *, CE always uses @@ -160,7 +169,7 @@ Thu Apr 27 10:55:11 2000 Darrell Brunsch <brunsch@uci.edu> Removed a few global function definitions that were just for CE (like fwrite, fread, getc, etc.). These are either supported - in newer CE's or is disabled in the ACE_OS methods. + in newer CE's or is disabled in the ACE_OS methods. is_atty (): Enabled on CE. @@ -183,7 +192,7 @@ Thu Apr 27 10:55:11 2000 Darrell Brunsch <brunsch@uci.edu> * ace/Svc_Conf.y: * ace/Svc_Conf_y.cpp: - ace_yyerror (): Takes an ACE_TCHAR * instead of char * now. + ace_yyerror (): Takes an ACE_TCHAR * instead of char * now. Thanks to Valery Arkhangorodsky <valerya@servicesoft.com> for also reporting this. diff --git a/ChangeLogs/ChangeLog-03a b/ChangeLogs/ChangeLog-03a index 27e2c7c3c62..dbc2e971285 100644 --- a/ChangeLogs/ChangeLog-03a +++ b/ChangeLogs/ChangeLog-03a @@ -1,7 +1,16 @@ +Thu Apr 27 16:53:49 2000 Irfan Pyarali <irfan@cs.wustl.edu> + + * ace/Hash_Map_Manager_T.cpp (unbind_all_i): Added new method + unbind_all() for removing all the entries in one shot. Thanks + to Boris Sukholitko <boris@WebGlide.com> for providing this + enhancement. + + * tests/Hash_Map_Manager_Test.cpp: Added test for unbind_all(). + Thu Apr 27 14:17:52 2000 Darrell Brunsch <brunsch@uci.edu> - * ace/OS.i: - + * ace/OS.i: + isatty (): Messed up on my CE change, so the version that takes an int was hidden by a ACE_WIN32 block. This has been moved outside again. @@ -13,8 +22,8 @@ Thu Apr 27 14:17:52 2000 Darrell Brunsch <brunsch@uci.edu> Thu Apr 27 13:08:00 2000 Darrell Brunsch <brunsch@uci.edu> - * bin/msvc_auto_compile.pl: - + * bin/msvc_auto_compile.pl: + Changed the code style and made it consistent. Also changed the core build to build all of the orbsvcs and @@ -25,10 +34,10 @@ Thu Apr 27 13:08:00 2000 Darrell Brunsch <brunsch@uci.edu> For some reason, I had trouble with the libraries when the ACE_Cleanup destructor was in the .i file. So I moved it to - the .cpp file instead. + the .cpp file instead. * ace/ace_dll.dsp: - + Was defining ACE_ACE_HAS_DLL=1, which is #1, not needed and, #2, the wrong macro name. @@ -72,28 +81,28 @@ Thu Apr 27 10:55:11 2000 Darrell Brunsch <brunsch@uci.edu> * ace/ace_dll_ce.dsp: (added) * ace/ace_ce_dll.dsp: (removed) * ace/ace_ce.dsw: - + Created a new dsp file from scratch from CE to see how the toolkit sets up the projects. Removed the old one. * ace/ACE.cpp: - + format_hexdump (): Changed usage of isprint to ACE_OS::ace_isprint. - get_ip_interfaces (): Changed use of deprecated ACE_TEXT_STRING to + get_ip_interfaces (): Changed use of deprecated ACE_TEXT_STRING to ACE_TString. Also added an ACE_TEXT_CHAR_TO_TCHAR to a use of the ACE_INET_Addr constructor. * ace/ARGV.cpp: - create_buf_from_queue (): We were not adjusting the size of a + create_buf_from_queue (): We were not adjusting the size of a ACE_TCHAR buffer by sizeof ACE_TCHAR when we did a memcopy. Thanks to Valery Arkhangorodsky <valerya@servicesoft.com> for reporting this. - * ace/Memory_Pool.cpp: + * ace/Memory_Pool.cpp: - seh_selector (): Changed use of LPEXCEPTION_POINTERS to + seh_selector (): Changed use of LPEXCEPTION_POINTERS to EXCEPTION_POINTERS * since it seems like that definition is missing in some WinCE configs. @@ -101,18 +110,18 @@ Thu Apr 27 10:55:11 2000 Darrell Brunsch <brunsch@uci.edu> Added deprecated definition of ACE_TEXT_STRING. - convert (): Changed the conversions from CharToOem to + convert (): Changed the conversions from CharToOem to MultiByteToWideChar, since it is more widely supported in Win32. Also removed the loading of user32.lib since it was only needed for CharToOem. * ace/config-win32-common.h: - Changed the _MT check so it doesn't do anything on CE. Some + Changed the _MT check so it doesn't do anything on CE. Some CE targets do not have the Multithreaded DLL generation option. * ace/config-WinCE.h: - + Changed ACE_DEFAULT_LD_SEARCH_PATH to use ACE_TEXT. Added a define for ACE_HAS_WCHAR and a check to always define @@ -126,11 +135,11 @@ Thu Apr 27 10:55:11 2000 Darrell Brunsch <brunsch@uci.edu> older SDK's. Removed some UNDER_CE < 2.11 defines. < 2.11 CE will not be - supported anymore. + supported anymore. Removed definition of is_print, since it was moved into ACE_OS. - Added a definition for the operator placement new, which is + Added a definition for the operator placement new, which is missing when MFC isn't used. * ace/OS.h: @@ -146,12 +155,12 @@ Thu Apr 27 10:55:11 2000 Darrell Brunsch <brunsch@uci.edu> abort (): changed ::exit to exit to get it to compile. - ace_isspace (): Changed to use ACE_TCHAR, but also made it + ace_isspace (): Changed to use ACE_TCHAR, but also made it NOTSUP on CE 2.11. ace_isprint (): Added, but NOTSUP on CE 2.11. - sema_init (): Needed to cast an void *arg to ACE_mutexattr_t. + sema_init (): Needed to cast an void *arg to ACE_mutexattr_t. dlsym (): Changed the way ACE declares symbolname so it uses the right one on Win32 (WinNT always uses char *, CE always uses @@ -160,7 +169,7 @@ Thu Apr 27 10:55:11 2000 Darrell Brunsch <brunsch@uci.edu> Removed a few global function definitions that were just for CE (like fwrite, fread, getc, etc.). These are either supported - in newer CE's or is disabled in the ACE_OS methods. + in newer CE's or is disabled in the ACE_OS methods. is_atty (): Enabled on CE. @@ -183,7 +192,7 @@ Thu Apr 27 10:55:11 2000 Darrell Brunsch <brunsch@uci.edu> * ace/Svc_Conf.y: * ace/Svc_Conf_y.cpp: - ace_yyerror (): Takes an ACE_TCHAR * instead of char * now. + ace_yyerror (): Takes an ACE_TCHAR * instead of char * now. Thanks to Valery Arkhangorodsky <valerya@servicesoft.com> for also reporting this. diff --git a/ace/Hash_Map_Manager_T.cpp b/ace/Hash_Map_Manager_T.cpp index af8265ddccd..870a3c92488 100644 --- a/ace/Hash_Map_Manager_T.cpp +++ b/ace/Hash_Map_Manager_T.cpp @@ -42,7 +42,7 @@ ACE_RCSID(ace, Hash_Map_Manager_T, "$Id$") -template <class EXT_ID, class INT_ID> +template <class EXT_ID, class INT_ID> ACE_Hash_Map_Entry<EXT_ID, INT_ID>::ACE_Hash_Map_Entry (ACE_Hash_Map_Entry<EXT_ID, INT_ID> *next, ACE_Hash_Map_Entry<EXT_ID, INT_ID> *prev) : next_ (next), @@ -50,7 +50,7 @@ ACE_Hash_Map_Entry<EXT_ID, INT_ID>::ACE_Hash_Map_Entry (ACE_Hash_Map_Entry<EXT_I { } -template <class EXT_ID, class INT_ID> +template <class EXT_ID, class INT_ID> ACE_Hash_Map_Entry<EXT_ID, INT_ID>::ACE_Hash_Map_Entry (const EXT_ID &ext_id, const INT_ID &int_id, ACE_Hash_Map_Entry<EXT_ID, INT_ID> *next, @@ -63,7 +63,7 @@ ACE_Hash_Map_Entry<EXT_ID, INT_ID>::ACE_Hash_Map_Entry (const EXT_ID &ext_id, } # if ! defined (ACE_HAS_BROKEN_NOOP_DTORS) -template <class EXT_ID, class INT_ID> +template <class EXT_ID, class INT_ID> ACE_Hash_Map_Entry<EXT_ID, INT_ID>::~ACE_Hash_Map_Entry (void) { } @@ -143,37 +143,56 @@ ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>::close // gets called. if (this->table_ != 0) { - // Iterate through the entire map calling the destuctor of each - // <ACE_Hash_Map_Entry>. + // Remove all the entries. + this->unbind_all_i (); + + // Iterate through the buckets cleaning up the sentinels. for (size_t i = 0; i < this->total_size_; i++) { - for (ACE_Hash_Map_Entry<EXT_ID, INT_ID> *temp_ptr = this->table_[i].next_; - temp_ptr != &this->table_[i]; - ) - { - ACE_Hash_Map_Entry<EXT_ID, INT_ID> *hold_ptr = temp_ptr; - temp_ptr = temp_ptr->next_; - - // Explicitly call the destructor. - ACE_DES_FREE_TEMPLATE2 (hold_ptr, this->allocator_->free, - ACE_Hash_Map_Entry, EXT_ID, INT_ID); - } - // Destroy the dummy entry. - ACE_Hash_Map_Entry<EXT_ID, INT_ID> *entry = &table_[i]; + ACE_Hash_Map_Entry<EXT_ID, INT_ID> *entry = &this->table_[i]; // The "if" second argument results in a no-op instead of // deallocation. ACE_DES_FREE_TEMPLATE2 (entry, ACE_NOOP, ACE_Hash_Map_Entry, EXT_ID, INT_ID); } - // Free table memory. - this->allocator_->free (this->table_); - this->cur_size_ = 0; + // Reset size. this->total_size_ = 0; + // Should be done last... this->table_ = 0; } + + return 0; +} + +template <class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK> int +ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>::unbind_all_i (void) +{ + // Iterate through the entire map calling the destuctor of each + // <ACE_Hash_Map_Entry>. + for (size_t i = 0; i < this->total_size_; i++) + { + for (ACE_Hash_Map_Entry<EXT_ID, INT_ID> *temp_ptr = this->table_[i].next_; + temp_ptr != &this->table_[i]; + ) + { + ACE_Hash_Map_Entry<EXT_ID, INT_ID> *hold_ptr = temp_ptr; + temp_ptr = temp_ptr->next_; + + // Explicitly call the destructor. + ACE_DES_FREE_TEMPLATE2 (hold_ptr, this->allocator_->free, + ACE_Hash_Map_Entry, EXT_ID, INT_ID); + } + + // Restore the sentinel. + this->table_[i].next_ = &this->table_[i]; + this->table_[i].prev_ = &this->table_[i]; + } + + this->cur_size_ = 0; + return 0; } diff --git a/ace/Hash_Map_Manager_T.h b/ace/Hash_Map_Manager_T.h index 0d72060380a..41f27e68c29 100644 --- a/ace/Hash_Map_Manager_T.h +++ b/ace/Hash_Map_Manager_T.h @@ -140,6 +140,9 @@ public: // Close down a <Hash_Map_Manager_Ex> and release dynamically allocated // resources. + int unbind_all (void); + // Removes all the entries in <Map_Manager_Ex>. + ~ACE_Hash_Map_Manager_Ex (void); // Initialize a <Hash_Map_Manager_Ex> with size <length>. @@ -375,6 +378,10 @@ protected: // Close down a <Map_Manager_Ex>. Must be called with // locks held. + int unbind_all_i (void); + // Removes all the entries in <Map_Manager_Ex>. Must be called with + // locks held. + ACE_Allocator *allocator_; // Pointer to a memory allocator. diff --git a/ace/Hash_Map_Manager_T.i b/ace/Hash_Map_Manager_T.i index 101caf9389b..db517f15678 100644 --- a/ace/Hash_Map_Manager_T.i +++ b/ace/Hash_Map_Manager_T.i @@ -33,6 +33,14 @@ ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>::close return this->close_i (); } +template <class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK> ACE_INLINE int +ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>::unbind_all (void) +{ + ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); + + return this->unbind_all_i (); +} + template <class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK> ACE_INLINE ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>::~ACE_Hash_Map_Manager_Ex (void) { diff --git a/tests/Hash_Map_Manager_Test.cpp b/tests/Hash_Map_Manager_Test.cpp index a346686f92a..3328b942921 100644 --- a/tests/Hash_Map_Manager_Test.cpp +++ b/tests/Hash_Map_Manager_Test.cpp @@ -27,7 +27,7 @@ ACE_RCSID(tests, Hash_Map_Manager_Test, "$Id$") -static const size_t STRING_TABLE_ENTRIES = 3; +static const size_t STRING_TABLE_ENTRIES = 3 * 2; static const size_t MAX_HASH = 6; typedef ACE_Hash_Map_Entry<const ACE_TCHAR *, @@ -202,6 +202,21 @@ run_test (void) } } + // Remove all the entries. + if (hash.unbind_all () != 0) + ACE_ERROR_RETURN ((LM_ERROR, + ASYS_TEXT ("unbind_all failed\n")), + -1); + + // Redo the <bind> operations. + for (i = 0; string_table[i].key_ != 0; i++) + if (hash.bind (string_table[i].key_, + string_table[i].value_) != 0) + ACE_ERROR_RETURN ((LM_ERROR, + ASYS_TEXT ("%p failed for %s \n"), + ASYS_TEXT ("bind"), + ASYS_MULTIBYTE_STRING (string_table[i].key_)), -1); + alloc.dump (); return 0; } |