summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorirfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-10-01 05:22:07 +0000
committerirfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-10-01 05:22:07 +0000
commitbbfa5c154d99fb27533aedbcc73af69758fcd8d2 (patch)
tree9df636de531f4a6c2ff75b35d1aeb8ea2de314cf
parentd10a3bebd943b4b1ae4ddc0113be136d4a82f2f8 (diff)
downloadATCD-bbfa5c154d99fb27533aedbcc73af69758fcd8d2.tar.gz
*** empty log message ***
-rw-r--r--ChangeLog-98b13
-rw-r--r--TAO/ChangeLog-98c6
-rw-r--r--TAO/tao/ORB_Core.cpp20
-rw-r--r--TAO/tao/ORB_Core.h24
-rw-r--r--ace/Addr.h4
-rw-r--r--ace/Addr.i6
-rw-r--r--ace/INET_Addr.h3
-rw-r--r--ace/INET_Addr.i6
-rw-r--r--tests/Conn_Test.cpp13
9 files changed, 49 insertions, 46 deletions
diff --git a/ChangeLog-98b b/ChangeLog-98b
index e9c444fad8f..8fd0d7eebbf 100644
--- a/ChangeLog-98b
+++ b/ChangeLog-98b
@@ -1,3 +1,16 @@
+Thu Oct 01 00:09:35 1998 Irfan Pyarali <irfan@cs.wustl.edu>
+
+ * tests/Conn_Test: Removed template specialization for
+ INET_Addr.hash().
+
+ * ace/Addr.i (hash):
+ * ace/INET_Addr.i (hash):
+
+ Finally gave up with template specialization hell and freak'in
+ broken compilers and simply added a hash() method to ACE_Addr
+ and ACE_INET_Addr. ACE_Addr::hash() simply return 0 and should
+ be overwritten by subclasses that can provide better hashing.
+
Wed Sep 30 10:16:56 1998 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu>
* ace/ACE.cpp: Modified max_handles() so that it goes the right
diff --git a/TAO/ChangeLog-98c b/TAO/ChangeLog-98c
index 4b0d1fdcc97..e6bc322f54e 100644
--- a/TAO/ChangeLog-98c
+++ b/TAO/ChangeLog-98c
@@ -1,3 +1,9 @@
+Thu Oct 01 00:17:17 1998 Irfan Pyarali <irfan@cs.wustl.edu>
+
+ * tao/ORB_Core.h: Removed template specialization for
+ INET_Addr.hash(). Also changed/fixed explicit template
+ instantiations.
+x
Wed Sep 30 15:47:26 1998 Carlos O'Ryan <coryan@cs.wustl.edu>
* tao/Connect.h:
diff --git a/TAO/tao/ORB_Core.cpp b/TAO/tao/ORB_Core.cpp
index aecae81fd2d..726a81ff68e 100644
--- a/TAO/tao/ORB_Core.cpp
+++ b/TAO/tao/ORB_Core.cpp
@@ -1535,11 +1535,11 @@ template class ACE_TSS<TAO_Resource_Factory::Pre_Allocated>;
template class ACE_Singleton<TAO_Resource_Factory::App_Allocated, ACE_SYNCH_MUTEX>;
template class ACE_TSS_Singleton<TAO_Resource_Factory::App_Allocated, ACE_SYNCH_MUTEX>;
template class ACE_TSS<TAO_Resource_Factory::App_Allocated>;
-template class ACE_Hash_Map_Manager<ACE_Hash_Addr<ACE_INET_Addr>, TAO_POA *, TAO_Collocation_Table_Lock>;
-template class ACE_Hash_Map_Entry<ACE_Hash_Addr<ACE_INET_Addr>, TAO_POA *>;
-template class ACE_Hash_Map_Iterator_Base<ACE_Hash_Addr<ACE_INET_Addr>, TAO_POA *, TAO_Collocation_Table_Lock>;
-template class ACE_Hash_Map_Iterator<ACE_Hash_Addr<ACE_INET_Addr>, TAO_POA *, TAO_Collocation_Table_Lock>;
-template class ACE_Hash_Map_Reverse_Iterator<ACE_Hash_Addr<ACE_INET_Addr>, TAO_POA *, TAO_Collocation_Table_Lock>;
+template class ACE_Hash_Map_Manager<ACE_INET_Addr, TAO_POA *, TAO_Collocation_Table_Lock>;
+template class ACE_Hash_Map_Entry<ACE_INET_Addr, TAO_POA *>;
+template class ACE_Hash_Map_Iterator_Base<ACE_INET_Addr, TAO_POA *, TAO_Collocation_Table_Lock>;
+template class ACE_Hash_Map_Iterator<ACE_INET_Addr, TAO_POA *, TAO_Collocation_Table_Lock>;
+template class ACE_Hash_Map_Reverse_Iterator<ACE_INET_Addr, TAO_POA *, TAO_Collocation_Table_Lock>;
template class ACE_Guard<TAO_Collocation_Table_Lock>;
template class ACE_Read_Guard<TAO_Collocation_Table_Lock>;
template class ACE_Write_Guard<TAO_Collocation_Table_Lock>;
@@ -1587,11 +1587,11 @@ template class ACE_Select_Reactor_T< ACE_Select_Reactor_Token_T<ACE_Noop_Token>
#pragma instantiate ACE_Singleton<TAO_Resource_Factory::App_Allocated, ACE_SYNCH_MUTEX>
#pragma instantiate ACE_TSS_Singleton<TAO_Resource_Factory::App_Allocated, ACE_SYNCH_MUTEX>
#pragma instantiate ACE_TSS<TAO_Resource_Factory::App_Allocated>
-#pragma instantiate ACE_Hash_Map_Manager<ACE_Hash_Addr<ACE_INET_Addr>, TAO_POA *, TAO_Collocation_Table_Lock>
-#pragma instantiate ACE_Hash_Map_Entry<ACE_Hash_Addr<ACE_INET_Addr>, TAO_POA *>
-#pragma instantiate ACE_Hash_Map_Iterator_Base<ACE_Hash_Addr<ACE_INET_Addr>, TAO_POA *, TAO_Collocation_Table_Lock>
-#pragma instantiate ACE_Hash_Map_Iterator<ACE_Hash_Addr<ACE_INET_Addr>, TAO_POA *, TAO_Collocation_Table_Lock>
-#pragma instantiate ACE_Hash_Map_Reverse_Iterator<ACE_Hash_Addr<ACE_INET_Addr>, TAO_POA *, TAO_Collocation_Table_Lock>
+#pragma instantiate ACE_Hash_Map_Manager<ACE_INET_Addr, TAO_POA *, TAO_Collocation_Table_Lock>
+#pragma instantiate ACE_Hash_Map_Entry<ACE_INET_Addr, TAO_POA *>
+#pragma instantiate ACE_Hash_Map_Iterator_Base<ACE_INET_Addr, TAO_POA *, TAO_Collocation_Table_Lock>
+#pragma instantiate ACE_Hash_Map_Iterator<ACE_INET_Addr, TAO_POA *, TAO_Collocation_Table_Lock>
+#pragma instantiate ACE_Hash_Map_Reverse_Iterator<ACE_INET_Addr, TAO_POA *, TAO_Collocation_Table_Lock>
#pragma instantiate ACE_Guard<TAO_Collocation_Table_Lock>
#pragma instantiate ACE_Read_Guard<TAO_Collocation_Table_Lock>
#pragma instantiate ACE_Write_Guard<TAO_Collocation_Table_Lock>
diff --git a/TAO/tao/ORB_Core.h b/TAO/tao/ORB_Core.h
index e92e0c7bd3a..8d8e78a2fdd 100644
--- a/TAO/tao/ORB_Core.h
+++ b/TAO/tao/ORB_Core.h
@@ -29,7 +29,7 @@ public:
~TAO_Collocation_Table_Lock (void);
};
-typedef ACE_Hash_Map_Manager<ACE_Hash_Addr<ACE_INET_Addr>, TAO_POA *, TAO_Collocation_Table_Lock>
+typedef ACE_Hash_Map_Manager<ACE_INET_Addr, TAO_POA *, TAO_Collocation_Table_Lock>
TAO_GLOBAL_Collocation_Table;
class TAO_Cached_Connector_Lock : public ACE_Adaptive_Lock
@@ -660,26 +660,4 @@ ACE_FACTORY_DECLARE (TAO, TAO_Resource_Factory)
extern TAO_Export TAO_ORB_Core *TAO_ORB_Core_instance (void);
-// Declare that the following method should be specialized.
-
-#if defined (ACE_HAS_TEMPLATE_SPECIALIZATION) && (!defined (__GNUG__) || (__GNUC__ > 2 || __GNUC_MINOR__ >= 90))
-
-// Template specializations that allow the cached connection manager
-// to work better. Older versions of g++, such as 2.7.2.3, can't
-// deal with them, though.
-
-inline u_long
-ACE_Refcounted_Hash_Recyclable<ACE_INET_Addr>::hash_i (void) const
-{
- return this->t_.get_ip_address () + this->t_.get_port_number ();
-}
-
-inline u_long
-ACE_Hash_Addr<ACE_INET_Addr>::hash_i (const ACE_INET_Addr &addr) const
-{
- return addr.get_ip_address () + addr.get_port_number ();
-}
-
-#endif /* ACE_HAS_TEMPLATE_SPECIALIZATION && egcs, if __GNUG__ */
-
#endif /* TAO_ORB_CORE_H */
diff --git a/ace/Addr.h b/ace/Addr.h
index 5776311c497..91f98d5104b 100644
--- a/ace/Addr.h
+++ b/ace/Addr.h
@@ -78,6 +78,10 @@ public:
// Wild-card address.
#endif /* ACE_HAS_BROKEN_SAP_ANY */
+ virtual u_long hash (void) const;
+ // Returns a hash value. This should be overwritten by a subclass
+ // which can produce a better hash value.
+
void dump (void) const;
// Dump the state of an object.
diff --git a/ace/Addr.i b/ace/Addr.i
index 8a701eccfd5..db4f4e605c8 100644
--- a/ace/Addr.i
+++ b/ace/Addr.i
@@ -61,3 +61,9 @@ ACE_Addr::set_type (int type)
{
this->addr_type_ = type;
}
+
+ACE_INLINE u_long
+ACE_Addr::hash (void) const
+{
+ return 0;
+}
diff --git a/ace/INET_Addr.h b/ace/INET_Addr.h
index 1bab1d1d17a..b9d432f91f0 100644
--- a/ace/INET_Addr.h
+++ b/ace/INET_Addr.h
@@ -155,6 +155,9 @@ public:
int operator != (const ACE_INET_Addr &SAP) const;
// Compare two addresses for inequality.
+ virtual u_long hash (void) const;
+ // Computes and returns hash value.
+
void dump (void) const;
// Dump the state of an object.
diff --git a/ace/INET_Addr.i b/ace/INET_Addr.i
index c22638c576e..6f4b74e830a 100644
--- a/ace/INET_Addr.i
+++ b/ace/INET_Addr.i
@@ -45,3 +45,9 @@ ACE_INET_Addr::get_ip_address (void) const
return ntohl (ACE_UINT32 (this->inet_addr_.sin_addr.s_addr));
}
+ACE_INLINE u_long
+ACE_INET_Addr::hash (void) const
+{
+ return this->get_ip_address () + this->get_port_number ();
+}
+
diff --git a/tests/Conn_Test.cpp b/tests/Conn_Test.cpp
index a6471fa4e20..cf0dcb82e2e 100644
--- a/tests/Conn_Test.cpp
+++ b/tests/Conn_Test.cpp
@@ -177,19 +177,6 @@ Svc_Handler::idle (u_long flags)
// ****************************************
-// Template specializations. Older versions of g++, such as 2.7.2.3,
-// can't deal with them, though.
-
-#if defined (ACE_HAS_TEMPLATE_SPECIALIZATION) && !defined (ACE_HAS_GNUG_PRE_2_8)
-u_long
-ACE_Refcounted_Hash_Recyclable<ACE_INET_Addr>::hash_i (void) const
-{
- return this->t_.get_ip_address () + this->t_.get_port_number ();
-}
-#endif /* ACE_HAS_TEMPLATE_SPECIALIZATION && newer g++, if __GNUG__ */
-
-// ****************************************
-
// The following works around bugs with some operating systems, which
// don't allow multiple threads/process to call accept() on the same
// listen-mode port/socket.