diff options
author | Ossama Othman <ossama-othman@users.noreply.github.com> | 2003-02-20 17:04:19 +0000 |
---|---|---|
committer | Ossama Othman <ossama-othman@users.noreply.github.com> | 2003-02-20 17:04:19 +0000 |
commit | 29b1f2b8f8d739783db173628961cdc19b272f31 (patch) | |
tree | 60955587fb9ffb8b0581545b140807cc62000d0e | |
parent | 9cf80f9de4604004951879e2c249c05ed1b1f098 (diff) | |
download | ATCD-29b1f2b8f8d739783db173628961cdc19b272f31.tar.gz |
ChangeLogTag:Thu Feb 20 09:01:55 2003 Ossama Othman <ossama@uci.edu>
65 files changed, 1675 insertions, 708 deletions
diff --git a/ChangeLog b/ChangeLog index c9ecb843414..52ef96a0ec2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,304 @@ +Thu Feb 20 09:01:55 2003 Ossama Othman <ossama@uci.edu> + + * ace/Acceptor.h: + * ace/Connector.h: + + No need to include "ace/Service_Config.h" and + "ace/Svc_Handler.h". + + Include "ace/Synch_Options.h". Necessitated by inter-header + dependency reductions. + + * ace/Acceptor.cpp: + * ace/Connector.cpp: + + Include "ace/Svc_Handler.h". Necessitated by inter-header + dependency reductions. + + * ace/Atomic_Op.h: + + Fixed doxygen documentation. + + * ace/Atomic_Op.i (operator++, operator--): + + Implement these post{in,de}crement operators in terms of their + corresponding pre{in,de}crement operators to ensure consistent + semantics. + + * ace/Atomic_Op_T.h (mutex_, own_mutex_): + + Improved const-correctness by making these mutex members + mutable. This allows us to avoid casting away the constness. + + * ace/Atomic_Op_T.i (operator==, operator>=, operator>): + (operator<=, operator<, value, operator=): + + Do not cast away the constness of the mutex. That hack is no + longer necessary since the mutex is now mutable. + + * ace/Basic_Types.h: + + Improved doxygen documentation. + + Moved endianness determination macros prior to ACE_U_LongLong + class. + + (operator=): + + Added ACE_ULongLong assignment operator declarations that accept + 32 bit signed and unsigned integers. + + (operator++, operator--): + + Added missing ACE_ULongLong post{in,de}crement operator + declarations. + + (data_): + + Make declaration order of lower and upper 32 bit members (lo_ + and hi_) of this structure dependant on the endianness of the + platform. This mimics what is done for the ACE_LongLong type + in the ACE_CDR classes. + + * ace/Basic_Types.i (operator=): + + Added ACE_ULongLong assignment operator implementation that + accept 32 bit signed and unsigned integers. + + (operator++, operator--): + + Added missing ACE_ULongLong post{in,de}crement operator + implementations. + + * ace/CDR_Base.cpp (mb_align): + + Uninlined this method in order to reduce inter-header + dependencies. + + (operator<, operator<=, operator>, operator>=, operator==): + (operator!=): + + Added these missing operator for the ACE_LongLong type. + + (Float, operator=, operator!=): + + Fixed potential unused argument warnings for the Cray/UNICOS + case. + + * ace/CDR_Base.h: + + Include "ace/OS.h" instead of "ace/Message_Block.h", and forward + declare ACE_Message_Block in order to reduce inter-header + dependencies. + + Changed all uses of typedefs like "u_char" and "u_long" to their + non-typedef counterparts, e.g. "unsigned char" and "unsigned + long". Makes it possible to avoid including headers that + contain those typedefs. + + (operator=): + + Added ACE_LongLong constructors assignment operators that accept + 32-bit integers. + + (operator==, operator!=, operator<=, operator<, operator>=): + (operator>): + + Added these missing ACE_LongLong relation operators. + + * ace/CDR_Base.inl (operator=): + + Added ACE_LongLong constructors assignment operators that accept + 32-bit integers. + + (operator==, operator!=, operator<=, operator<, operator>=): + (operator>): + + Added these missing ACE_LongLong relation operators. + + * ace/CDR_Stream.h: + + Moved definition of the ACE_CDR_BYTE_ORDER macros from OS.h to + this header. Helps with header dependency reduction. + + * ace/Capabilities.h: + + Use ACE_Hash_Map_Manager_Ex instead of ACE_Hash_Map_Manager. + Doing so saves us three template instantiations. + + * ace/Capabilities.i: + + Cosmetic changes. + + * ace/Capabilities.cpp: + + No need to include "ace/Map_Manager.h". + + Added missing ACE_RCSID macro. + + Improved conformance to ACE coding conventions. + + Removed explicit template instantiations for the + ACE_Hash_Map_Manager template. That template is no longer + used. + + (reset_caps): + + Use ACE_Hash_Map_Manager_Ex template traits instead of the + actual template type. Makes for cleaner code. + + * ace/Configuration.cpp: + * ace/Configuration.h: + * ace/Strategies_T.cpp: + * ace/Token_Collection.cpp: + * ace/Token_Collection.h: + * ace/Token_Invariants.cpp: + * ace/Token_Invariants.h: + * ace/Token_Manager.cpp: + * ace/Token_Manager.h: + * ace/WIN32_Asynch_IO.cpp: + * ace/WIN32_Asynch_IO.h: + + Take advantage of template traits to improve clarity of code. + + * ace/Copy_Disabled.h: + + Corrected comment. + + * ace/Default_Constants.h: + + Moved ACE_DEFAULT_CDR_BUFSIZE, ACE_DEFAULT_CDR_EXP_GROWTH_MAX, + ACE_DEFAULT_CDR_LINEAR_GROWTH_CHUNK, + ACE_DEFAULT_CDR_MEMCPY_TRADEOFF macros from OS.h to this + header. Helps with inter-header dependency reduction. + + * ace/Dynamic_Service_Base.cpp: + * ace/Parse_Node.cpp: + * ace/Service_Manager.cpp: + * ace/Service_Repository.cpp: + * ace/Svc_Conf.y: + * ace/Svc_Conf_y.cpp: + + Include "ace/Service_Types.h". Necessitated by inter-header + dependency reduction. + + * ace/Filecache.h: + * ace/Filecache.cpp: + * ace/Hash_Map_With_Allocator_T.h: + * ace/Hash_Map_With_Allocator_T.cpp: + * ace/Local_Name_Space_T.h: + * ace/Local_Name_Space.cpp: + + Use ACE_Hash_Map_Manager_Ex instead of ACE_Hash_Map_Manager. + Doing so saves us three template instantiations. + + * ace/Future_Set.h: + * ace/Map_T.h: + + Include "ace/Hash_Map_Manager_T.h" instead of + "ace/Hash_Map_Manager.h". The former is all that is needed, and + the latter already includes the former. + + * ace/Hash_Map_Manager_T.i (operator++, operator--): + * ace/Map_Manager.i: + * ace/RB_Tree.i: + + Implement the post-{in,de}crement operators in terms of their + pre-{in,de}crement operator counterparts to ensure consistency. + + * ace/Local_Name_Space_T.cpp: + + No need to include "ace/Auto_Ptr.h" + + Use template traits to improve code clarity. + + * ace/OS.h: + + Moved ACE_CDR_BYTE_ORDER macro definition to CDR_Stream.h. + Helps with inter-header dependencies. + + Moved ACE_DEFAULT_CDR_BUFSIZE, ACE_DEFAULT_CDR_EXP_GROWTH_MAX, + ACE_DEFAULT_CDR_LINEAR_GROWTH_CHUNK, + ACE_DEFAULT_CDR_MEMCPY_TRADEOFF to Default_Constants.h. Helps + with inter-header dependency reduction. + + * ace/POSIX_Asynch_IO.cpp: + + Added missing ACE_RCSID macro. + + (bytes_transferred): + Use map template traits to improve code clarity. + + * ace/POSIX_Asynch_IO.h: + + Redefined old map typedefs in terms of the map traits. + + * ace/Parse_Node.h: + * ace/Service_Repository.h: + + No need to include "ace/Service_Types.h". A forward declaration + for ACE_Service_Types is enough. + + * ace/Service_Config.h: + + No need to include "ace/Service_Types.h" and "ace/Signal.h". + Forward declaring ACE_Service_Types and ACE_Sig_Adapter is + enough. + + * ace/Strategies_T.h: + + No need to include "ace/Service_Config.h" and + "ace/Synch_Options.h". + + * ace/Synch_Options.h: + + Changed all uses of typedefs like "u_char" and "u_long" to their + non-typedef counterparts, e.g. "unsigned char" and "unsigned + long". Makes it possible to avoid including OS.h. A big win in + compile time reduction. + + Include "ace/Time_Value.h". Necessitated by inter-header + dependency reduction. + + * ace/Synch_Options.cpp: + + Changed all uses of typedefs like "u_char" and "u_long" to their + non-typedef counterparts, e.g. "unsigned char" and "unsigned + long". Makes it possible to avoid including OS.h. A big win in + compile time reduction. + + Include "ace/Trace.h". Necessitated by inter-header + dependency reduction. + + * ace/Template_Instantiations.cpp: + + Removed all ACE_Hash_Map_Manager related template + instantiations. The ones for ACE_Hash_Map_Manager_Ex are all + that are needed. + + * ace/SSL/SSL_SOCK_Acceptor.h (ACE_SSL_SOCK_Acceptor): + + Inherit privately from ACE_SSL_SOCK, instead of publically. + ACE_SSL_SOCK_Acceptor is IMPLEMENTED-IN-TERMS-OF ACE_SSL_SOCK. + It does not satisfy the IS-A relationship. + + * ace/SSL/SSL_SOCK_Connector.cpp (ssl_connect): + + Use ACE_Countdown_Time to take into account the time between + each call to select() instead of using the same timeout value in + each loop iteration. + + * ace/SSL/SSL_SOCK_Stream.cpp (get_remote_addr): + + Retrieve the remote addr from the parent ACE_SSL_SOCK class, not + ACE_SOCK. Addresses potential inconsistencies in the future. + + * ace/SSL/SSL_SOCK_Stream.h (ACE_SSL_SOCK_Stream): + + Removed friend declarations for the + ACE_SSL_SOCK_{Acceptor,Connector} classes. They are + unnecessary. + Wed Feb 19 12:50:58 2003 Heather Drury <oci@cs.wustl.edu> * ACE version 5.3.1 released. diff --git a/ChangeLogs/ChangeLog-03a b/ChangeLogs/ChangeLog-03a index c9ecb843414..52ef96a0ec2 100644 --- a/ChangeLogs/ChangeLog-03a +++ b/ChangeLogs/ChangeLog-03a @@ -1,3 +1,304 @@ +Thu Feb 20 09:01:55 2003 Ossama Othman <ossama@uci.edu> + + * ace/Acceptor.h: + * ace/Connector.h: + + No need to include "ace/Service_Config.h" and + "ace/Svc_Handler.h". + + Include "ace/Synch_Options.h". Necessitated by inter-header + dependency reductions. + + * ace/Acceptor.cpp: + * ace/Connector.cpp: + + Include "ace/Svc_Handler.h". Necessitated by inter-header + dependency reductions. + + * ace/Atomic_Op.h: + + Fixed doxygen documentation. + + * ace/Atomic_Op.i (operator++, operator--): + + Implement these post{in,de}crement operators in terms of their + corresponding pre{in,de}crement operators to ensure consistent + semantics. + + * ace/Atomic_Op_T.h (mutex_, own_mutex_): + + Improved const-correctness by making these mutex members + mutable. This allows us to avoid casting away the constness. + + * ace/Atomic_Op_T.i (operator==, operator>=, operator>): + (operator<=, operator<, value, operator=): + + Do not cast away the constness of the mutex. That hack is no + longer necessary since the mutex is now mutable. + + * ace/Basic_Types.h: + + Improved doxygen documentation. + + Moved endianness determination macros prior to ACE_U_LongLong + class. + + (operator=): + + Added ACE_ULongLong assignment operator declarations that accept + 32 bit signed and unsigned integers. + + (operator++, operator--): + + Added missing ACE_ULongLong post{in,de}crement operator + declarations. + + (data_): + + Make declaration order of lower and upper 32 bit members (lo_ + and hi_) of this structure dependant on the endianness of the + platform. This mimics what is done for the ACE_LongLong type + in the ACE_CDR classes. + + * ace/Basic_Types.i (operator=): + + Added ACE_ULongLong assignment operator implementation that + accept 32 bit signed and unsigned integers. + + (operator++, operator--): + + Added missing ACE_ULongLong post{in,de}crement operator + implementations. + + * ace/CDR_Base.cpp (mb_align): + + Uninlined this method in order to reduce inter-header + dependencies. + + (operator<, operator<=, operator>, operator>=, operator==): + (operator!=): + + Added these missing operator for the ACE_LongLong type. + + (Float, operator=, operator!=): + + Fixed potential unused argument warnings for the Cray/UNICOS + case. + + * ace/CDR_Base.h: + + Include "ace/OS.h" instead of "ace/Message_Block.h", and forward + declare ACE_Message_Block in order to reduce inter-header + dependencies. + + Changed all uses of typedefs like "u_char" and "u_long" to their + non-typedef counterparts, e.g. "unsigned char" and "unsigned + long". Makes it possible to avoid including headers that + contain those typedefs. + + (operator=): + + Added ACE_LongLong constructors assignment operators that accept + 32-bit integers. + + (operator==, operator!=, operator<=, operator<, operator>=): + (operator>): + + Added these missing ACE_LongLong relation operators. + + * ace/CDR_Base.inl (operator=): + + Added ACE_LongLong constructors assignment operators that accept + 32-bit integers. + + (operator==, operator!=, operator<=, operator<, operator>=): + (operator>): + + Added these missing ACE_LongLong relation operators. + + * ace/CDR_Stream.h: + + Moved definition of the ACE_CDR_BYTE_ORDER macros from OS.h to + this header. Helps with header dependency reduction. + + * ace/Capabilities.h: + + Use ACE_Hash_Map_Manager_Ex instead of ACE_Hash_Map_Manager. + Doing so saves us three template instantiations. + + * ace/Capabilities.i: + + Cosmetic changes. + + * ace/Capabilities.cpp: + + No need to include "ace/Map_Manager.h". + + Added missing ACE_RCSID macro. + + Improved conformance to ACE coding conventions. + + Removed explicit template instantiations for the + ACE_Hash_Map_Manager template. That template is no longer + used. + + (reset_caps): + + Use ACE_Hash_Map_Manager_Ex template traits instead of the + actual template type. Makes for cleaner code. + + * ace/Configuration.cpp: + * ace/Configuration.h: + * ace/Strategies_T.cpp: + * ace/Token_Collection.cpp: + * ace/Token_Collection.h: + * ace/Token_Invariants.cpp: + * ace/Token_Invariants.h: + * ace/Token_Manager.cpp: + * ace/Token_Manager.h: + * ace/WIN32_Asynch_IO.cpp: + * ace/WIN32_Asynch_IO.h: + + Take advantage of template traits to improve clarity of code. + + * ace/Copy_Disabled.h: + + Corrected comment. + + * ace/Default_Constants.h: + + Moved ACE_DEFAULT_CDR_BUFSIZE, ACE_DEFAULT_CDR_EXP_GROWTH_MAX, + ACE_DEFAULT_CDR_LINEAR_GROWTH_CHUNK, + ACE_DEFAULT_CDR_MEMCPY_TRADEOFF macros from OS.h to this + header. Helps with inter-header dependency reduction. + + * ace/Dynamic_Service_Base.cpp: + * ace/Parse_Node.cpp: + * ace/Service_Manager.cpp: + * ace/Service_Repository.cpp: + * ace/Svc_Conf.y: + * ace/Svc_Conf_y.cpp: + + Include "ace/Service_Types.h". Necessitated by inter-header + dependency reduction. + + * ace/Filecache.h: + * ace/Filecache.cpp: + * ace/Hash_Map_With_Allocator_T.h: + * ace/Hash_Map_With_Allocator_T.cpp: + * ace/Local_Name_Space_T.h: + * ace/Local_Name_Space.cpp: + + Use ACE_Hash_Map_Manager_Ex instead of ACE_Hash_Map_Manager. + Doing so saves us three template instantiations. + + * ace/Future_Set.h: + * ace/Map_T.h: + + Include "ace/Hash_Map_Manager_T.h" instead of + "ace/Hash_Map_Manager.h". The former is all that is needed, and + the latter already includes the former. + + * ace/Hash_Map_Manager_T.i (operator++, operator--): + * ace/Map_Manager.i: + * ace/RB_Tree.i: + + Implement the post-{in,de}crement operators in terms of their + pre-{in,de}crement operator counterparts to ensure consistency. + + * ace/Local_Name_Space_T.cpp: + + No need to include "ace/Auto_Ptr.h" + + Use template traits to improve code clarity. + + * ace/OS.h: + + Moved ACE_CDR_BYTE_ORDER macro definition to CDR_Stream.h. + Helps with inter-header dependencies. + + Moved ACE_DEFAULT_CDR_BUFSIZE, ACE_DEFAULT_CDR_EXP_GROWTH_MAX, + ACE_DEFAULT_CDR_LINEAR_GROWTH_CHUNK, + ACE_DEFAULT_CDR_MEMCPY_TRADEOFF to Default_Constants.h. Helps + with inter-header dependency reduction. + + * ace/POSIX_Asynch_IO.cpp: + + Added missing ACE_RCSID macro. + + (bytes_transferred): + Use map template traits to improve code clarity. + + * ace/POSIX_Asynch_IO.h: + + Redefined old map typedefs in terms of the map traits. + + * ace/Parse_Node.h: + * ace/Service_Repository.h: + + No need to include "ace/Service_Types.h". A forward declaration + for ACE_Service_Types is enough. + + * ace/Service_Config.h: + + No need to include "ace/Service_Types.h" and "ace/Signal.h". + Forward declaring ACE_Service_Types and ACE_Sig_Adapter is + enough. + + * ace/Strategies_T.h: + + No need to include "ace/Service_Config.h" and + "ace/Synch_Options.h". + + * ace/Synch_Options.h: + + Changed all uses of typedefs like "u_char" and "u_long" to their + non-typedef counterparts, e.g. "unsigned char" and "unsigned + long". Makes it possible to avoid including OS.h. A big win in + compile time reduction. + + Include "ace/Time_Value.h". Necessitated by inter-header + dependency reduction. + + * ace/Synch_Options.cpp: + + Changed all uses of typedefs like "u_char" and "u_long" to their + non-typedef counterparts, e.g. "unsigned char" and "unsigned + long". Makes it possible to avoid including OS.h. A big win in + compile time reduction. + + Include "ace/Trace.h". Necessitated by inter-header + dependency reduction. + + * ace/Template_Instantiations.cpp: + + Removed all ACE_Hash_Map_Manager related template + instantiations. The ones for ACE_Hash_Map_Manager_Ex are all + that are needed. + + * ace/SSL/SSL_SOCK_Acceptor.h (ACE_SSL_SOCK_Acceptor): + + Inherit privately from ACE_SSL_SOCK, instead of publically. + ACE_SSL_SOCK_Acceptor is IMPLEMENTED-IN-TERMS-OF ACE_SSL_SOCK. + It does not satisfy the IS-A relationship. + + * ace/SSL/SSL_SOCK_Connector.cpp (ssl_connect): + + Use ACE_Countdown_Time to take into account the time between + each call to select() instead of using the same timeout value in + each loop iteration. + + * ace/SSL/SSL_SOCK_Stream.cpp (get_remote_addr): + + Retrieve the remote addr from the parent ACE_SSL_SOCK class, not + ACE_SOCK. Addresses potential inconsistencies in the future. + + * ace/SSL/SSL_SOCK_Stream.h (ACE_SSL_SOCK_Stream): + + Removed friend declarations for the + ACE_SSL_SOCK_{Acceptor,Connector} classes. They are + unnecessary. + Wed Feb 19 12:50:58 2003 Heather Drury <oci@cs.wustl.edu> * ACE version 5.3.1 released. diff --git a/ace/Acceptor.cpp b/ace/Acceptor.cpp index 35970cd85a7..be79daa6857 100644 --- a/ace/Acceptor.cpp +++ b/ace/Acceptor.cpp @@ -1,7 +1,5 @@ -// $Id$ - -#ifndef ACE_ACCEPTOR_C -#define ACE_ACCEPTOR_C +#ifndef ACE_ACCEPTOR_CPP +#define ACE_ACCEPTOR_CPP #include "ace/ACE.h" @@ -11,9 +9,13 @@ #include "ace/Acceptor.h" #include "ace/Handle_Set.h" +#include "ace/Svc_Handler.h" #include "ace/WFMO_Reactor.h" -ACE_RCSID(ace, Acceptor, "$Id$") + +ACE_RCSID (ace, + Acceptor, + "$Id$") ACE_ALLOC_HOOK_DEFINE(ACE_Acceptor) @@ -1208,4 +1210,4 @@ ACE_Oneshot_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::operator ACE_PEER_ACCEPT return (ACE_PEER_ACCEPTOR &) this->peer_acceptor_; } -#endif /* ACE_ACCEPTOR_C */ +#endif /* ACE_ACCEPTOR_CPP */ diff --git a/ace/Acceptor.h b/ace/Acceptor.h index e04604ca697..aeef0c069af 100644 --- a/ace/Acceptor.h +++ b/ace/Acceptor.h @@ -15,15 +15,15 @@ #include "ace/pre.h" -#include "ace/Service_Config.h" +#include "ace/Service_Object.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "ace/Service_Object.h" -#include "ace/Svc_Handler.h" #include "ace/Strategies_T.h" +#include "ace/Synch_Options.h" + /** * @class ACE_Acceptor diff --git a/ace/Atomic_Op.h b/ace/Atomic_Op.h index 07fa649bcd7..086fc7da3bd 100644 --- a/ace/Atomic_Op.h +++ b/ace/Atomic_Op.h @@ -50,7 +50,10 @@ ACE_TEMPLATE_SPECIALIZATION * @class ACE_Atomic_Op<ACE_Thread_Mutex, long> * * @brief Specialization of ACE_Atomic_Op for platforms that - * support atomic integer operations. + * support atomic integer operations. + * + * Specialization of ACE_Atomic_Op for platforms that support atomic + * integer operations. */ class ACE_Export ACE_Atomic_Op<ACE_Thread_Mutex, long> { diff --git a/ace/Atomic_Op.i b/ace/Atomic_Op.i index a13caa5e178..39d09ba0d17 100644 --- a/ace/Atomic_Op.i +++ b/ace/Atomic_Op.i @@ -1,4 +1,5 @@ // -*- C++ -*- +// // $Id$ @@ -17,7 +18,8 @@ ACE_Atomic_Op<ACE_Thread_Mutex, long>::ACE_Atomic_Op (long c) } ACE_INLINE -ACE_Atomic_Op<ACE_Thread_Mutex, long>::ACE_Atomic_Op (const ACE_Atomic_Op<ACE_Thread_Mutex, long> &rhs) +ACE_Atomic_Op<ACE_Thread_Mutex, long>::ACE_Atomic_Op ( + const ACE_Atomic_Op<ACE_Thread_Mutex, long> &rhs) : value_ (rhs.value_) { } @@ -35,11 +37,7 @@ ACE_Atomic_Op<ACE_Thread_Mutex, long>::operator++ (void) ACE_INLINE long ACE_Atomic_Op<ACE_Thread_Mutex, long>::operator++ (int) { -#if defined (WIN32) - return ::InterlockedIncrement (ACE_const_cast (long *, &this->value_)) - 1; -#else /* WIN32 */ - return (*increment_fn_) (&this->value_) - 1; -#endif /* WIN32 */ + return ++*this - 1; } ACE_INLINE long @@ -55,18 +53,15 @@ ACE_Atomic_Op<ACE_Thread_Mutex, long>::operator-- (void) ACE_INLINE long ACE_Atomic_Op<ACE_Thread_Mutex, long>::operator-- (int) { -#if defined (WIN32) - return ::InterlockedDecrement (ACE_const_cast (long *, &this->value_)) + 1; -#else /* WIN32 */ - return (*decrement_fn_) (&this->value_) + 1; -#endif /* WIN32 */ + return --*this + 1; } ACE_INLINE long ACE_Atomic_Op<ACE_Thread_Mutex, long>::operator+= (long rhs) { #if defined (WIN32) && defined (ACE_HAS_INTERLOCKED_EXCHANGEADD) - return ::InterlockedExchangeAdd (ACE_const_cast (long *, &this->value_), rhs) + rhs; + return ::InterlockedExchangeAdd (ACE_const_cast (long *, &this->value_), + rhs) + rhs; #else /* WIN32 && ACE_HAS_INTERLOCKED_EXCHANGEADD */ return (*exchange_add_fn_) (&this->value_, rhs) + rhs; #endif /* WIN32 && ACE_HAS_INTERLOCKED_EXCHANGEADD */ @@ -76,7 +71,8 @@ ACE_INLINE long ACE_Atomic_Op<ACE_Thread_Mutex, long>::operator-= (long rhs) { #if defined (WIN32) && defined (ACE_HAS_INTERLOCKED_EXCHANGEADD) - return ::InterlockedExchangeAdd (ACE_const_cast (long *, &this->value_), -rhs) - rhs; + return ::InterlockedExchangeAdd (ACE_const_cast (long *, &this->value_), + -rhs) - rhs; #else /* WIN32 && ACE_HAS_INTERLOCKED_EXCHANGEADD */ return (*exchange_add_fn_) (&this->value_, -rhs) - rhs; #endif /* WIN32 && ACE_HAS_INTERLOCKED_EXCHANGEADD */ @@ -125,7 +121,8 @@ ACE_Atomic_Op<ACE_Thread_Mutex, long>::operator= (long rhs) } ACE_INLINE void -ACE_Atomic_Op<ACE_Thread_Mutex, long>::operator= (const ACE_Atomic_Op<ACE_Thread_Mutex, long> &rhs) +ACE_Atomic_Op<ACE_Thread_Mutex, long>::operator= ( + const ACE_Atomic_Op<ACE_Thread_Mutex, long> &rhs) { this->value_ = rhs.value_; } diff --git a/ace/Atomic_Op_T.h b/ace/Atomic_Op_T.h index 47f9c9bce28..51d1ba93666 100644 --- a/ace/Atomic_Op_T.h +++ b/ace/Atomic_Op_T.h @@ -128,7 +128,7 @@ public: private: /// Type of synchronization mechanism. - ACE_LOCK &mutex_; + mutable ACE_LOCK &mutex_; /// Current object decorated by the atomic op. TYPE value_; @@ -231,7 +231,7 @@ public: private: /// Type of synchronization mechanism. - ACE_LOCK own_mutex_; + mutable ACE_LOCK own_mutex_; /// Underlying atomic op implementation. ACE_Atomic_Op_Ex <ACE_LOCK, TYPE> impl_; diff --git a/ace/Atomic_Op_T.i b/ace/Atomic_Op_T.i index cd303e43864..098e30b58e1 100644 --- a/ace/Atomic_Op_T.i +++ b/ace/Atomic_Op_T.i @@ -65,7 +65,7 @@ template <class ACE_LOCK, class TYPE> ACE_INLINE int ACE_Atomic_Op_Ex<ACE_LOCK, TYPE>::operator== (const TYPE &rhs) const { // ACE_TRACE ("ACE_Atomic_Op_Ex<ACE_LOCK, TYPE>::operator=="); - ACE_GUARD_RETURN (ACE_LOCK, ace_mon, (ACE_LOCK &) this->mutex_, 0); + ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, 0); return this->value_ == rhs; } @@ -80,7 +80,7 @@ template <class ACE_LOCK, class TYPE> ACE_INLINE int ACE_Atomic_Op_Ex<ACE_LOCK, TYPE>::operator>= (const TYPE &rhs) const { // ACE_TRACE ("ACE_Atomic_Op_Ex<ACE_LOCK, TYPE>::operator>="); - ACE_GUARD_RETURN (ACE_LOCK, ace_mon, (ACE_LOCK &) this->mutex_, 0); + ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, 0); return this->value_ >= rhs; } @@ -88,7 +88,7 @@ template <class ACE_LOCK, class TYPE> ACE_INLINE int ACE_Atomic_Op_Ex<ACE_LOCK, TYPE>::operator> (const TYPE &rhs) const { // ACE_TRACE ("ACE_Atomic_Op_Ex<ACE_LOCK, TYPE>::operator>"); - ACE_GUARD_RETURN (ACE_LOCK, ace_mon, (ACE_LOCK &) this->mutex_, 0); + ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, 0); return this->value_ > rhs; } @@ -96,7 +96,7 @@ template <class ACE_LOCK, class TYPE> ACE_INLINE int ACE_Atomic_Op_Ex<ACE_LOCK, TYPE>::operator<= (const TYPE &rhs) const { // ACE_TRACE ("ACE_Atomic_Op_Ex<ACE_LOCK, TYPE>::operator<="); - ACE_GUARD_RETURN (ACE_LOCK, ace_mon, (ACE_LOCK &) this->mutex_, 0); + ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, 0); return this->value_ <= rhs; } @@ -104,7 +104,7 @@ template <class ACE_LOCK, class TYPE> ACE_INLINE int ACE_Atomic_Op_Ex<ACE_LOCK, TYPE>::operator< (const TYPE &rhs) const { // ACE_TRACE ("ACE_Atomic_Op_Ex<ACE_LOCK, TYPE>::operator<"); - ACE_GUARD_RETURN (ACE_LOCK, ace_mon, (ACE_LOCK &) this->mutex_, 0); + ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, 0); return this->value_ < rhs; } @@ -125,7 +125,7 @@ template <class ACE_LOCK, class TYPE> ACE_INLINE TYPE ACE_Atomic_Op_Ex<ACE_LOCK, TYPE>::value (void) const { // ACE_TRACE ("ACE_Atomic_Op_Ex<ACE_LOCK, TYPE>::value"); - ACE_GUARD_RETURN (ACE_LOCK, ace_mon, (ACE_LOCK &) this->mutex_, this->value_); + ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, this->value_); return this->value_; } @@ -143,7 +143,7 @@ template <class ACE_LOCK, class TYPE> ACE_INLINE void ACE_Atomic_Op_Ex<ACE_LOCK, TYPE>::operator= (const TYPE &rhs) { // ACE_TRACE ("ACE_Atomic_Op_Ex<ACE_LOCK, TYPE>::operator="); - ACE_GUARD (ACE_LOCK, ace_mon, (ACE_LOCK &) this->mutex_); + ACE_GUARD (ACE_LOCK, ace_mon, this->mutex_); this->value_ = rhs; } diff --git a/ace/Basic_Types.h b/ace/Basic_Types.h index af9ab727892..d843c1ecac3 100644 --- a/ace/Basic_Types.h +++ b/ace/Basic_Types.h @@ -276,6 +276,52 @@ typedef unsigned char ACE_Byte; # error "Can't find a suitable type for doing pointer arithmetic." #endif /* ACE_SIZEOF_VOID_P */ +// Byte-order (endian-ness) determination. +# if defined (BYTE_ORDER) +# if (BYTE_ORDER == LITTLE_ENDIAN) +# define ACE_LITTLE_ENDIAN 0x0123 +# define ACE_BYTE_ORDER ACE_LITTLE_ENDIAN +# elif (BYTE_ORDER == BIG_ENDIAN) +# define ACE_BIG_ENDIAN 0x3210 +# define ACE_BYTE_ORDER ACE_BIG_ENDIAN +# else +# error: unknown BYTE_ORDER! +# endif /* BYTE_ORDER */ +# elif defined (_BYTE_ORDER) +# if (_BYTE_ORDER == _LITTLE_ENDIAN) +# define ACE_LITTLE_ENDIAN 0x0123 +# define ACE_BYTE_ORDER ACE_LITTLE_ENDIAN +# elif (_BYTE_ORDER == _BIG_ENDIAN) +# define ACE_BIG_ENDIAN 0x3210 +# define ACE_BYTE_ORDER ACE_BIG_ENDIAN +# else +# error: unknown _BYTE_ORDER! +# endif /* _BYTE_ORDER */ +# elif defined (__BYTE_ORDER) +# if (__BYTE_ORDER == __LITTLE_ENDIAN) +# define ACE_LITTLE_ENDIAN 0x0123 +# define ACE_BYTE_ORDER ACE_LITTLE_ENDIAN +# elif (__BYTE_ORDER == __BIG_ENDIAN) +# define ACE_BIG_ENDIAN 0x3210 +# define ACE_BYTE_ORDER ACE_BIG_ENDIAN +# else +# error: unknown __BYTE_ORDER! +# endif /* __BYTE_ORDER */ +# else /* ! BYTE_ORDER && ! __BYTE_ORDER */ + // We weren't explicitly told, so we have to figure it out . . . +# if defined (i386) || defined (__i386__) || defined (_M_IX86) || \ + defined (vax) || defined (__alpha) || defined (__LITTLE_ENDIAN__) ||\ + defined (ARM) || defined (_M_IA64) + // We know these are little endian. +# define ACE_LITTLE_ENDIAN 0x0123 +# define ACE_BYTE_ORDER ACE_LITTLE_ENDIAN +# else + // Otherwise, we assume big endian. +# define ACE_BIG_ENDIAN 0x3210 +# define ACE_BYTE_ORDER ACE_BIG_ENDIAN +# endif +# endif /* ! BYTE_ORDER && ! __BYTE_ORDER */ + #if defined (ACE_LACKS_LONGLONG_T) // This throws away the high 32 bits. It's very unlikely that a // pointer will be more than 32 bits wide if the platform does not @@ -318,6 +364,8 @@ typedef unsigned char ACE_Byte; ACE_U_LongLong (const ACE_UINT32 lo = 0x0, const ACE_UINT32 hi = 0x0); ACE_U_LongLong (const ACE_U_LongLong &); ACE_U_LongLong &operator= (const ACE_U_LongLong &); + ACE_U_LongLong &operator= (const ACE_INT32 &); + ACE_U_LongLong &operator= (const ACE_UINT32 &); ~ACE_U_LongLong (void); // = Overloaded relation operators. @@ -354,6 +402,8 @@ typedef unsigned char ACE_Byte; ACE_U_LongLong &operator-= (const ACE_UINT32); ACE_U_LongLong &operator++ (); ACE_U_LongLong &operator-- (); + ACE_U_LongLong operator++ (int); + ACE_U_LongLong operator-- (int); ACE_U_LongLong &operator|= (const ACE_U_LongLong); ACE_U_LongLong &operator|= (const ACE_UINT32); ACE_U_LongLong &operator&= (const ACE_U_LongLong); @@ -404,18 +454,28 @@ typedef unsigned char ACE_Byte; { struct { +# if defined (ACE_BIG_ENDIAN) + /// High 32 bits. ACE_UINT32 hi_; - // High 32 bits. + /// Low 32 bits. ACE_UINT32 lo_; - // Low 32 bits. +# else + /// Low 32 bits. + ACE_UINT32 lo_; + + /// High 32 bits. + ACE_UINT32 hi_; +# endif /* ! ACE_BIG_ENDIAN */ + } data_; - // To ensure alignment on 8-byte boundary. - // double isn't usually usable with ACE_LACKS_FLOATING_POINT, - // but this seems OK. + /// To ensure alignment on 8-byte boundary. + /** + * @note "double" isn't usually usable with + * ACE_LACKS_FLOATING_POINT, but this seems OK. + */ double for_alignment_; - // To ensure alignment on 8-byte boundary. }; // NOTE: the following four accessors are inlined here in @@ -592,52 +652,6 @@ typedef unsigned char ACE_Byte; #define ACE_FLT_MAX 3.402823466e+38F #define ACE_DBL_MAX 1.7976931348623158e+308 -// Byte-order (endian-ness) determination. -# if defined (BYTE_ORDER) -# if (BYTE_ORDER == LITTLE_ENDIAN) -# define ACE_LITTLE_ENDIAN 0x0123 -# define ACE_BYTE_ORDER ACE_LITTLE_ENDIAN -# elif (BYTE_ORDER == BIG_ENDIAN) -# define ACE_BIG_ENDIAN 0x3210 -# define ACE_BYTE_ORDER ACE_BIG_ENDIAN -# else -# error: unknown BYTE_ORDER! -# endif /* BYTE_ORDER */ -# elif defined (_BYTE_ORDER) -# if (_BYTE_ORDER == _LITTLE_ENDIAN) -# define ACE_LITTLE_ENDIAN 0x0123 -# define ACE_BYTE_ORDER ACE_LITTLE_ENDIAN -# elif (_BYTE_ORDER == _BIG_ENDIAN) -# define ACE_BIG_ENDIAN 0x3210 -# define ACE_BYTE_ORDER ACE_BIG_ENDIAN -# else -# error: unknown _BYTE_ORDER! -# endif /* _BYTE_ORDER */ -# elif defined (__BYTE_ORDER) -# if (__BYTE_ORDER == __LITTLE_ENDIAN) -# define ACE_LITTLE_ENDIAN 0x0123 -# define ACE_BYTE_ORDER ACE_LITTLE_ENDIAN -# elif (__BYTE_ORDER == __BIG_ENDIAN) -# define ACE_BIG_ENDIAN 0x3210 -# define ACE_BYTE_ORDER ACE_BIG_ENDIAN -# else -# error: unknown __BYTE_ORDER! -# endif /* __BYTE_ORDER */ -# else /* ! BYTE_ORDER && ! __BYTE_ORDER */ - // We weren't explicitly told, so we have to figure it out . . . -# if defined (i386) || defined (__i386__) || defined (_M_IX86) || \ - defined (vax) || defined (__alpha) || defined (__LITTLE_ENDIAN__) ||\ - defined (ARM) || defined (_M_IA64) - // We know these are little endian. -# define ACE_LITTLE_ENDIAN 0x0123 -# define ACE_BYTE_ORDER ACE_LITTLE_ENDIAN -# else - // Otherwise, we assume big endian. -# define ACE_BIG_ENDIAN 0x3210 -# define ACE_BYTE_ORDER ACE_BIG_ENDIAN -# endif -# endif /* ! BYTE_ORDER && ! __BYTE_ORDER */ - #if !defined (ACE_HAS_SSIZE_T) # if defined (ACE_WIN64) typedef SSIZE_T ssize_t; diff --git a/ace/Basic_Types.i b/ace/Basic_Types.i index 0012b00defb..d0858fa03b7 100644 --- a/ace/Basic_Types.i +++ b/ace/Basic_Types.i @@ -1,4 +1,5 @@ -/* -*- C++ -*- */ +// -*- C++ -*- +// // $Id$ #if defined (ACE_LACKS_LONGLONG_T) @@ -135,6 +136,37 @@ ACE_U_LongLong::operator= (const ACE_U_LongLong &n) return *this; } +ACE_INLINE ACE_U_LongLong & +ACE_U_LongLong::operator= (const ACE_INT32 &rhs) +{ + if (rhs >= 0) + { + l_ () = ACE_static_cast (ACE_UINT32, rhs); + h_ () = 0; + } + else + { + // We do not handle the case where a negative 32 bit integer is + // assigned to this representation of a 64 bit unsigned integer. + // The "undefined behavior" behavior performed by this + // implementation is to simply set all bits to zero. + l_ () = 0; + h_ () = 0; + } + + return *this; +} + +ACE_INLINE ACE_U_LongLong & +ACE_U_LongLong::operator= (const ACE_UINT32 &rhs) +{ + l_ () = rhs; + h_ () = 0; + + return *this; +} + + ACE_INLINE ACE_U_LongLong ACE_U_LongLong::operator+ (const ACE_U_LongLong &n) const { @@ -358,6 +390,26 @@ ACE_U_LongLong::operator-- () return *this; } +ACE_INLINE const ACE_U_LongLong +ACE_U_LongLong::operator++ (int) +{ + // Post-increment operator should always be implemented in terms of + // the pre-increment operator to enforce consistent semantics. + ACE_U_LongLong temp (*this); + ++*this; + return *temp; +} + +ACE_INLINE const ACE_U_LongLong +ACE_U_LongLong::operator-- (int) +{ + // Post-decrement operator should always be implemented in terms of + // the pre-decrement operator to enforce consistent semantics. + ACE_U_LongLong temp (*this); + --*this; + return *temp; +} + ACE_INLINE ACE_U_LongLong & ACE_U_LongLong::operator|= (const ACE_U_LongLong n) { diff --git a/ace/CDR_Base.cpp b/ace/CDR_Base.cpp index c01c3e40039..64f1e3472f4 100644 --- a/ace/CDR_Base.cpp +++ b/ace/CDR_Base.cpp @@ -1,7 +1,3 @@ -// -*- C++ -*- -// -// $Id$ - #include "ace/CDR_Base.h" #include "ace/Message_Block.h" @@ -9,11 +5,12 @@ # include "ace/CDR_Base.inl" #endif /* ! __ACE_INLINE__ */ -ACE_RCSID(ace, CDR_Base, "$Id$") - +ACE_RCSID (ace, + CDR_Base, + "$Id$") // -// See comments in CDR_Base.i about optimization cases for swap_XX_array. +// See comments in CDR_Base.inl about optimization cases for swap_XX_array. // void @@ -24,7 +21,7 @@ ACE_CDR::swap_2_array (const char* orig, char* target, size_t n) // Later, we try to read in 32 or 64 bit chunks, // so make sure we don't do that for unaligned addresses. #if ACE_SIZEOF_LONG == 8 - const char* const o8 = ACE_ptr_align_binary(orig, 8); + const char* const o8 = ACE_ptr_align_binary (orig, 8); while (orig < o8 && n > 0) { ACE_CDR::swap_2 (orig, target); @@ -33,7 +30,7 @@ ACE_CDR::swap_2_array (const char* orig, char* target, size_t n) --n; } #else - const char* const o4 = ACE_ptr_align_binary(orig, 4); + const char* const o4 = ACE_ptr_align_binary (orig, 4); // this is an _if_, not a _while_. The mistmatch can only be by 2. if (orig != o4) { @@ -54,28 +51,28 @@ ACE_CDR::swap_2_array (const char* orig, char* target, size_t n) // In the while loop ahead, orig will move over the array by 8 byte // increments (4 elements of 2 bytes). // end marks our barrier for not falling outside. - const char* const end = orig + 2*(n & (~3)); + const char* const end = orig + 2 * (n & (~3)); // See if we're aligned for writting in 64 or 32 bit chunks... #if ACE_SIZEOF_LONG == 8 - if (target == ACE_ptr_align_binary(target, 8)) + if (target == ACE_ptr_align_binary (target, 8)) #else - if (target == ACE_ptr_align_binary(target, 4)) + if (target == ACE_ptr_align_binary (target, 4)) #endif { while (orig < end) { -#if defined(ACE_HAS_PENTIUM) && defined(__GNUG__) +#if defined (ACE_HAS_PENTIUM) && defined (__GNUG__) unsigned int a = - * ACE_reinterpret_cast(const unsigned int*, orig); + * ACE_reinterpret_cast (const unsigned int*, orig); unsigned int b = - * ACE_reinterpret_cast(const unsigned int*, orig + 4); - asm( "bswap %1" : "=r" (a) : "0" (a) ); - asm( "bswap %1" : "=r" (b) : "0" (b) ); - asm( "rol $16, %1" : "=r" (a) : "0" (a) ); - asm( "rol $16, %1" : "=r" (b) : "0" (b) ); - * ACE_reinterpret_cast(unsigned int*, target) = a; - * ACE_reinterpret_cast(unsigned int*, target + 4) = b; + * ACE_reinterpret_cast (const unsigned int*, orig + 4); + asm ( "bswap %1" : "=r" (a) : "0" (a) ); + asm ( "bswap %1" : "=r" (b) : "0" (b) ); + asm ( "rol $16, %1" : "=r" (a) : "0" (a) ); + asm ( "rol $16, %1" : "=r" (b) : "0" (b) ); + * ACE_reinterpret_cast (unsigned int*, target) = a; + * ACE_reinterpret_cast (unsigned int*, target + 4) = b; #elif defined(ACE_HAS_PENTIUM) \ && (defined(_MSC_VER) || defined(__BORLANDC__)) \ && !defined(ACE_LACKS_INLINE_ASSEMBLY) @@ -92,19 +89,19 @@ ACE_CDR::swap_2_array (const char* orig, char* target, size_t n) #elif ACE_SIZEOF_LONG == 8 // 64 bit architecture. register unsigned long a = - * ACE_reinterpret_cast(const unsigned long*, orig); + * ACE_reinterpret_cast (const unsigned long*, orig); register unsigned long a1 = (a & 0x00ff00ff00ff00ffUL) << 8; register unsigned long a2 = (a & 0xff00ff00ff00ff00UL) >> 8; a = (a1 | a2); - * ACE_reinterpret_cast(unsigned long*, target) = a; + * ACE_reinterpret_cast (unsigned long*, target) = a; #else register ACE_UINT32 a = - * ACE_reinterpret_cast(const ACE_UINT32*, orig); + * ACE_reinterpret_cast (const ACE_UINT32*, orig); register ACE_UINT32 b = - * ACE_reinterpret_cast(const ACE_UINT32*, orig + 4); + * ACE_reinterpret_cast (const ACE_UINT32*, orig + 4); register ACE_UINT32 a1 = (a & 0x00ff00ffU) << 8; register ACE_UINT32 b1 = (b & 0x00ff00ffU) << 8; @@ -114,8 +111,8 @@ ACE_CDR::swap_2_array (const char* orig, char* target, size_t n) a = (a1 | a2); b = (b1 | b2); - * ACE_reinterpret_cast(ACE_UINT32*, target) = a; - * ACE_reinterpret_cast(ACE_UINT32*, target + 4) = b; + * ACE_reinterpret_cast (ACE_UINT32*, target) = a; + * ACE_reinterpret_cast (ACE_UINT32*, target + 4) = b; #endif orig += 8; target += 8; @@ -126,27 +123,27 @@ ACE_CDR::swap_2_array (const char* orig, char* target, size_t n) // We're out of luck. We have to write in 2 byte chunks. while (orig < end) { -#if defined(ACE_HAS_PENTIUM) && defined(__GNUG__) +#if defined (ACE_HAS_PENTIUM) && defined (__GNUG__) unsigned int a = - * ACE_reinterpret_cast(const unsigned int*, orig); + * ACE_reinterpret_cast (const unsigned int*, orig); unsigned int b = - * ACE_reinterpret_cast(const unsigned int*, orig + 4); - asm( "bswap %1" : "=r" (a) : "0" (a) ); - asm( "bswap %1" : "=r" (b) : "0" (b) ); + * ACE_reinterpret_cast (const unsigned int*, orig + 4); + asm ( "bswap %1" : "=r" (a) : "0" (a) ); + asm ( "bswap %1" : "=r" (b) : "0" (b) ); // We're little endian. - * ACE_reinterpret_cast(unsigned short*, target + 2) + * ACE_reinterpret_cast (unsigned short*, target + 2) = (unsigned short) (a & 0xffff); - * ACE_reinterpret_cast(unsigned short*, target + 6) + * ACE_reinterpret_cast (unsigned short*, target + 6) = (unsigned short) (b & 0xffff); - asm( "shrl $16, %1" : "=r" (a) : "0" (a) ); - asm( "shrl $16, %1" : "=r" (b) : "0" (b) ); - * ACE_reinterpret_cast(unsigned short*, target + 0) + asm ( "shrl $16, %1" : "=r" (a) : "0" (a) ); + asm ( "shrl $16, %1" : "=r" (b) : "0" (b) ); + * ACE_reinterpret_cast (unsigned short*, target + 0) = (unsigned short) (a & 0xffff); - * ACE_reinterpret_cast(unsigned short*, target + 4) + * ACE_reinterpret_cast (unsigned short*, target + 4) = (unsigned short) (b & 0xffff); -#elif defined(ACE_HAS_PENTIUM) \ - && (defined(_MSC_VER) || defined(__BORLANDC__)) \ - && !defined(ACE_LACKS_INLINE_ASSEMBLY) +#elif defined (ACE_HAS_PENTIUM) \ + && (defined (_MSC_VER) || defined (__BORLANDC__)) \ + && !defined (ACE_LACKS_INLINE_ASSEMBLY) __asm mov ecx, orig; __asm mov edx, target; __asm mov eax, [ecx]; @@ -163,34 +160,34 @@ ACE_CDR::swap_2_array (const char* orig, char* target, size_t n) #elif ACE_SIZEOF_LONG == 8 // 64 bit architecture. register unsigned long a = - * ACE_reinterpret_cast(const unsigned long*, orig); + * ACE_reinterpret_cast (const unsigned long*, orig); register unsigned long a1 = (a & 0x00ff00ff00ff00ffUL) << 8; register unsigned long a2 = (a & 0xff00ff00ff00ff00UL) >> 8; a = (a1 | a2); - ACE_UINT16 b1 = ACE_static_cast(ACE_UINT16, (a >> 48)); - ACE_UINT16 b2 = ACE_static_cast(ACE_UINT16, ((a >> 32) & 0xffff)); - ACE_UINT16 b3 = ACE_static_cast(ACE_UINT16, ((a >> 16) & 0xffff)); - ACE_UINT16 b4 = ACE_static_cast(ACE_UINT16, (a & 0xffff)); + ACE_UINT16 b1 = ACE_static_cast (ACE_UINT16, (a >> 48)); + ACE_UINT16 b2 = ACE_static_cast (ACE_UINT16, ((a >> 32) & 0xffff)); + ACE_UINT16 b3 = ACE_static_cast (ACE_UINT16, ((a >> 16) & 0xffff)); + ACE_UINT16 b4 = ACE_static_cast (ACE_UINT16, (a & 0xffff)); #if defined(ACE_LITTLE_ENDIAN) - * ACE_reinterpret_cast(ACE_UINT16*, target) = b4; - * ACE_reinterpret_cast(ACE_UINT16*, target + 2) = b3; - * ACE_reinterpret_cast(ACE_UINT16*, target + 4) = b2; - * ACE_reinterpret_cast(ACE_UINT16*, target + 6) = b1; + * ACE_reinterpret_cast (ACE_UINT16*, target) = b4; + * ACE_reinterpret_cast (ACE_UINT16*, target + 2) = b3; + * ACE_reinterpret_cast (ACE_UINT16*, target + 4) = b2; + * ACE_reinterpret_cast (ACE_UINT16*, target + 6) = b1; #else - * ACE_reinterpret_cast(ACE_UINT16*, target) = b1; - * ACE_reinterpret_cast(ACE_UINT16*, target + 2) = b2; - * ACE_reinterpret_cast(ACE_UINT16*, target + 4) = b3; - * ACE_reinterpret_cast(ACE_UINT16*, target + 6) = b4; + * ACE_reinterpret_cast (ACE_UINT16*, target) = b1; + * ACE_reinterpret_cast (ACE_UINT16*, target + 2) = b2; + * ACE_reinterpret_cast (ACE_UINT16*, target + 4) = b3; + * ACE_reinterpret_cast (ACE_UINT16*, target + 6) = b4; #endif #else register ACE_UINT32 a = - * ACE_reinterpret_cast(const ACE_UINT32*, orig); + * ACE_reinterpret_cast (const ACE_UINT32*, orig); register ACE_UINT32 b = - * ACE_reinterpret_cast(const ACE_UINT32*, orig + 4); + * ACE_reinterpret_cast (const ACE_UINT32*, orig + 4); register ACE_UINT32 a1 = (a & 0x00ff00ff) << 8; register ACE_UINT32 b1 = (b & 0x00ff00ff) << 8; @@ -200,21 +197,21 @@ ACE_CDR::swap_2_array (const char* orig, char* target, size_t n) a = (a1 | a2); b = (b1 | b2); - ACE_UINT32 c1 = ACE_static_cast(ACE_UINT16, (a >> 16)); - ACE_UINT32 c2 = ACE_static_cast(ACE_UINT16, (a & 0xffff)); - ACE_UINT32 c3 = ACE_static_cast(ACE_UINT16, (b >> 16)); - ACE_UINT32 c4 = ACE_static_cast(ACE_UINT16, (b & 0xffff)); + ACE_UINT32 c1 = ACE_static_cast (ACE_UINT16, (a >> 16)); + ACE_UINT32 c2 = ACE_static_cast (ACE_UINT16, (a & 0xffff)); + ACE_UINT32 c3 = ACE_static_cast (ACE_UINT16, (b >> 16)); + ACE_UINT32 c4 = ACE_static_cast (ACE_UINT16, (b & 0xffff)); #if defined(ACE_LITTLE_ENDIAN) - * ACE_reinterpret_cast(ACE_UINT16*, target) = c2; - * ACE_reinterpret_cast(ACE_UINT16*, target + 2) = c1; - * ACE_reinterpret_cast(ACE_UINT16*, target + 4) = c4; - * ACE_reinterpret_cast(ACE_UINT16*, target + 6) = c3; + * ACE_reinterpret_cast (ACE_UINT16*, target) = c2; + * ACE_reinterpret_cast (ACE_UINT16*, target + 2) = c1; + * ACE_reinterpret_cast (ACE_UINT16*, target + 4) = c4; + * ACE_reinterpret_cast (ACE_UINT16*, target + 6) = c3; #else - * ACE_reinterpret_cast(ACE_UINT16*, target) = c1; - * ACE_reinterpret_cast(ACE_UINT16*, target + 2) = c2; - * ACE_reinterpret_cast(ACE_UINT16*, target + 4) = c3; - * ACE_reinterpret_cast(ACE_UINT16*, target + 6) = c4; + * ACE_reinterpret_cast (ACE_UINT16*, target) = c1; + * ACE_reinterpret_cast (ACE_UINT16*, target + 2) = c2; + * ACE_reinterpret_cast (ACE_UINT16*, target + 4) = c3; + * ACE_reinterpret_cast (ACE_UINT16*, target + 6) = c4; #endif #endif @@ -277,9 +274,9 @@ ACE_CDR::swap_4_array (const char* orig, char* target, size_t n) while (orig < end) { register unsigned long a = - * ACE_reinterpret_cast(const long*, orig); + * ACE_reinterpret_cast (const long*, orig); register unsigned long b = - * ACE_reinterpret_cast(const long*, orig + 8); + * ACE_reinterpret_cast (const long*, orig + 8); register unsigned long a84 = (a & 0x000000ff000000ffL) << 24; register unsigned long b84 = (b & 0x000000ff000000ffL) << 24; @@ -293,8 +290,8 @@ ACE_CDR::swap_4_array (const char* orig, char* target, size_t n) a = (a84 | a73 | a62 | a51); b = (b84 | b73 | b62 | b51); - * ACE_reinterpret_cast(long*, target) = a; - * ACE_reinterpret_cast(long*, target + 8) = b; + * ACE_reinterpret_cast (long*, target) = a; + * ACE_reinterpret_cast (long*, target + 8) = b; orig += 16; target += 16; @@ -306,9 +303,9 @@ ACE_CDR::swap_4_array (const char* orig, char* target, size_t n) while (orig < end) { register unsigned long a = - * ACE_reinterpret_cast(const long*, orig); + * ACE_reinterpret_cast (const long*, orig); register unsigned long b = - * ACE_reinterpret_cast(const long*, orig + 8); + * ACE_reinterpret_cast (const long*, orig + 8); register unsigned long a84 = (a & 0x000000ff000000ffL) << 24; register unsigned long b84 = (b & 0x000000ff000000ffL) << 24; @@ -322,21 +319,21 @@ ACE_CDR::swap_4_array (const char* orig, char* target, size_t n) a = (a84 | a73 | a62 | a51); b = (b84 | b73 | b62 | b51); - ACE_UINT32 c1 = ACE_static_cast(ACE_UINT32, (a >> 32)); - ACE_UINT32 c2 = ACE_static_cast(ACE_UINT32, (a & 0xffffffff)); - ACE_UINT32 c3 = ACE_static_cast(ACE_UINT32, (b >> 32)); - ACE_UINT32 c4 = ACE_static_cast(ACE_UINT32, (b & 0xffffffff)); + ACE_UINT32 c1 = ACE_static_cast (ACE_UINT32, (a >> 32)); + ACE_UINT32 c2 = ACE_static_cast (ACE_UINT32, (a & 0xffffffff)); + ACE_UINT32 c3 = ACE_static_cast (ACE_UINT32, (b >> 32)); + ACE_UINT32 c4 = ACE_static_cast (ACE_UINT32, (b & 0xffffffff)); #if defined(ACE_LITTLE_ENDIAN) - * ACE_reinterpret_cast(ACE_UINT32*, target + 0) = c2; - * ACE_reinterpret_cast(ACE_UINT32*, target + 4) = c1; - * ACE_reinterpret_cast(ACE_UINT32*, target + 8) = c4; - * ACE_reinterpret_cast(ACE_UINT32*, target + 12) = c3; + * ACE_reinterpret_cast (ACE_UINT32*, target + 0) = c2; + * ACE_reinterpret_cast (ACE_UINT32*, target + 4) = c1; + * ACE_reinterpret_cast (ACE_UINT32*, target + 8) = c4; + * ACE_reinterpret_cast (ACE_UINT32*, target + 12) = c3; #else - * ACE_reinterpret_cast(ACE_UINT32*, target + 0) = c1; - * ACE_reinterpret_cast(ACE_UINT32*, target + 4) = c2; - * ACE_reinterpret_cast(ACE_UINT32*, target + 8) = c3; - * ACE_reinterpret_cast(ACE_UINT32*, target + 12) = c4; + * ACE_reinterpret_cast (ACE_UINT32*, target + 0) = c1; + * ACE_reinterpret_cast (ACE_UINT32*, target + 4) = c2; + * ACE_reinterpret_cast (ACE_UINT32*, target + 8) = c3; + * ACE_reinterpret_cast (ACE_UINT32*, target + 12) = c4; #endif orig += 16; target += 16; @@ -349,23 +346,23 @@ ACE_CDR::swap_4_array (const char* orig, char* target, size_t n) { #if defined(ACE_HAS_PENTIUM) && defined(__GNUG__) register unsigned int a = - *ACE_reinterpret_cast(const unsigned int*, orig); + *ACE_reinterpret_cast (const unsigned int*, orig); register unsigned int b = - *ACE_reinterpret_cast(const unsigned int*, orig + 4); + *ACE_reinterpret_cast (const unsigned int*, orig + 4); register unsigned int c = - *ACE_reinterpret_cast(const unsigned int*, orig + 8); + *ACE_reinterpret_cast (const unsigned int*, orig + 8); register unsigned int d = - *ACE_reinterpret_cast(const unsigned int*, orig + 12); + *ACE_reinterpret_cast (const unsigned int*, orig + 12); asm ("bswap %1" : "=r" (a) : "0" (a)); asm ("bswap %1" : "=r" (b) : "0" (b)); asm ("bswap %1" : "=r" (c) : "0" (c)); asm ("bswap %1" : "=r" (d) : "0" (d)); - *ACE_reinterpret_cast(unsigned int*, target) = a; - *ACE_reinterpret_cast(unsigned int*, target + 4) = b; - *ACE_reinterpret_cast(unsigned int*, target + 8) = c; - *ACE_reinterpret_cast(unsigned int*, target + 12) = d; + *ACE_reinterpret_cast (unsigned int*, target) = a; + *ACE_reinterpret_cast (unsigned int*, target + 4) = b; + *ACE_reinterpret_cast (unsigned int*, target + 8) = c; + *ACE_reinterpret_cast (unsigned int*, target + 12) = d; #elif defined(ACE_HAS_PENTIUM) \ && (defined(_MSC_VER) || defined(__BORLANDC__)) \ && !defined(ACE_LACKS_INLINE_ASSEMBLY) @@ -385,13 +382,13 @@ ACE_CDR::swap_4_array (const char* orig, char* target, size_t n) __asm mov 12[esi], eax #else register ACE_UINT32 a = - * ACE_reinterpret_cast(const ACE_UINT32*, orig); + * ACE_reinterpret_cast (const ACE_UINT32*, orig); register ACE_UINT32 b = - * ACE_reinterpret_cast(const ACE_UINT32*, orig + 4); + * ACE_reinterpret_cast (const ACE_UINT32*, orig + 4); register ACE_UINT32 c = - * ACE_reinterpret_cast(const ACE_UINT32*, orig + 8); + * ACE_reinterpret_cast (const ACE_UINT32*, orig + 8); register ACE_UINT32 d = - * ACE_reinterpret_cast(const ACE_UINT32*, orig + 12); + * ACE_reinterpret_cast (const ACE_UINT32*, orig + 12); // Expect the optimizer reordering this A LOT. // We leave it this way for clarity. @@ -400,10 +397,10 @@ ACE_CDR::swap_4_array (const char* orig, char* target, size_t n) c = (c << 24) | ((c & 0xff00) << 8) | ((c & 0xff0000) >> 8) | (c >> 24); d = (d << 24) | ((d & 0xff00) << 8) | ((d & 0xff0000) >> 8) | (d >> 24); - * ACE_reinterpret_cast(ACE_UINT32*, target) = a; - * ACE_reinterpret_cast(ACE_UINT32*, target + 4) = b; - * ACE_reinterpret_cast(ACE_UINT32*, target + 8) = c; - * ACE_reinterpret_cast(ACE_UINT32*, target + 12) = d; + * ACE_reinterpret_cast (ACE_UINT32*, target) = a; + * ACE_reinterpret_cast (ACE_UINT32*, target + 4) = b; + * ACE_reinterpret_cast (ACE_UINT32*, target + 8) = c; + * ACE_reinterpret_cast (ACE_UINT32*, target + 12) = d; #endif orig += 16; @@ -439,7 +436,7 @@ ACE_CDR::swap_8_array (const char* orig, char* target, size_t n) const char* const end = orig + 8*n; while (orig < end) { - swap_8(orig, target); + swap_8 (orig, target); orig += 8; target += 8; } @@ -453,12 +450,21 @@ ACE_CDR::swap_16_array (const char* orig, char* target, size_t n) const char* const end = orig + 16*n; while (orig < end) { - swap_16(orig, target); + swap_16 (orig, target); orig += 16; target += 16; } } +void +ACE_CDR::mb_align (ACE_Message_Block *mb) +{ + char *start = ACE_ptr_align_binary (mb->base (), + ACE_CDR::MAX_ALIGNMENT); + mb->rd_ptr (start); + mb->wr_ptr (start); +} + int ACE_CDR::grow (ACE_Message_Block *mb, size_t minsize) { @@ -545,6 +551,100 @@ ACE_CDR::LongLong::operator!= (const ACE_CDR::LongLong &rhs) const { return this->l != rhs.l || this->h != rhs.h; } + +int +ACE_CDR::LongLong::operator< (const ACE_CDR::LongLong &rhs) const +{ + return this->h < rhs.h && this->l < rhs.l; +} + +int +ACE_CDR::LongLong::operator<= (const ACE_CDR::LongLong &rhs) const +{ + return this->h <= rhs.h && this->l <= rhs.l; +} + +int +ACE_CDR::LongLong::operator> (const ACE_CDR::LongLong &rhs) const +{ + return this->h > rhs.h && this->l > rhs.l; +} + +int +ACE_CDR::LongLong::operator>= (const ACE_CDR::LongLong &rhs) const +{ + return this->h >= rhs.h && this->l >= rhs.l; +} + +int +ACE_CDR::LongLong::operator== (ACE_INT32 rhs) const +{ + // Do the right comparison based on the higher order bits. Those + // bits indicate whether or not this LongLong is positive or + // negative. + if ((this->h == 0 && rhs >= 0) || (this->h == 0xFFFFFFFF && rhs < 0)) + return this->l == rhs; + else + return 0; // *this and rhs have different signs, or *this + // contains value that cannot be represented with 32 + // bits alone. +} + +int +ACE_CDR::LongLong::operator!= (ACE_INT32 rhs) const +{ + // Do the right comparison based on the higher order bits. Those + // bits indicate whether or not this LongLong is positive or + // negative. + if ((this->h == 0 && rhs >= 0) || (this->h == 0xFFFFFFFF && rhs < 0)) + return this->l != rhs; + else + return 1; // *this and rhs have different signs, or *this + // contains a value that cannot be represented with 32 + // bits alone. +} + +int +ACE_CDR::LongLong::operator< (ACE_UINT32 rhs) const +{ + if (this->h > 0) + return 0; // 64 bit positive number + + else if (this->h < 0) + return 1; // 64 bit negative number + + else // this->h == 0 + return ACE_static_cast (ACE_UINT32, this->l) < rhs; // 32 bit + // positive + // number +} + +int +ACE_CDR::LongLong::operator<= (ACE_UINT32 rhs) const +{ + +} + +int +ACE_CDR::LongLong::operator> (ACE_UINT32 rhs) const +{ + if (this->h > 0) + return 1; // A positive number with greater than + + else if (this->h < 0) + return 0; // 64 bit negative number + + else // this->h == 0 + return ACE_static_cast (ACE_UINT32, this->l) > rhs; // 32 bit + // positive + // number +} + +int +ACE_CDR::LongLong::operator>= (ACE_UINT32 rhs) const +{ + return this->l >= rhs; +} #endif /* NONNATIVE_LONGLONG */ #if defined (NONNATIVE_LONGDOUBLE) @@ -563,22 +663,22 @@ ACE_CDR::LongDouble::operator!= (const ACE_CDR::LongDouble &rhs) const #if defined(_UNICOS) && !defined(_CRAYMPP) // placeholders to get things compiling -ACE_CDR::Float::Float() +ACE_CDR::Float::Float (void) { } -ACE_CDR::Float::Float(const float & init) +ACE_CDR::Float::Float (const float & /* init */) { } ACE_CDR::Float & -ACE_CDR::Float::operator= (const float &rhs) +ACE_CDR::Float::operator= (const float & /* rhs */) { return *this; } int -ACE_CDR::Float::operator!= (const ACE_CDR::Float &rhs) const +ACE_CDR::Float::operator!= (const ACE_CDR::Float & /* rhs */) const { return 0; } diff --git a/ace/CDR_Base.h b/ace/CDR_Base.h index 869708c1221..0a6326aa701 100644 --- a/ace/CDR_Base.h +++ b/ace/CDR_Base.h @@ -37,7 +37,10 @@ #endif /* ACE_LACKS_PRAGMA_ONCE */ #include "ace/Basic_Types.h" -#include "ace/Message_Block.h" +#include "ace/OS.h" + + +class ACE_Message_Block; /** * @class ACE_CDR @@ -163,10 +166,10 @@ public: // Green Hills C++68000 1.8.8 forces us into it. typedef unsigned long Boolean; # else /* ! (CHORUS && ghs 1.8.8) */ - typedef u_char Boolean; + typedef unsigned char Boolean; # endif /* ! (CHORUS && ghs 1.8.8) */ - typedef u_char Octet; + typedef unsigned char Octet; typedef char Char; typedef ACE_OS::WChar WChar; typedef ACE_INT16 Short; @@ -192,23 +195,43 @@ public: # endif /* sun */ # else /* no native 64 bit integer type */ # define NONNATIVE_LONGLONG + struct ACE_Export LongLong + { # if defined (ACE_BIG_ENDIAN) - struct ACE_Export LongLong - { ACE_CDR::Long h; - ACE_CDR::Long l; - int operator== (const LongLong &rhs) const; - int operator!= (const LongLong &rhs) const; - }; + ACE_CDR::Long l; # else - struct ACE_Export LongLong - { ACE_CDR::Long l; - ACE_CDR::Long h; + ACE_CDR::Long h; +# endif /* ! ACE_BIG_ENDIAN */ + + LongLong (const ACE_INT32); + LongLong (const ACE_UINT32); + + void operator= (ACE_CDR::Long rhs); + void operator= (ACE_CDR::ULong rhs); + + /** + * @name Overloaded Relation Operators. + * + * The canonical comparison operators. + */ + //@{ int operator== (const LongLong &rhs) const; int operator!= (const LongLong &rhs) const; + int operator< (const ACE_CDR::LongLong &) const; + int operator<= (const ACE_CDR::LongLong &) const; + int operator> (const ACE_CDR::LongLong &) const; + int operator>= (const ACE_CDR::LongLong &) const; + + int operator== (ACE_UINT32) const; + int operator!= (ACE_UINT32) const; + int operator< (ACE_UINT32) const; + int operator<= (ACE_UINT32) const; + int operator> (ACE_UINT32) const; + int operator>= (ACE_UINT32) const; + //@} }; -# endif /* ! ACE_BIG_ENDIAN */ # endif /* no native 64 bit integer type */ # if defined (NONNATIVE_LONGLONG) @@ -223,8 +246,8 @@ public: struct Float { # if ACE_SIZEOF_INT == 4 - // Use u_int to get word alignment. - u_int f; + // Use unsigned int to get word alignment. + unsigned int f; # else /* ACE_SIZEOF_INT != 4 */ // Applications will probably have trouble with this. char f[4]; @@ -244,8 +267,8 @@ public: struct Double { # if ACE_SIZEOF_LONG == 8 - // Use u_long to get word alignment. - u_long f; + // Use u long to get word alignment. + unsigned long f; # else /* ACE_SIZEOF_INT != 8 */ // Applications will probably have trouble with this. char f[8]; diff --git a/ace/CDR_Base.inl b/ace/CDR_Base.inl index bf0f8b8d878..b74a075f733 100644 --- a/ace/CDR_Base.inl +++ b/ace/CDR_Base.inl @@ -149,15 +149,6 @@ ACE_CDR::swap_16 (const char* orig, char* target) swap_8 (orig, target + 8); } -ACE_INLINE void -ACE_CDR::mb_align (ACE_Message_Block *mb) -{ - char *start = ACE_ptr_align_binary (mb->base (), - ACE_CDR::MAX_ALIGNMENT); - mb->rd_ptr (start); - mb->wr_ptr (start); -} - ACE_INLINE size_t ACE_CDR::first_size (size_t minsize) { @@ -203,3 +194,55 @@ ACE_CDR::next_size (size_t minsize) } // **************************************************************** + +#if defined (NONNATIVE_LONGLONG) +ACE_INLINE +ACE_CDR::LongLong::LongLong (ACE_INT32 l) +{ + *this = l; +} + +ACE_INLINE +ACE_CDR::LongLong::LongLong (ACE_UINT32 l) +{ + *this = l; +} + +ACE_INLINE void +ACE_CDR::LongLong::operator= (ACE_CDR::Long rhs) +{ + // Take into account the 2's complement when storing the signed 32 + // bit integer. + if (rhs >= 0) + { + this->l = rhs; + this->h = 0; + } + else + { + this->l = rhs; + this->h = 0xFFFFFFFF; + } +} + +ACE_INLINE void +ACE_CDR::LongLong::operator= (ACE_CDR::ULong rhs) +{ + // When storing the unsigned long value be careful to prevent + // overflow. + if (rhs <= ACE_static_cast (ACE_CDR::ULong, ACE_INT32_MAX)) + { + this->l = ACE_static_cast (ACE_CDR::Long, rhs); + this->h = 0; + } + else + { + // 2's complement since this structure represents a signed + // "long long" value. + this->l = 0; + this->h = rhs - ACE_INT32_MAX; + } +} +#endif /* NONNATIVE_LONGLONG */ + +// **************************************************************** diff --git a/ace/CDR_Stream.h b/ace/CDR_Stream.h index 8ef367055a6..0cb741a6d5c 100644 --- a/ace/CDR_Stream.h +++ b/ace/CDR_Stream.h @@ -44,6 +44,17 @@ #include "ace/SString.h" #include "ace/Message_Block.h" + +// Stuff used by the ACE CDR classes. +#if defined ACE_LITTLE_ENDIAN +# define ACE_CDR_BYTE_ORDER 1 +// little endian encapsulation byte order has value = 1 +#else /* ! ACE_LITTLE_ENDIAN */ +# define ACE_CDR_BYTE_ORDER 0 +// big endian encapsulation byte order has value = 0 +#endif /* ! ACE_LITTLE_ENDIAN */ + + class ACE_Char_Codeset_Translator; class ACE_WChar_Codeset_Translator; diff --git a/ace/Capabilities.cpp b/ace/Capabilities.cpp index 9257178d486..9f5db74fc7d 100644 --- a/ace/Capabilities.cpp +++ b/ace/Capabilities.cpp @@ -1,6 +1,3 @@ -// $Id$ - -#include "ace/Map_Manager.h" #include "ace/Capabilities.h" #include "ace/Log_Msg.h" @@ -8,13 +5,21 @@ #include "ace/Capabilities.i" #endif /* !__ACE_INLINE__ */ + +ACE_RCSID (ace, + Capabilities, + "$Id$") + + #define ACE_ESC ((ACE_TCHAR)0x1b) + ACE_CapEntry::~ACE_CapEntry (void) { } ACE_Capabilities::ACE_Capabilities (void) + : caps_ () { } @@ -94,17 +99,17 @@ ACE_Capabilities::parse (const ACE_TCHAR *buf, int &cap) void ACE_Capabilities::resetcaps (void) { - for (ACE_Hash_Map_Iterator<ACE_TString, ACE_CapEntry *, ACE_Null_Mutex> iter (caps_); + for (MAP::ITERATOR iter (this->caps_); !iter.done (); iter.advance ()) { - ACE_Hash_Map_Entry<ACE_TString,ACE_CapEntry*> *entry; + MAP::ENTRY *entry; iter.next (entry); delete entry->int_id_; } - caps_.close (); - caps_.open (); + this->caps_.close (); + this->caps_.open (); } int @@ -147,7 +152,7 @@ ACE_Capabilities::fillent (const ACE_TCHAR *buf) ACE_NEW_RETURN (ce, ACE_StringCapEntry (s), -1); - if (caps_.bind (name, ce) == -1) + if (this->caps_.bind (name, ce) == -1) { delete ce; return -1; @@ -159,7 +164,7 @@ ACE_Capabilities::fillent (const ACE_TCHAR *buf) ACE_NEW_RETURN (ce, ACE_IntCapEntry (n), -1); - if (caps_.bind (name, ce) == -1) + if (this->caps_.bind (name, ce) == -1) { delete ce; return -1; @@ -170,7 +175,7 @@ ACE_Capabilities::fillent (const ACE_TCHAR *buf) ACE_NEW_RETURN (ce, ACE_BoolCapEntry (1), -1); - if (caps_.bind (name, ce) == -1) + if (this->caps_.bind (name, ce) == -1) { delete ce; return -1; @@ -242,7 +247,7 @@ int ACE_Capabilities::getval (const ACE_TCHAR *keyname, ACE_TString &val) { ACE_CapEntry* cap; - if (caps_.find (keyname, cap) == -1) + if (this->caps_.find (keyname, cap) == -1) return -1; ACE_StringCapEntry *scap = @@ -258,7 +263,7 @@ int ACE_Capabilities::getval (const ACE_TCHAR *keyname, int &val) { ACE_CapEntry *cap; - if (caps_.find (keyname, cap) == -1) + if (this->caps_.find (keyname, cap) == -1) return -1; ACE_IntCapEntry *icap = @@ -344,9 +349,6 @@ ACE_Capabilities::getent (const ACE_TCHAR *fname, const ACE_TCHAR *name) } #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -template class ACE_Hash_Map_Manager<ACE_TString,ACE_CapEntry*,ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator<ACE_TString,ACE_CapEntry*,ACE_Null_Mutex>; -template class ACE_Hash_Map_Reverse_Iterator<ACE_TString,ACE_CapEntry*,ACE_Null_Mutex>; template class ACE_Hash_Map_Entry<ACE_TString,ACE_CapEntry*>; template class ACE_Hash_Map_Manager_Ex<ACE_TString,ACE_CapEntry*,ACE_Hash<ACE_TString>,ACE_Equal_To<ACE_TString>,ACE_Null_Mutex>; template class ACE_Hash_Map_Iterator_Base_Ex<ACE_TString,ACE_CapEntry*,ACE_Hash<ACE_TString>,ACE_Equal_To<ACE_TString>,ACE_Null_Mutex>; @@ -355,9 +357,6 @@ template class ACE_Hash_Map_Reverse_Iterator_Ex<ACE_TString,ACE_CapEntry*,ACE_Ha template class ACE_Hash<ACE_TString>; template class ACE_Equal_To<ACE_TString>; #elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) -#pragma instantiate ACE_Hash_Map_Manager<ACE_TString,ACE_CapEntry*,ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Iterator<ACE_TString,ACE_CapEntry*,ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Reverse_Iterator<ACE_TString,ACE_CapEntry*,ACE_Null_Mutex> #pragma instantiate ACE_Hash_Map_Entry<ACE_TString,ACE_CapEntry*> #pragma instantiate ACE_Hash_Map_Manager_Ex<ACE_TString,ACE_CapEntry*,ACE_Hash<ACE_TString>,ACE_Equal_To<ACE_TString>,ACE_Null_Mutex> #pragma instantiate ACE_Hash_Map_Iterator_Base_Ex<ACE_TString,ACE_CapEntry*,ACE_Hash<ACE_TString>,ACE_Equal_To<ACE_TString>,ACE_Null_Mutex> diff --git a/ace/Capabilities.h b/ace/Capabilities.h index 4ddec4bb40f..550a2fb71c2 100644 --- a/ace/Capabilities.h +++ b/ace/Capabilities.h @@ -22,7 +22,7 @@ #endif /* ACE_LACKS_PRAGMA_ONCE */ #include "ace/Synch.h" -#include "ace/Hash_Map_Manager.h" +#include "ace/Hash_Map_Manager_T.h" #include "ace/Containers.h" #include "ace/SString.h" @@ -33,15 +33,17 @@ * subclasses. * * This class is not instantiable and does not provide accessors - * or methods. If you want to add a new kind of attribute you - * subclasses of this class and dynamic cast to proper subclass. + * or methods. If you want to add a new kind of attribute subclass + * this class and dynamic_cast to proper subclass. */ class ACE_Export ACE_CapEntry { public: + virtual ~ACE_CapEntry (void); protected: + enum { ACE_INTCAP = 0, @@ -51,7 +53,10 @@ protected: ACE_CapEntry (int captype); +protected: + int captype_; + }; /** @@ -126,6 +131,9 @@ protected: class ACE_Export ACE_Capabilities { public: + + typedef ACE_Hash_Map_Manager_Ex<ACE_TString, ACE_CapEntry *, ACE_Hash<ACE_TString>, ACE_Equal_To<ACE_TString>, ACE_Null_Mutex> MAP; + /// The Constructor ACE_Capabilities (void); @@ -133,6 +141,7 @@ public: ~ACE_Capabilities(void); public: + /// Get a string entry. int getval (const ACE_TCHAR *ent, ACE_TString &val); @@ -144,6 +153,7 @@ public: int getent (const ACE_TCHAR *fname, const ACE_TCHAR *name); protected: + /// Parse an integer property const ACE_TCHAR *parse (const ACE_TCHAR *buf, int &cap); @@ -166,10 +176,11 @@ protected: /// Reset the set of capabilities void resetcaps (void); - /// Attributes private: + /// This is the set of ACE_CapEntry. - ACE_Hash_Map_Manager<ACE_TString, ACE_CapEntry *, ACE_Null_Mutex> caps_; + MAP caps_; + }; #if defined (ACE_IS_SPLITTING) diff --git a/ace/Capabilities.i b/ace/Capabilities.i index d34d0e08862..ca168c0491a 100644 --- a/ace/Capabilities.i +++ b/ace/Capabilities.i @@ -1,4 +1,5 @@ -/* -*- C++ -*- */ +// -*- C++ -*- +// // $Id$ ACE_INLINE @@ -23,7 +24,7 @@ ACE_IntCapEntry::getval (void) const ACE_INLINE ACE_StringCapEntry::ACE_StringCapEntry (const ACE_TString &val) : ACE_CapEntry (ACE_STRINGCAP), - val_(val) + val_ (val) { } diff --git a/ace/Configuration.cpp b/ace/Configuration.cpp index 3b8e9a6164b..19b454d0a22 100644 --- a/ace/Configuration.cpp +++ b/ace/Configuration.cpp @@ -37,9 +37,6 @@ template class ACE_Hash<ACE_Configuration_ExtId>; template class ACE_Hash_Map_Manager_Ex<ACE_Configuration_ExtId, ACE_Configuration_Section_IntId, ACE_Hash<ACE_Configuration_ExtId>, ACE_Equal_To<ACE_Configuration_ExtId>, ACE_Null_Mutex>; template class ACE_Hash_Map_Manager_Ex<ACE_Configuration_ExtId, ACE_Configuration_Value_IntId, ACE_Hash<ACE_Configuration_ExtId>, ACE_Equal_To<ACE_Configuration_ExtId>, ACE_Null_Mutex>; template class ACE_Hash_Map_Manager_Ex<ACE_Configuration_ExtId, int, ACE_Hash<ACE_Configuration_ExtId>, ACE_Equal_To<ACE_Configuration_ExtId>, ACE_Null_Mutex>; -template class ACE_Hash_Map_Manager<ACE_Configuration_ExtId, ACE_Configuration_Section_IntId, ACE_Null_Mutex>; -template class ACE_Hash_Map_Manager<ACE_Configuration_ExtId, ACE_Configuration_Value_IntId, ACE_Null_Mutex>; -template class ACE_Hash_Map_Manager<ACE_Configuration_ExtId, int, ACE_Null_Mutex>; template class ACE_Hash_Map_With_Allocator<ACE_Configuration_ExtId, ACE_Configuration_Section_IntId>; template class ACE_Hash_Map_With_Allocator<ACE_Configuration_ExtId, ACE_Configuration_Value_IntId>; template class ACE_Hash_Map_With_Allocator<ACE_Configuration_ExtId, int>; @@ -73,9 +70,6 @@ template class ACE_Hash_Map_With_Allocator<ACE_Configuration_ExtId, int>; #pragma instantiate ACE_Hash_Map_Manager_Ex<ACE_Configuration_ExtId, ACE_Configuration_Section_IntId, ACE_Hash<ACE_Configuration_ExtId>, ACE_Equal_To<ACE_Configuration_ExtId>, ACE_Null_Mutex> #pragma instantiate ACE_Hash_Map_Manager_Ex<ACE_Configuration_ExtId, ACE_Configuration_Value_IntId, ACE_Hash<ACE_Configuration_ExtId>, ACE_Equal_To<ACE_Configuration_ExtId>, ACE_Null_Mutex> #pragma instantiate ACE_Hash_Map_Manager_Ex<ACE_Configuration_ExtId, int, ACE_Hash<ACE_Configuration_ExtId>, ACE_Equal_To<ACE_Configuration_ExtId>, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Manager<ACE_Configuration_ExtId, ACE_Configuration_Section_IntId, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Manager<ACE_Configuration_ExtId, ACE_Configuration_Value_IntId, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Manager<ACE_Configuration_ExtId, int, ACE_Null_Mutex> #pragma instantiate ACE_Hash_Map_With_Allocator<ACE_Configuration_ExtId, ACE_Configuration_Section_IntId> #pragma instantiate ACE_Hash_Map_With_Allocator<ACE_Configuration_ExtId, ACE_Configuration_Value_IntId> #pragma instantiate ACE_Hash_Map_With_Allocator<ACE_Configuration_ExtId, int> @@ -1621,7 +1615,7 @@ ACE_Configuration_Heap::remove_section (const ACE_Configuration_Section_Key& key section += sub_section; ACE_Configuration_ExtId SectionExtId (section.fast_rep ()); - SECTION_ENTRY* section_entry; + SECTION_HASH::ENTRY* section_entry; SECTION_HASH* hashmap = index_; if (hashmap->find (SectionExtId, section_entry)) return -1; @@ -1652,7 +1646,7 @@ ACE_Configuration_Heap::remove_section (const ACE_Configuration_Section_Key& key // Now remove subkey from parent key ACE_Configuration_ExtId SubSExtId (sub_section); - SUBSECTION_ENTRY* subsection_entry; + SUBSECTION_HASH::ENTRY* subsection_entry; if (((SUBSECTION_HASH*)ParentIntId.section_hash_map_)-> find (SubSExtId, subsection_entry)) return -1; @@ -1671,7 +1665,7 @@ ACE_Configuration_Heap::remove_section (const ACE_Configuration_Section_Key& key VALUE_HASH::ITERATOR value_iter = value_hash_map->begin (); while (!value_iter.done ()) { - VALUE_ENTRY* value_entry; + VALUE_HASH::ENTRY* value_entry; if (!value_iter.next (value_entry)) return 1; @@ -1803,7 +1797,7 @@ ACE_Configuration_Heap::set_string_value (const ACE_Configuration_Section_Key& k return -1; // Get the entry for this item (if it exists) - VALUE_ENTRY* entry; + VALUE_HASH::ENTRY* entry; ACE_Configuration_ExtId item_name (name); if (section_int.value_hash_map_->VALUE_HASH::find (item_name, entry) == 0) { @@ -1861,7 +1855,7 @@ ACE_Configuration_Heap::set_integer_value (const ACE_Configuration_Section_Key& return -1; // section does not exist // Get the entry for this item (if it exists) - VALUE_ENTRY* entry; + VALUE_HASH::ENTRY* entry; ACE_Configuration_ExtId item_name (name); if (section_int.value_hash_map_->VALUE_HASH::find (item_name, entry) == 0) { @@ -1910,7 +1904,7 @@ ACE_Configuration_Heap::set_binary_value (const ACE_Configuration_Section_Key& k return -1; // section does not exist // Get the entry for this item (if it exists) - VALUE_ENTRY* entry; + VALUE_HASH::ENTRY* entry; ACE_Configuration_ExtId item_name (name); if (section_int.value_hash_map_->VALUE_HASH::find (item_name, entry) == 0) { @@ -2124,7 +2118,7 @@ ACE_Configuration_Heap::find_value (const ACE_Configuration_Section_Key& key, // Find it ACE_Configuration_ExtId ValueExtId (name); - VALUE_ENTRY* value_entry; + VALUE_HASH::ENTRY* value_entry; if (((VALUE_HASH *) IntId.value_hash_map_)->find (ValueExtId, value_entry)) return -1; // value does not exist @@ -2153,7 +2147,7 @@ ACE_Configuration_Heap::remove_value (const ACE_Configuration_Section_Key& key, // Find it ACE_Configuration_ExtId ValueExtId (name); - VALUE_ENTRY* value_entry; + VALUE_HASH::ENTRY* value_entry; if (((VALUE_HASH *) IntId.value_hash_map_)->find (ValueExtId, value_entry)) return -1; diff --git a/ace/Configuration.h b/ace/Configuration.h index 64b8e6ba28c..1932e84dcb5 100644 --- a/ace/Configuration.h +++ b/ace/Configuration.h @@ -601,8 +601,9 @@ typedef ACE_Hash_Map_Manager_Ex<ACE_Configuration_ExtId, ACE_Equal_To<ACE_Configuration_ExtId>, ACE_Null_Mutex> SUBSECTION_HASH; -typedef ACE_Hash_Map_Entry<ACE_Configuration_ExtId, int> - SUBSECTION_ENTRY; + +// Deprecated typedef. Use the SUBSECTION_HASH::ENTRY trait instead. +typedef SUBSECTION_HASH::ENTRY SUBSECTION_ENTRY; /** * @class ACE_Configuration_Value_IntId @@ -662,9 +663,9 @@ typedef ACE_Hash_Map_Manager_Ex<ACE_Configuration_ExtId, ACE_Equal_To<ACE_Configuration_ExtId>, ACE_Null_Mutex> VALUE_HASH; -typedef ACE_Hash_Map_Entry<ACE_Configuration_ExtId, - ACE_Configuration_Value_IntId> - VALUE_ENTRY; + +// Deprecated typedef. Use the VALUE_HASH::ENTRY trait instead. +typedef VALUE_HASH::ENTRY VALUE_ENTRY; /** * @class ACE_Configuration_Section_IntId @@ -711,9 +712,9 @@ typedef ACE_Hash_Map_Manager_Ex<ACE_Configuration_ExtId, ACE_Equal_To<ACE_Configuration_ExtId>, ACE_Null_Mutex> SECTION_HASH; -typedef ACE_Hash_Map_Entry<ACE_Configuration_ExtId, - ACE_Configuration_Section_IntId> - SECTION_ENTRY; + +// Deprecated typedef. Use the SECTION_HASH::ENTRY trait instead. +typedef SECTION_HASH::ENTRY SECTION_ENTRY; /** * @class ACE_Configuration_Section_Key_Heap diff --git a/ace/Connector.cpp b/ace/Connector.cpp index 511db1e662b..2e00fac20c7 100644 --- a/ace/Connector.cpp +++ b/ace/Connector.cpp @@ -1,16 +1,16 @@ -// Connector.cpp -// $Id$ - -#ifndef ACE_CONNECTOR_C -#define ACE_CONNECTOR_C +#ifndef ACE_CONNECTOR_CPP +#define ACE_CONNECTOR_CPP #include "ace/Connector.h" +#include "ace/Svc_Handler.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -ACE_RCSID(ace, Connector, "$Id$") +ACE_RCSID (ace, + Connector, + "$Id$") ACE_ALLOC_HOOK_DEFINE(ACE_Connector) diff --git a/ace/Connector.h b/ace/Connector.h index 2c938c8a2a5..8fd528e383a 100644 --- a/ace/Connector.h +++ b/ace/Connector.h @@ -15,16 +15,16 @@ #include "ace/pre.h" -#include "ace/Service_Config.h" +#include "ace/Service_Object.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "ace/Service_Object.h" #include "ace/Map_Manager.h" -#include "ace/Svc_Handler.h" #include "ace/Strategies_T.h" +#include "ace/Synch_Options.h" + /** * @class ACE_Svc_Tuple diff --git a/ace/Copy_Disabled.h b/ace/Copy_Disabled.h index 4fca4e2b3e4..d408c013b86 100644 --- a/ace/Copy_Disabled.h +++ b/ace/Copy_Disabled.h @@ -57,4 +57,4 @@ private: #include "ace/post.h" -#endif /* ACE_FUNCTOR_H */ +#endif /* ACE_COPY_DISABLED_H */ diff --git a/ace/Default_Constants.h b/ace/Default_Constants.h index 4bfc3ecdadb..37f35c34fba 100644 --- a/ace/Default_Constants.h +++ b/ace/Default_Constants.h @@ -345,8 +345,41 @@ // Max size of an ACE Token client ID. # define ACE_MAXCLIENTIDLEN MAXHOSTNAMELEN + 20 - - +/** + * @name Default values to control CDR classes memory allocation strategies + */ +//@{ + +/// Control the initial size of all CDR buffers, application +/// developers may want to optimize this value to fit their request +/// size +#if !defined (ACE_DEFAULT_CDR_BUFSIZE) +# define ACE_DEFAULT_CDR_BUFSIZE 512 +#endif /* ACE_DEFAULT_CDR_BUFSIZE */ + +/// Stop exponential growth of CDR buffers to avoid overallocation +#if !defined (ACE_DEFAULT_CDR_EXP_GROWTH_MAX) +# define ACE_DEFAULT_CDR_EXP_GROWTH_MAX 65536 +#endif /* ACE_DEFAULT_CDR_EXP_GROWTH_MAX */ + +/// Control CDR buffer growth after maximum exponential growth is +/// reached +#if !defined (ACE_DEFAULT_CDR_LINEAR_GROWTH_CHUNK) +# define ACE_DEFAULT_CDR_LINEAR_GROWTH_CHUNK 65536 +#endif /* ACE_DEFAULT_CDR_LINEAR_GROWTH_CHUNK */ +//@} + +/// Control the zero-copy optimizations for octet sequences +/** + * Large octet sequences can be sent without any copies by chaining + * them in the list of message blocks that represent a single CDR + * stream. However, if the octet sequence is too small the zero copy + * optimizations actually hurt performance. Octet sequences smaller + * than this value will be copied. + */ +#if !defined (ACE_DEFAULT_CDR_MEMCPY_TRADEOFF) +#define ACE_DEFAULT_CDR_MEMCPY_TRADEOFF 256 +#endif /* ACE_DEFAULT_CDR_MEMCPY_TRADEOFF */ #include "ace/post.h" diff --git a/ace/Dynamic_Service_Base.cpp b/ace/Dynamic_Service_Base.cpp index 6bcc87ad1ec..ab4b1bc5a62 100644 --- a/ace/Dynamic_Service_Base.cpp +++ b/ace/Dynamic_Service_Base.cpp @@ -1,11 +1,14 @@ -// $Id$ - #include "ace/Dynamic_Service_Base.h" #include "ace/Service_Config.h" #include "ace/Service_Repository.h" +#include "ace/Service_Types.h" #include "ace/Log_Msg.h" -ACE_RCSID(ace, Dynamic_Service_Base, "$Id$") + +ACE_RCSID (ace, + Dynamic_Service_Base, + "$Id$") + void ACE_Dynamic_Service_Base::dump (void) const diff --git a/ace/Filecache.cpp b/ace/Filecache.cpp index 8f1311823e9..cd41b9f8e46 100644 --- a/ace/Filecache.cpp +++ b/ace/Filecache.cpp @@ -136,7 +136,7 @@ ACE_Filecache_Handle::size (void) const #if defined (ACE_HAS_TEMPLATE_SPECIALIZATION) #define ACE_Filecache_Hash \ - ACE_Hash_Map_Manager<const ACE_TCHAR *, ACE_Filecache_Object *, ACE_Null_Mutex> + ACE_Hash_Map_Manager_Ex<const ACE_TCHAR *, ACE_Filecache_Object *, ACE_Hash<const ACE_TCHAR *>, ACE_Equal_To<const ACE_TCHAR *>, ACE_Null_Mutex> #define ACE_Filecache_Hash_Entry \ ACE_Hash_Map_Entry<const ACE_TCHAR *, ACE_Filecache_Object *> @@ -741,18 +741,12 @@ ACE_Filecache_Object::update (void) const #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) #if defined (ACE_HAS_TEMPLATE_SPECIALIZATION) template class ACE_Hash_Map_Entry<const ACE_TCHAR *, ACE_Filecache_Object *>; -template class ACE_Hash_Map_Manager<const ACE_TCHAR *, ACE_Filecache_Object *, ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator<const ACE_TCHAR *, ACE_Filecache_Object *, ACE_Null_Mutex>; -template class ACE_Hash_Map_Reverse_Iterator<const ACE_TCHAR *, ACE_Filecache_Object *, ACE_Null_Mutex>; template class ACE_Hash_Map_Manager_Ex<const ACE_TCHAR *, ACE_Filecache_Object *, ACE_Hash<const ACE_TCHAR *>, ACE_Equal_To<const ACE_TCHAR *>, ACE_Null_Mutex>; template class ACE_Hash_Map_Iterator_Base_Ex<const ACE_TCHAR *, ACE_Filecache_Object *, ACE_Hash<const ACE_TCHAR *>, ACE_Equal_To<const ACE_TCHAR *>, ACE_Null_Mutex>; template class ACE_Hash_Map_Iterator_Ex<const ACE_TCHAR *, ACE_Filecache_Object *, ACE_Hash<const ACE_TCHAR *>, ACE_Equal_To<const ACE_TCHAR *>, ACE_Null_Mutex>; template class ACE_Hash_Map_Reverse_Iterator_Ex<const ACE_TCHAR *, ACE_Filecache_Object *, ACE_Hash<const ACE_TCHAR *>, ACE_Equal_To<const ACE_TCHAR *>, ACE_Null_Mutex>; #else template class ACE_Hash_Map_Entry<ACE_TString, ACE_Filecache_Object *>; -template class ACE_Hash_Map_Manager<ACE_TString, ACE_Filecache_Object *, ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator<ACE_TString, ACE_Filecache_Object *, ACE_Null_Mutex>; -template class ACE_Hash_Map_Reverse_Iterator<ACE_TString, ACE_Filecache_Object *, ACE_Null_Mutex>; template class ACE_Hash_Map_Manager_Ex<ACE_TString, ACE_Filecache_Object *, ACE_Hash<ACE_TString>, ACE_Equal_To<ACE_TString>, ACE_Null_Mutex>; template class ACE_Hash_Map_Iterator_Base_Ex<ACE_TString, ACE_Filecache_Object *, ACE_Hash<ACE_TString>, ACE_Equal_To<ACE_TString>, ACE_Null_Mutex>; template class ACE_Hash_Map_Iterator_Ex<ACE_TString, ACE_Filecache_Object *, ACE_Hash<ACE_TString>, ACE_Equal_To<ACE_TString>, ACE_Null_Mutex>; @@ -761,18 +755,12 @@ template class ACE_Hash_Map_Reverse_Iterator_Ex<ACE_TString, ACE_Filecache_Objec #elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) #if defined (ACE_HAS_TEMPLATE_SPECIALIZATION) #pragma instantiate ACE_Hash_Map_Entry<const ACE_TCHAR *, ACE_Filecache_Object *> -#pragma instantiate ACE_Hash_Map_Manager<const ACE_TCHAR *, ACE_Filecache_Object *, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Iterator<const ACE_TCHAR *, ACE_Filecache_Object *, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Reverse_Iterator<const ACE_TCHAR *, ACE_Filecache_Object *, ACE_Null_Mutex> #pragma instantiate ACE_Hash_Map_Manager_Ex<const ACE_TCHAR *, ACE_Filecache_Object *, ACE_Hash<const ACE_TCHAR *>, ACE_Equal_To<const ACE_TCHAR *>, ACE_Null_Mutex> #pragma instantiate ACE_Hash_Map_Iterator_Base_Ex<const ACE_TCHAR *, ACE_Filecache_Object *, ACE_Hash<const ACE_TCHAR *>, ACE_Equal_To<const ACE_TCHAR *>, ACE_Null_Mutex> #pragma instantiate ACE_Hash_Map_Iterator_Ex<const ACE_TCHAR *, ACE_Filecache_Object *, ACE_Hash<const ACE_TCHAR *>, ACE_Equal_To<const ACE_TCHAR *>, ACE_Null_Mutex> #pragma instantiate ACE_Hash_Map_Reverse_Iterator_Ex<const ACE_TCHAR *, ACE_Filecache_Object *, ACE_Hash<const ACE_TCHAR *>, ACE_Equal_To<const ACE_TCHAR *>, ACE_Null_Mutex> #else #pragma instantiate ACE_Hash_Map_Entry<ACE_TString, ACE_Filecache_Object *> -#pragma instantiate ACE_Hash_Map_Manager<ACE_TString, ACE_Filecache_Object *, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Iterator<ACE_TString, ACE_Filecache_Object *, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Reverse_Iterator<ACE_TString, ACE_Filecache_Object *, ACE_Null_Mutex> #pragma instantiate ACE_Hash_Map_Manager_Ex<ACE_TString, ACE_Filecache_Object *, ACE_Hash<ACE_TString>, ACE_Equal_To<ACE_TString>, ACE_Null_Mutex> #pragma instantiate ACE_Hash_Map_Iterator_Base_Ex<ACE_TString, ACE_Filecache_Object *, ACE_Hash<ACE_TString>, ACE_Equal_To<ACE_TString>, ACE_Null_Mutex> #pragma instantiate ACE_Hash_Map_Iterator_Ex<ACE_TString, ACE_Filecache_Object *, ACE_Hash<ACE_TString>, ACE_Equal_To<ACE_TString>, ACE_Null_Mutex> diff --git a/ace/Filecache.h b/ace/Filecache.h index 78bedd38a64..0bcd8264b79 100644 --- a/ace/Filecache.h +++ b/ace/Filecache.h @@ -1,4 +1,4 @@ -/* -*- c++ -*- */ +// -*- C++ -*- //============================================================================= /** @@ -13,6 +13,7 @@ #ifndef ACE_FILECACHE_H #define ACE_FILECACHE_H + #include "ace/pre.h" #include "ace/Mem_Map.h" @@ -22,7 +23,7 @@ #endif /* ACE_LACKS_PRAGMA_ONCE */ #include "ace/Synch_T.h" -#include "ace/Hash_Map_Manager.h" +#include "ace/Hash_Map_Manager_T.h" #include "ace/SString.h" enum ACE_Filecache_Flag @@ -145,19 +146,22 @@ private: }; #if defined (ACE_HAS_TEMPLATE_SPECIALIZATION) -typedef ACE_Hash_Map_Entry<const ACE_TCHAR *, ACE_Filecache_Object *> - ACE_Filecache_Hash_Entry; -typedef ACE_Hash_Map_Manager<const ACE_TCHAR *, ACE_Filecache_Object *, ACE_Null_Mutex> +typedef ACE_Hash_Map_Manager_Ex<const ACE_TCHAR *, ACE_Filecache_Object *, ACE_Hash<const ACE_TCHAR *>, ACE_Equal_To<const ACE_TCHAR *>, ACE_Null_Mutex> ACE_Filecache_Hash; + +typedef ACE_Hash_Map_Entry<const ACE_TCHAR *, ACE_Filecache_Object *> ACE_Filecache_Hash_Entry; + #else -typedef ACE_Hash_Map_Entry<ACE_TString, ACE_Filecache_Object *> - ACE_Filecache_Hash_Entry; -typedef ACE_Hash_Map_Manager<ACE_TString, ACE_Filecache_Object *, ACE_Null_Mutex> +typedef ACE_Hash_Map_Manager_Ex<ACE_TString, ACE_Filecache_Object *, ACE_Hash<ACE_TString>, ACE_Equal_To<ACE_TString>, ACE_Null_Mutex> ACE_Filecache_Hash; + +typedef ACE_Filecache_Hash::ENTRY ACE_Filecache_Hash_Entry; + #endif /* ACE_HAS_TEMPLATE_SPECIALIZATION */ + /** * @class ACE_Filecache * @@ -352,4 +356,5 @@ private: #include "ace/post.h" + #endif /* ACE_FILECACHE_H */ diff --git a/ace/Future_Set.h b/ace/Future_Set.h index d440b88efae..14ad83245bd 100644 --- a/ace/Future_Set.h +++ b/ace/Future_Set.h @@ -17,7 +17,7 @@ #include "ace/Thread.h" #include "ace/Message_Queue.h" #include "ace/Future.h" -#include "ace/Hash_Map_Manager.h" +#include "ace/Hash_Map_Manager_T.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) #pragma once diff --git a/ace/Hash_Map_Manager_T.i b/ace/Hash_Map_Manager_T.i index e3b8372440b..6c6dc935db8 100644 --- a/ace/Hash_Map_Manager_T.i +++ b/ace/Hash_Map_Manager_T.i @@ -582,7 +582,7 @@ ACE_Hash_Map_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>::oper ACE_TRACE ("ACE_Hash_Map_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>::operator++ (int)"); ACE_Hash_Map_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> retv (*this); - this->forward_i (); + ++*this; return retv; } @@ -603,7 +603,7 @@ ACE_Hash_Map_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>::oper ACE_TRACE ("ACE_Hash_Map_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>::operator-- (int)"); ACE_Hash_Map_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> retv (*this); - this->reverse_i (); + --*this; return retv; } @@ -652,7 +652,7 @@ ACE_Hash_Map_Const_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> ACE_TRACE ("ACE_Hash_Map_Const_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>::operator++ (int)"); ACE_Hash_Map_Const_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> retv (*this); - this->forward_i (); + ++*this; return retv; } @@ -673,7 +673,7 @@ ACE_Hash_Map_Const_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> ACE_TRACE ("ACE_Hash_Map_Const_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>::operator-- (int)"); ACE_Hash_Map_Const_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> retv (*this); - this->reverse_i (); + --*this; return retv; } @@ -709,7 +709,7 @@ ACE_Hash_Map_Bucket_Iterator<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>:: ACE_TRACE ("ACE_Hash_Map_Bucket_Iterator<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>::operator++ (int)"); ACE_Hash_Map_Bucket_Iterator<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> retv (*this); - this->forward_i (); + ++*this; return retv; } @@ -730,7 +730,7 @@ ACE_Hash_Map_Bucket_Iterator<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>:: ACE_TRACE ("ACE_Hash_Map_Bucket_Iterator<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>::operator-- (int)"); ACE_Hash_Map_Bucket_Iterator<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> retv (*this); - this->reverse_i (); + --*this; return retv; } @@ -830,7 +830,7 @@ ACE_Hash_Map_Reverse_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOC ACE_TRACE ("ACE_Hash_Map_Reverse_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>::operator++ (int)"); ACE_Hash_Map_Reverse_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> retv (*this); - this->reverse_i (); + ++*this; return retv; } @@ -851,7 +851,7 @@ ACE_Hash_Map_Reverse_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOC ACE_TRACE ("ACE_Hash_Map_Reverse_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>::operator-- (int)"); ACE_Hash_Map_Reverse_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> retv (*this); - this->forward_i (); + --*this; return retv; } diff --git a/ace/Hash_Map_With_Allocator_T.cpp b/ace/Hash_Map_With_Allocator_T.cpp index fa2a44ca06d..644dfe50e06 100644 --- a/ace/Hash_Map_With_Allocator_T.cpp +++ b/ace/Hash_Map_With_Allocator_T.cpp @@ -16,7 +16,7 @@ template <class EXT_ID, class INT_ID> ACE_Hash_Map_With_Allocator<EXT_ID, INT_ID>::ACE_Hash_Map_With_Allocator (ACE_Allocator *alloc) - : ACE_Hash_Map_Manager<EXT_ID, INT_ID, ACE_Null_Mutex> (alloc) + : ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, ACE_Hash<EXT_ID>, ACE_Equal_To<EXT_ID>, ACE_Null_Mutex> (alloc) { ACE_TRACE ("ACE_Hash_Map_With_Allocator<EXT_ID, INT_ID>::ACE_Hash_Map_With_Allocator"); } @@ -24,7 +24,7 @@ ACE_Hash_Map_With_Allocator<EXT_ID, INT_ID>::ACE_Hash_Map_With_Allocator (ACE_Al template <class EXT_ID, class INT_ID> ACE_Hash_Map_With_Allocator<EXT_ID, INT_ID>::ACE_Hash_Map_With_Allocator (size_t size, ACE_Allocator *alloc) - : ACE_Hash_Map_Manager<EXT_ID, INT_ID, ACE_Null_Mutex> (size, alloc) + : ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, ACE_Hash<EXT_ID>, ACE_Equal_To<EXT_ID>, ACE_Null_Mutex> (size, alloc) { ACE_TRACE ("ACE_Hash_Map_With_Allocator<EXT_ID, INT_ID>::ACE_Hash_Map_With_Allocator"); } diff --git a/ace/Hash_Map_With_Allocator_T.h b/ace/Hash_Map_With_Allocator_T.h index 6ee18da8a22..84721bb8d68 100644 --- a/ace/Hash_Map_With_Allocator_T.h +++ b/ace/Hash_Map_With_Allocator_T.h @@ -14,7 +14,7 @@ #define ACE_HASH_MAP_WITH_ALLOCATOR_T_H #include "ace/pre.h" -#include "ace/Hash_Map_Manager.h" +#include "ace/Hash_Map_Manager_T.h" #include "ace/Synch.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) @@ -42,7 +42,7 @@ */ template <class EXT_ID, class INT_ID> class ACE_Hash_Map_With_Allocator : - public ACE_Hash_Map_Manager<EXT_ID, INT_ID, ACE_Null_Mutex> + public ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, ACE_Hash<EXT_ID>, ACE_Equal_To<EXT_ID>, ACE_Null_Mutex> { public: /// Constructor. diff --git a/ace/Local_Name_Space.cpp b/ace/Local_Name_Space.cpp index 60f0cd5e817..958cc01b9dd 100644 --- a/ace/Local_Name_Space.cpp +++ b/ace/Local_Name_Space.cpp @@ -169,9 +169,6 @@ ACE_NS_Internal::type (void) template class ACE_Hash_Map_Entry<ACE_NS_String, ACE_NS_Internal>; template class ACE_Hash<ACE_NS_String>; template class ACE_Equal_To<ACE_NS_String>; -template class ACE_Hash_Map_Manager<ACE_NS_String, ACE_NS_Internal, ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator<ACE_NS_String, ACE_NS_Internal, ACE_Null_Mutex>; -template class ACE_Hash_Map_Reverse_Iterator<ACE_NS_String, ACE_NS_Internal, ACE_Null_Mutex>; template class ACE_Hash_Map_Manager_Ex<ACE_NS_String, ACE_NS_Internal, ACE_Hash<ACE_NS_String>, ACE_Equal_To<ACE_NS_String>, ACE_Null_Mutex>; template class ACE_Hash_Map_Iterator_Ex<ACE_NS_String, ACE_NS_Internal, ACE_Hash<ACE_NS_String>, ACE_Equal_To<ACE_NS_String>, ACE_Null_Mutex>; template class ACE_Hash_Map_Reverse_Iterator_Ex<ACE_NS_String, ACE_NS_Internal, ACE_Hash<ACE_NS_String>, ACE_Equal_To<ACE_NS_String>, ACE_Null_Mutex>; @@ -197,9 +194,6 @@ template class ACE_Write_Guard<ACE_RW_Process_Mutex>; #pragma instantiate ACE_Hash_Map_Entry<ACE_NS_String, ACE_NS_Internal> #pragma instantiate ACE_Hash<ACE_NS_String> #pragma instantiate ACE_Equal_To<ACE_NS_String> -#pragma instantiate ACE_Hash_Map_Manager<ACE_NS_String, ACE_NS_Internal, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Iterator<ACE_NS_String, ACE_NS_Internal, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Reverse_Iterator<ACE_NS_String, ACE_NS_Internal, ACE_Null_Mutex> #pragma instantiate ACE_Hash_Map_Manager_Ex<ACE_NS_String, ACE_NS_Internal, ACE_Hash<ACE_NS_String>, ACE_Equal_To<ACE_NS_String>, ACE_Null_Mutex> #pragma instantiate ACE_Hash_Map_Iterator_Ex<ACE_NS_String, ACE_NS_Internal, ACE_Hash<ACE_NS_String>, ACE_Equal_To<ACE_NS_String>, ACE_Null_Mutex> #pragma instantiate ACE_Hash_Map_Reverse_Iterator_Ex<ACE_NS_String, ACE_NS_Internal, ACE_Hash<ACE_NS_String>, ACE_Equal_To<ACE_NS_String>, ACE_Null_Mutex> diff --git a/ace/Local_Name_Space_T.cpp b/ace/Local_Name_Space_T.cpp index 56dbf42f516..d64e9f38665 100644 --- a/ace/Local_Name_Space_T.cpp +++ b/ace/Local_Name_Space_T.cpp @@ -1,10 +1,7 @@ -// $Id$ - #ifndef ACE_LOCAL_NAME_SPACE_T_C #define ACE_LOCAL_NAME_SPACE_T_C #include "ace/ACE.h" -#include "ace/Auto_Ptr.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once @@ -12,7 +9,11 @@ #include "ace/Local_Name_Space.h" -ACE_RCSID(ace, Local_Name_Space_T, "$Id$") + +ACE_RCSID (ace, + Local_Name_Space_T, + "$Id$") + template <class ALLOCATOR> ACE_Name_Space_Map<ALLOCATOR>::ACE_Name_Space_Map (ALLOCATOR *alloc) @@ -105,10 +106,11 @@ ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::remap (EXCEPTION_POINTERS *ep) #endif /* ACE_WIN32 */ template <ACE_MEM_POOL_1, class ACE_LOCK> int -ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::shared_bind (const ACE_NS_WString &name, - const ACE_NS_WString &value, - const char *type, - int rebind) +ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::shared_bind ( + const ACE_NS_WString &name, + const ACE_NS_WString &value, + const char *type, + int rebind) { // Note that we *must* use structured exception handling here // because (1) we may need to commit virtual memory pages and (2) @@ -125,10 +127,11 @@ ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::shared_bind (const ACE_NS_WStrin } template <ACE_MEM_POOL_1, class ACE_LOCK> int -ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::shared_bind_i (const ACE_NS_WString &name, - const ACE_NS_WString &value, - const char *type, - int rebind) +ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::shared_bind_i ( + const ACE_NS_WString &name, + const ACE_NS_WString &value, + const char *type, + int rebind) { ACE_TRACE ("ACE_Local_Name_Space::shared_bind_i"); @@ -161,19 +164,23 @@ ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::shared_bind_i (const ACE_NS_WStr { // Do a normal bind. This will fail if there's already an // <new_internal> with the same name. - result = this->name_space_map_->bind (new_name, new_internal, this->allocator_); + result = this->name_space_map_->bind (new_name, + new_internal, + this->allocator_); if (result == 1) { - // Entry already existed so bind failed. Free our dynamically allocated memory. + // Entry already existed so bind failed. Free our + // dynamically allocated memory. this->allocator_->free ((void *) ptr); return result; } } else { - // Do a rebind. If there's already any entry, this will return the existing - // <new_name> and <new_internal> and overwrite the existing name binding. + // Do a rebind. If there's already any entry, this will + // return the existing <new_name> and <new_internal> and + // overwrite the existing name binding. ACE_NS_String old_name; ACE_NS_Internal old_internal; @@ -182,9 +189,10 @@ ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::shared_bind_i (const ACE_NS_WStr this->allocator_); if (result == 1) { - // Free up the memory we allocated in shared_bind(). Note that this - // assumes that the "value" pointer comes first and that the value, - // name, and type are contiguously allocated (see above for details) + // Free up the memory we allocated in shared_bind(). + // Note that this assumes that the "value" pointer comes + // first and that the value, name, and type are + // contiguously allocated (see above for details) this->allocator_->free ((void *) (old_internal.value ()).fast_rep ()); } } @@ -203,7 +211,8 @@ ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::shared_bind_i (const ACE_NS_WStr } template <ACE_MEM_POOL_1, class ACE_LOCK> int -ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::unbind (const ACE_NS_WString &name) +ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::unbind ( + const ACE_NS_WString &name) { // Note that we *must* use structured exception handling here // because (1) we may need to commit virtual memory pages and (2) @@ -221,7 +230,8 @@ ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::unbind (const ACE_NS_WString &na } template <ACE_MEM_POOL_1, class ACE_LOCK> int -ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::unbind_i (const ACE_NS_WString &name) +ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::unbind_i ( + const ACE_NS_WString &name) { ACE_TRACE ("ACE_Local_Name_Space::unbind_i"); @@ -242,9 +252,10 @@ ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::unbind_i (const ACE_NS_WString & } template <ACE_MEM_POOL_1, class ACE_LOCK> int -ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::bind (const ACE_NS_WString &name, - const ACE_NS_WString &value, - const char *type) +ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::bind ( + const ACE_NS_WString &name, + const ACE_NS_WString &value, + const char *type) { ACE_TRACE ("ACE_Local_Name_Space::bind"); ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, *this->lock_, -1); @@ -253,9 +264,10 @@ ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::bind (const ACE_NS_WString &name } template <ACE_MEM_POOL_1, class ACE_LOCK> int -ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::rebind (const ACE_NS_WString &name, - const ACE_NS_WString &value, - const char *type) +ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::rebind ( + const ACE_NS_WString &name, + const ACE_NS_WString &value, + const char *type) { ACE_TRACE ("ACE_Local_Name_Space::rebind"); ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, *this->lock_, -1); @@ -264,9 +276,10 @@ ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::rebind (const ACE_NS_WString &na } template <ACE_MEM_POOL_1, class ACE_LOCK> int -ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::resolve (const ACE_NS_WString &name, - ACE_NS_WString &value, - char *&type) +ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::resolve ( + const ACE_NS_WString &name, + ACE_NS_WString &value, + char *&type) { // Note that we *must* use structured exception handling here // because (1) we may need to commit virtual memory pages and (2) @@ -284,9 +297,10 @@ ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::resolve (const ACE_NS_WString &n template <ACE_MEM_POOL_1, class ACE_LOCK> int -ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::resolve_i (const ACE_NS_WString &name, - ACE_NS_WString &value, - char *&type) +ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::resolve_i ( + const ACE_NS_WString &name, + ACE_NS_WString &value, + char *&type) { ACE_TRACE ("ACE_Local_Name_Space::resolve_i"); ACE_READ_GUARD_RETURN (ACE_LOCK, ace_mon, *this->lock_, -1); @@ -324,7 +338,8 @@ ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::resolve_i (const ACE_NS_WString } template <ACE_MEM_POOL_1, class ACE_LOCK> int -ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::open (ACE_Naming_Context::Context_Scope_Type scope_in) +ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::open ( + ACE_Naming_Context::Context_Scope_Type scope_in) { ACE_TRACE ("ACE_Local_Name_Space::open"); this->ns_scope_ = scope_in; @@ -342,8 +357,9 @@ ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::ACE_Local_Name_Space (void) } template <ACE_MEM_POOL_1, class ACE_LOCK> -ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::ACE_Local_Name_Space (ACE_Naming_Context::Context_Scope_Type scope_in, - ACE_Name_Options *name_options) +ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::ACE_Local_Name_Space ( + ACE_Naming_Context::Context_Scope_Type scope_in, + ACE_Name_Options *name_options) : name_options_ (name_options) { ACE_TRACE ("ACE_Local_Name_Space::ACE_Local_Name_Space"); @@ -477,7 +493,8 @@ ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::create_manager_i (void) { this->name_space_map_ = (ACE_Name_Space_Map <ALLOCATOR> *) ns_map; if (ACE::debug ()) - ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("name_space_map_ = %d, ns_map = %d\n"), + ACE_DEBUG ((LM_DEBUG, + ACE_LIB_TEXT ("name_space_map_ = %d, ns_map = %d\n"), this->name_space_map_, ns_map)); } @@ -493,7 +510,8 @@ ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::create_manager_i (void) { this->name_space_map_ = (ACE_Name_Space_Map <ALLOCATOR> *) ns_map; if (ACE::debug ()) - ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("name_space_map_ = %d, ns_map = %d\n"), + ACE_DEBUG ((LM_DEBUG, + ACE_LIB_TEXT ("name_space_map_ = %d, ns_map = %d\n"), this->name_space_map_, ns_map)); } else @@ -511,7 +529,8 @@ ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::create_manager_i (void) } if (ACE::debug ()) - ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("name_space_map_ = %d, ns_map = %d\n"), + ACE_DEBUG ((LM_DEBUG, + ACE_LIB_TEXT ("name_space_map_ = %d, ns_map = %d\n"), this->name_space_map_, ns_map)); } @@ -519,14 +538,15 @@ ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::create_manager_i (void) } template <ACE_MEM_POOL_1, class ACE_LOCK> int -ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::list_names_i (ACE_WSTRING_SET &set, - const ACE_NS_WString &pattern) +ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::list_names_i ( + ACE_WSTRING_SET &set, + const ACE_NS_WString &pattern) { ACE_TRACE ("ACE_Local_Name_Space::list_names_i"); ACE_READ_GUARD_RETURN (ACE_LOCK, ace_mon, *this->lock_, -1); - MAP_ITERATOR map_iterator (*this->name_space_map_); - MAP_ENTRY *map_entry; + MAP_MANAGER::ITERATOR map_iterator (*this->name_space_map_); + MAP_MANAGER::ENTRY *map_entry; int result = 1; @@ -552,14 +572,15 @@ ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::list_names_i (ACE_WSTRING_SET &s } template <ACE_MEM_POOL_1, class ACE_LOCK> int -ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::list_values_i (ACE_WSTRING_SET &set, - const ACE_NS_WString &pattern) +ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::list_values_i ( + ACE_WSTRING_SET &set, + const ACE_NS_WString &pattern) { ACE_TRACE ("ACE_Local_Name_Space::list_values_i"); ACE_READ_GUARD_RETURN (ACE_LOCK, ace_mon, *this->lock_, -1); - MAP_ITERATOR map_iterator (*this->name_space_map_); - MAP_ENTRY *map_entry; + MAP_MANAGER::ITERATOR map_iterator (*this->name_space_map_); + MAP_MANAGER::ENTRY *map_entry; int result = 1; @@ -585,14 +606,15 @@ ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::list_values_i (ACE_WSTRING_SET & } template <ACE_MEM_POOL_1, class ACE_LOCK> int -ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::list_types_i (ACE_WSTRING_SET &set, - const ACE_NS_WString &pattern) +ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::list_types_i ( + ACE_WSTRING_SET &set, + const ACE_NS_WString &pattern) { ACE_TRACE ("ACE_Local_Name_Space::list_types_i"); ACE_READ_GUARD_RETURN (ACE_LOCK, ace_mon, *this->lock_, -1); - MAP_ITERATOR map_iterator (*this->name_space_map_); - MAP_ENTRY *map_entry; + MAP_MANAGER::ITERATOR map_iterator (*this->name_space_map_); + MAP_MANAGER::ENTRY *map_entry; char *compiled_regexp = 0; @@ -655,14 +677,15 @@ ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::list_types_i (ACE_WSTRING_SET &s } template <ACE_MEM_POOL_1, class ACE_LOCK> int -ACE_Local_Name_Space <ACE_MEM_POOL_2, ACE_LOCK>::list_name_entries_i (ACE_BINDING_SET &set, - const ACE_NS_WString &pattern) +ACE_Local_Name_Space <ACE_MEM_POOL_2, ACE_LOCK>::list_name_entries_i ( + ACE_BINDING_SET &set, + const ACE_NS_WString &pattern) { ACE_TRACE ("ACE_Local_Name_Space::list_name_entries_i"); ACE_READ_GUARD_RETURN (ACE_LOCK, ace_mon, *this->lock_, -1); - MAP_ITERATOR map_iterator (*this->name_space_map_); - MAP_ENTRY *map_entry; + MAP_MANAGER::ITERATOR map_iterator (*this->name_space_map_); + MAP_MANAGER::ENTRY *map_entry; for (map_entry = 0; map_iterator.next (map_entry) != 0; @@ -683,14 +706,15 @@ ACE_Local_Name_Space <ACE_MEM_POOL_2, ACE_LOCK>::list_name_entries_i (ACE_BINDIN } template <ACE_MEM_POOL_1, class ACE_LOCK> int -ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::list_value_entries_i (ACE_BINDING_SET &set, - const ACE_NS_WString &pattern) +ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::list_value_entries_i ( + ACE_BINDING_SET &set, + const ACE_NS_WString &pattern) { ACE_TRACE ("ACE_Local_Name_Space::list_value_entries_i"); ACE_READ_GUARD_RETURN (ACE_LOCK, ace_mon, *this->lock_, -1); - MAP_ITERATOR map_iterator (*this->name_space_map_); - MAP_ENTRY *map_entry; + MAP_MANAGER::ITERATOR map_iterator (*this->name_space_map_); + MAP_MANAGER::ENTRY *map_entry; for (map_entry = 0; map_iterator.next (map_entry) != 0; @@ -710,14 +734,15 @@ ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::list_value_entries_i (ACE_BINDIN } template <ACE_MEM_POOL_1, class ACE_LOCK> int -ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::list_type_entries_i (ACE_BINDING_SET &set, - const ACE_NS_WString &pattern) +ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::list_type_entries_i ( + ACE_BINDING_SET &set, + const ACE_NS_WString &pattern) { ACE_TRACE ("ACE_Local_Name_Space::list_type_entries_i"); ACE_READ_GUARD_RETURN (ACE_LOCK, ace_mon, *this->lock_, -1); - MAP_ITERATOR map_iterator (*this->name_space_map_); - MAP_ENTRY *map_entry; + MAP_MANAGER::ITERATOR map_iterator (*this->name_space_map_); + MAP_MANAGER::ENTRY *map_entry; char *compiled_regexp = 0; // Note that char_rep() allocates memory so we need to delete it @@ -727,10 +752,12 @@ ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::list_type_entries_i (ACE_BINDING if (ACE_OS::strcmp ("", pattern_rep) == 0) compiled_regexp = ACE_OS::strdup (""); else - // Compile the regular expression (the 0's cause ACE_OS::compile to allocate space). + // Compile the regular expression (the 0's cause ACE_OS::compile + // to allocate space). #if defined (ACE_HAS_REGEX) compiled_regexp = ACE_OS::compile (pattern_rep, 0, 0); -#else /* If we don't have regular expressions just the pattern directly. */ +#else /* If we don't have regular expressions just the pattern + directly. */ compiled_regexp = pattern_rep; #endif /* ACE_HAS_REGEX */ @@ -741,10 +768,12 @@ ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::list_type_entries_i (ACE_BINDING // Get the type. const char *type = map_entry->int_id_.type (); - if (ACE_OS::strcmp ("", pattern_rep) == 0 // Everything matches the wildcard. + if (ACE_OS::strcmp ("", pattern_rep) == 0 // Everything matches + // the wildcard. #if defined (ACE_HAS_REGEX) || ACE_OS::step (type, compiled_regexp) != 0) -#else /* If we don't have regular expressions just use strstr() for substring matching. */ +#else /* If we don't have regular expressions just use strstr() for + substring matching. */ || ACE_OS::strstr (type, compiled_regexp) != 0) #endif /* ACE_HAS_REGEX */ { @@ -771,8 +800,8 @@ ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::dump_i (void) const ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - MAP_ITERATOR map_iterator (*this->name_space_map_); - MAP_ENTRY *map_entry; + MAP_MANAGER::ITERATOR map_iterator (*this->name_space_map_); + MAP_MANAGER::ENTRY *map_entry; for (map_entry = 0; map_iterator.next (map_entry) != 0; @@ -786,7 +815,8 @@ ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::dump_i (void) const ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("key=%s\nvalue=%s\ntype=%s\n"), key, value, type)); - // We need to delete key and value since char_rep allocates memory for them + // We need to delete key and value since char_rep allocates + // memory for them delete [] key; delete [] value; } @@ -795,8 +825,9 @@ ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::dump_i (void) const } template <ACE_MEM_POOL_1, class ACE_LOCK> int -ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::list_names (ACE_WSTRING_SET &set, - const ACE_NS_WString &pattern) +ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::list_names ( + ACE_WSTRING_SET &set, + const ACE_NS_WString &pattern) { // Note that we *must* use structured exception handling here // because (1) we may need to commit virtual memory pages and (2) @@ -813,8 +844,9 @@ ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::list_names (ACE_WSTRING_SET &set } template <ACE_MEM_POOL_1, class ACE_LOCK> int -ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::list_values (ACE_WSTRING_SET &set, - const ACE_NS_WString &pattern) +ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::list_values ( + ACE_WSTRING_SET &set, + const ACE_NS_WString &pattern) { // Note that we *must* use structured exception handling here // because (1) we may need to commit virtual memory pages and (2) @@ -831,8 +863,9 @@ ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::list_values (ACE_WSTRING_SET &se } template <ACE_MEM_POOL_1, class ACE_LOCK> int -ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::list_types (ACE_WSTRING_SET &set, - const ACE_NS_WString &pattern) +ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::list_types ( + ACE_WSTRING_SET &set, + const ACE_NS_WString &pattern) { // Note that we *must* use structured exception handling here // because (1) we may need to commit virtual memory pages and (2) @@ -849,8 +882,9 @@ ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::list_types (ACE_WSTRING_SET &set } template <ACE_MEM_POOL_1, class ACE_LOCK> int -ACE_Local_Name_Space <ACE_MEM_POOL_2, ACE_LOCK>::list_name_entries (ACE_BINDING_SET &set, - const ACE_NS_WString &pattern) +ACE_Local_Name_Space <ACE_MEM_POOL_2, ACE_LOCK>::list_name_entries ( + ACE_BINDING_SET &set, + const ACE_NS_WString &pattern) { // Note that we *must* use structured exception handling here // because (1) we may need to commit virtual memory pages and (2) @@ -867,8 +901,9 @@ ACE_Local_Name_Space <ACE_MEM_POOL_2, ACE_LOCK>::list_name_entries (ACE_BINDING_ } template <ACE_MEM_POOL_1, class ACE_LOCK> int -ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::list_value_entries (ACE_BINDING_SET &set, - const ACE_NS_WString &pattern) +ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::list_value_entries ( + ACE_BINDING_SET &set, + const ACE_NS_WString &pattern) { // Note that we *must* use structured exception handling here // because (1) we may need to commit virtual memory pages and (2) @@ -885,8 +920,9 @@ ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::list_value_entries (ACE_BINDING_ } template <ACE_MEM_POOL_1, class ACE_LOCK> int -ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::list_type_entries (ACE_BINDING_SET &set, - const ACE_NS_WString &pattern) +ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::list_type_entries ( + ACE_BINDING_SET &set, + const ACE_NS_WString &pattern) { // Note that we *must* use structured exception handling here // because (1) we may need to commit virtual memory pages and (2) diff --git a/ace/Local_Name_Space_T.h b/ace/Local_Name_Space_T.h index 1933908f2e6..0df51250b73 100644 --- a/ace/Local_Name_Space_T.h +++ b/ace/Local_Name_Space_T.h @@ -1,4 +1,4 @@ -/* -*- C++ -*- */ +// -*- C++ -*- //============================================================================= /** @@ -32,17 +32,18 @@ typedef ACE_Unbounded_Set<ACE_NS_WString> ACE_WSTRING_SET; // Simplify later usage by defining typedefs. #if (1) -#include "ace/Hash_Map_Manager.h" -typedef ACE_Hash_Map_Manager<ACE_NS_String, ACE_NS_Internal, ACE_Null_Mutex> MAP_MANAGER; -typedef ACE_Hash_Map_Iterator<ACE_NS_String, ACE_NS_Internal, ACE_Null_Mutex> MAP_ITERATOR; -typedef ACE_Hash_Map_Entry <ACE_NS_String, ACE_NS_Internal> MAP_ENTRY; +# include "ace/Hash_Map_Manager_T.h" +typedef ACE_Hash_Map_Manager_Ex<ACE_NS_String, ACE_NS_Internal, ACE_Hash<ACE_NS_String>, ACE_Equal_To<ACE_NS_String>, ACE_Null_Mutex> MAP_MANAGER; #else -#include "ace/Map_Manager.h" +# include "ace/Map_Manager.h" typedef ACE_Map_Manager<ACE_NS_String, ACE_NS_Internal, ACE_Null_Mutex> MAP_MANAGER; -typedef ACE_Map_Iterator<ACE_NS_String, ACE_NS_Internal, ACE_Null_Mutex> MAP_ITERATOR; -typedef ACE_Map_Entry <ACE_NS_String, ACE_NS_Internal> MAP_ENTRY; #endif /* 0 */ +// Deprecated typedefs. Use the map's traits instead. +typedef MAP_MANAGER::ITERATOR MAP_ITERATOR; +typedef MAP_MANAGER::ENTRY MAP_ENTRY; + + /** * @class ACE_Name_Space_Map * diff --git a/ace/Map_Manager.i b/ace/Map_Manager.i index 0efe209c8eb..ba2a672b2e8 100644 --- a/ace/Map_Manager.i +++ b/ace/Map_Manager.i @@ -535,7 +535,7 @@ ACE_Map_Iterator<EXT_ID, INT_ID, ACE_LOCK> ACE_Map_Iterator<EXT_ID, INT_ID, ACE_LOCK>::operator++ (int) { ACE_Map_Iterator<EXT_ID, INT_ID, ACE_LOCK> retv (*this); - this->forward_i (); + ++*this; return retv; } @@ -552,7 +552,7 @@ ACE_Map_Iterator<EXT_ID, INT_ID, ACE_LOCK> ACE_Map_Iterator<EXT_ID, INT_ID, ACE_LOCK>::operator-- (int) { ACE_Map_Iterator<EXT_ID, INT_ID, ACE_LOCK> retv (*this); - this->reverse_i (); + --*this; return retv; } @@ -613,7 +613,7 @@ ACE_Map_Const_Iterator<EXT_ID, INT_ID, ACE_LOCK> ACE_Map_Const_Iterator<EXT_ID, INT_ID, ACE_LOCK>::operator++ (int) { ACE_Map_Const_Iterator<EXT_ID, INT_ID, ACE_LOCK> retv (*this); - this->forward_i (); + ++*this; return retv; } @@ -630,7 +630,7 @@ ACE_Map_Const_Iterator<EXT_ID, INT_ID, ACE_LOCK> ACE_Map_Const_Iterator<EXT_ID, INT_ID, ACE_LOCK>::operator-- (int) { ACE_Map_Const_Iterator<EXT_ID, INT_ID, ACE_LOCK> retv (*this); - this->reverse_i (); + --*this; return retv; } @@ -691,7 +691,7 @@ ACE_Map_Reverse_Iterator<EXT_ID, INT_ID, ACE_LOCK> ACE_Map_Reverse_Iterator<EXT_ID, INT_ID, ACE_LOCK>::operator++ (int) { ACE_Map_Reverse_Iterator<EXT_ID, INT_ID, ACE_LOCK> retv (*this); - this->reverse_i (); + ++*this; return retv; } @@ -708,6 +708,6 @@ ACE_Map_Reverse_Iterator<EXT_ID, INT_ID, ACE_LOCK> ACE_Map_Reverse_Iterator<EXT_ID, INT_ID, ACE_LOCK>::operator-- (int) { ACE_Map_Reverse_Iterator<EXT_ID, INT_ID, ACE_LOCK> retv (*this); - this->forward_i (); + --*this; return retv; } diff --git a/ace/Map_T.h b/ace/Map_T.h index 7730d9686d7..585cbc91ff8 100644 --- a/ace/Map_T.h +++ b/ace/Map_T.h @@ -16,7 +16,7 @@ #include "ace/Pair_T.h" #include "ace/Map_Manager.h" -#include "ace/Hash_Map_Manager.h" +#include "ace/Hash_Map_Manager_T.h" #include "ace/Active_Map_Manager.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) @@ -7064,51 +7064,6 @@ typedef ACE_TRANSMIT_FILE_BUFFERS* ACE_LPTRANSMIT_FILE_BUFFERS; # define WCOREDUMP(stat) 0 #endif /* WCOREDUMP */ -// Stuff used by the ACE CDR classes. -#if defined ACE_LITTLE_ENDIAN -# define ACE_CDR_BYTE_ORDER 1 -// little endian encapsulation byte order has value = 1 -#else /* ! ACE_LITTLE_ENDIAN */ -# define ACE_CDR_BYTE_ORDER 0 -// big endian encapsulation byte order has value = 0 -#endif /* ! ACE_LITTLE_ENDIAN */ - -/** - * @name Default values to control CDR classes memory allocation strategies - */ -//@{ - -/// Control the initial size of all CDR buffers, application -/// developers may want to optimize this value to fit their request -/// size -#if !defined (ACE_DEFAULT_CDR_BUFSIZE) -# define ACE_DEFAULT_CDR_BUFSIZE 512 -#endif /* ACE_DEFAULT_CDR_BUFSIZE */ - -/// Stop exponential growth of CDR buffers to avoid overallocation -#if !defined (ACE_DEFAULT_CDR_EXP_GROWTH_MAX) -# define ACE_DEFAULT_CDR_EXP_GROWTH_MAX 65536 -#endif /* ACE_DEFAULT_CDR_EXP_GROWTH_MAX */ - -/// Control CDR buffer growth after maximum exponential growth is -/// reached -#if !defined (ACE_DEFAULT_CDR_LINEAR_GROWTH_CHUNK) -# define ACE_DEFAULT_CDR_LINEAR_GROWTH_CHUNK 65536 -#endif /* ACE_DEFAULT_CDR_LINEAR_GROWTH_CHUNK */ -//@} - -/// Control the zero-copy optimizations for octet sequences -/** - * Large octet sequences can be sent without any copies by chaining - * them in the list of message blocks that represent a single CDR - * stream. However, if the octet sequence is too small the zero copy - * optimizations actually hurt performance. Octet sequences smaller - * than this value will be copied. - */ -#if !defined (ACE_DEFAULT_CDR_MEMCPY_TRADEOFF) -#define ACE_DEFAULT_CDR_MEMCPY_TRADEOFF 256 -#endif /* ACE_DEFAULT_CDR_MEMCPY_TRADEOFF */ - /** * In some environments it is useful to swap the bytes on write, for * instance: a fast server can be feeding a lot of slow clients that diff --git a/ace/POSIX_Asynch_IO.cpp b/ace/POSIX_Asynch_IO.cpp index 1cdc230d1f7..d1d153e5baa 100644 --- a/ace/POSIX_Asynch_IO.cpp +++ b/ace/POSIX_Asynch_IO.cpp @@ -1,6 +1,3 @@ -/* -*- C++ -*- */ -// $Id$ - #include "ace/POSIX_Asynch_IO.h" #if defined (ACE_HAS_AIO_CALLS) @@ -15,6 +12,12 @@ #include "ace/POSIX_Asynch_IO.i" #endif /* __ACE_INLINE__ */ + +ACE_RCSID (ace, + POSIX_Asynch_IO, + "$Id$") + + size_t ACE_POSIX_Asynch_Result::bytes_transferred (void) const { @@ -1580,8 +1583,8 @@ ACE_POSIX_Asynch_Connect::cancel_uncompleted (int flg_notify, int retval = 0; - MAP_ITERATOR iter (result_map_); - MAP_ENTRY * me = 0; + MAP_MANAGER::ITERATOR iter (result_map_); + MAP_MANAGER::ENTRY * me = 0; set.reset (); diff --git a/ace/POSIX_Asynch_IO.h b/ace/POSIX_Asynch_IO.h index 20e3ad6dd66..d3aab26cf71 100644 --- a/ace/POSIX_Asynch_IO.h +++ b/ace/POSIX_Asynch_IO.h @@ -902,10 +902,10 @@ private: typedef ACE_Map_Manager<ACE_HANDLE, ACE_POSIX_Asynch_Connect_Result *, ACE_SYNCH_NULL_MUTEX> MAP_MANAGER; - typedef ACE_Map_Iterator<ACE_HANDLE, ACE_POSIX_Asynch_Connect_Result *, ACE_SYNCH_NULL_MUTEX> - MAP_ITERATOR; - typedef ACE_Map_Entry<ACE_HANDLE, ACE_POSIX_Asynch_Connect_Result *> - MAP_ENTRY; + + // (Two) Deprecated typedefs. Use the map traits instead. + typedef MAP_MANAGER::ITERATOR MAP_ITERATOR; + typedef MAP_MANAGER::ENTRY MAP_ENTRY; /// Map of Result pointers that correspond to all the <accept>'s /// pending. diff --git a/ace/Parse_Node.cpp b/ace/Parse_Node.cpp index 6605c728e80..98d52adbf12 100644 --- a/ace/Parse_Node.cpp +++ b/ace/Parse_Node.cpp @@ -4,6 +4,7 @@ #include "ace/Service_Config.h" #include "ace/Service_Repository.h" +#include "ace/Service_Types.h" #include "ace/Task.h" #if !defined (__ACE_INLINE__) diff --git a/ace/Parse_Node.h b/ace/Parse_Node.h index fced2c25241..fea5c7f6cbd 100644 --- a/ace/Parse_Node.h +++ b/ace/Parse_Node.h @@ -16,7 +16,7 @@ #include "ace/pre.h" -#include "ace/DLL.h" +#include "ace/config-all.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once @@ -24,13 +24,12 @@ #if (ACE_USES_CLASSIC_SVC_CONF == 1) -#include "ace/Service_Types.h" - +#include "ace/DLL.h" /// Forward declarations. class ACE_Service_Config; - +class ACE_Service_Type; /** * @class ACE_Parse_Node diff --git a/ace/RB_Tree.i b/ace/RB_Tree.i index 55deff16026..ed0a93fbb7e 100644 --- a/ace/RB_Tree.i +++ b/ace/RB_Tree.i @@ -891,7 +891,7 @@ ACE_RB_Tree_Iterator<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::operator++ (int) ACE_TRACE ("ACE_RB_Tree_Iterator<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK> operator++ (int)"); ACE_RB_Tree_Iterator<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK> retv (*this); - this->forward_i (); + ++*this; return retv; } @@ -918,7 +918,7 @@ ACE_RB_Tree_Iterator<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::operator-- (int) ACE_TRACE ("ACE_RB_Tree_Iterator<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK> operator-- (int)"); ACE_RB_Tree_Iterator<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK> retv (*this); - this->reverse_i (); + --*this; return retv; } @@ -1094,7 +1094,7 @@ ACE_RB_Tree_Reverse_Iterator<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::operator++ ACE_TRACE ("ACE_RB_Tree_Reverse_Iterator<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::operator++ (int)"); ACE_RB_Tree_Reverse_Iterator<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK> retv (*this); - this->reverse_i (); + ++*this; return retv; } @@ -1121,7 +1121,7 @@ ACE_RB_Tree_Reverse_Iterator<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::operator-- ACE_TRACE ("ACE_RB_Tree_Reverse_Iterator<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::operator-- (int)"); ACE_RB_Tree_Reverse_Iterator<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK> retv (*this); - this->forward_i (); + --*this; return retv; } diff --git a/ace/SSL/SSL_SOCK_Acceptor.h b/ace/SSL/SSL_SOCK_Acceptor.h index 12262c57355..d220c88bb83 100644 --- a/ace/SSL/SSL_SOCK_Acceptor.h +++ b/ace/SSL/SSL_SOCK_Acceptor.h @@ -47,7 +47,7 @@ * SSL implementations, such as OpenSSL, are not entirely * thread-safe or reentrant. */ -class ACE_SSL_Export ACE_SSL_SOCK_Acceptor : public ACE_SSL_SOCK +class ACE_SSL_Export ACE_SSL_SOCK_Acceptor : private ACE_SSL_SOCK { public: diff --git a/ace/SSL/SSL_SOCK_Connector.cpp b/ace/SSL/SSL_SOCK_Connector.cpp index d7de02c7cbb..3c5caff9c05 100644 --- a/ace/SSL/SSL_SOCK_Connector.cpp +++ b/ace/SSL/SSL_SOCK_Connector.cpp @@ -63,6 +63,9 @@ ACE_SSL_SOCK_Connector::ssl_connect (ACE_SSL_SOCK_Stream &new_stream, return -1; } + // Take into account the time between each select() call below. + ACE_Countdown_Time countdown (timeout); + int status; do { @@ -139,6 +142,9 @@ ACE_SSL_SOCK_Connector::ssl_connect (ACE_SSL_SOCK_Stream &new_stream, &wr_handle, 0, timeout); + + (void) countdown.update (); + // 0 is timeout, so we're done. // -1 is error, so we're done. // Could be both handles set (same handle in both masks) so set to 1. diff --git a/ace/SSL/SSL_SOCK_Stream.cpp b/ace/SSL/SSL_SOCK_Stream.cpp index a8ef10df179..578051416d9 100644 --- a/ace/SSL/SSL_SOCK_Stream.cpp +++ b/ace/SSL/SSL_SOCK_Stream.cpp @@ -554,7 +554,7 @@ ACE_SSL_SOCK_Stream::get_remote_addr (ACE_Addr &addr) const // get_remote_addr() would be misleading. if (SSL_is_init_finished (this->ssl_)) - return this->ACE_SOCK::get_remote_addr (addr); + return this->ACE_SSL_SOCK::get_remote_addr (addr); if (this->get_handle () == ACE_INVALID_HANDLE) errno = EBADF; diff --git a/ace/SSL/SSL_SOCK_Stream.h b/ace/SSL/SSL_SOCK_Stream.h index 981b931655d..06e5a4bd889 100644 --- a/ace/SSL/SSL_SOCK_Stream.h +++ b/ace/SSL/SSL_SOCK_Stream.h @@ -57,9 +57,6 @@ */ class ACE_SSL_Export ACE_SSL_SOCK_Stream : public ACE_SSL_SOCK { - friend class ACE_SSL_SOCK_Connector; - friend class ACE_SSL_SOCK_Acceptor; - public: /// Constructor diff --git a/ace/Select_Reactor_T.cpp b/ace/Select_Reactor_T.cpp index ed1332ece07..78c3a3ada1f 100644 --- a/ace/Select_Reactor_T.cpp +++ b/ace/Select_Reactor_T.cpp @@ -1019,6 +1019,10 @@ ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::work_pending ACE_Time_Value *this_timeout = this->timer_queue_->calculate_timeout (&mwt, &timer_buf); + // Check if we have timers to fire. + int timers_pending = + (this_timeout != 0 && *this_timeout != max_wait_time ? 1 : 0); + u_long width = (u_long) this->handler_rep_.max_handlep1 (); ACE_Select_Reactor_Handle_Set fd_set; @@ -1026,11 +1030,15 @@ ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::work_pending fd_set.wr_mask_ = this->wait_set_.wr_mask_; fd_set.ex_mask_ = this->wait_set_.ex_mask_; - return ACE_OS::select (int (width), - fd_set.rd_mask_, - fd_set.wr_mask_, - fd_set.ex_mask_, - this_timeout); + int nfds = ACE_OS::select (int (width), + fd_set.rd_mask_, + fd_set.wr_mask_, + fd_set.ex_mask_, + this_timeout); + + // If timers are pending, override any timeout from the select() + // call. + return (nfds == 0 && timers_pending != 0 ? 1 : nfds); } // Must be called with lock held. diff --git a/ace/Service_Config.h b/ace/Service_Config.h index 617bbfa9208..9c20e388519 100644 --- a/ace/Service_Config.h +++ b/ace/Service_Config.h @@ -21,15 +21,17 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "ace/Service_Types.h" -#include "ace/Signal.h" #include "ace/Unbounded_Queue.h" #include "ace/Unbounded_Set.h" #include "ace/SString.h" #include "ace/XML_Svc_Conf.h" + // Forward decl. +class ACE_Service_Type; +class ACE_Service_Type_Impl; class ACE_Service_Repository; +class ACE_Sig_Adapter; class ACE_Allocator; class ACE_Reactor; class ACE_Thread_Manager; diff --git a/ace/Service_Manager.cpp b/ace/Service_Manager.cpp index 8951d74f409..8d9ce8468a2 100644 --- a/ace/Service_Manager.cpp +++ b/ace/Service_Manager.cpp @@ -1,10 +1,9 @@ -// $Id$ - #include "ace/Get_Opt.h" #include "ace/Log_Msg.h" #include "ace/Service_Repository.h" #include "ace/Service_Config.h" #include "ace/Service_Manager.h" +#include "ace/Service_Types.h" #include "ace/Reactor.h" #include "ace/WFMO_Reactor.h" @@ -12,9 +11,13 @@ #include "ace/Service_Manager.i" #endif /* __ACE_INLINE__ */ -ACE_RCSID(ace, Service_Manager, "$Id$") -ACE_ALLOC_HOOK_DEFINE(ACE_Service_Manager) +ACE_RCSID (ace, + Service_Manager, + "$Id$") + + +ACE_ALLOC_HOOK_DEFINE (ACE_Service_Manager) void ACE_Service_Manager::dump (void) const diff --git a/ace/Service_Repository.cpp b/ace/Service_Repository.cpp index f6a1e3ce1f7..125c2e77b87 100644 --- a/ace/Service_Repository.cpp +++ b/ace/Service_Repository.cpp @@ -1,7 +1,5 @@ -// Service_Repository.cpp -// $Id$ - #include "ace/Service_Repository.h" +#include "ace/Service_Types.h" #include "ace/Object_Manager.h" #include "ace/Log_Msg.h" @@ -9,7 +7,9 @@ #include "ace/Service_Repository.i" #endif /* __ACE_INLINE__ */ -ACE_RCSID(ace, Service_Repository, "$Id$") +ACE_RCSID (ace, + Service_Repository, + "$Id$") ACE_ALLOC_HOOK_DEFINE(ACE_Service_Repository) diff --git a/ace/Service_Repository.h b/ace/Service_Repository.h index 46685807437..fa8bc699edb 100644 --- a/ace/Service_Repository.h +++ b/ace/Service_Repository.h @@ -1,4 +1,4 @@ -/* -*- C++ -*- */ +// -*- C++ -*- //============================================================================= /** @@ -12,14 +12,21 @@ #ifndef ACE_SERVICE_REPOSITORY_H #define ACE_SERVICE_REPOSITORY_H + #include "ace/pre.h" -#include "ace/Service_Types.h" +#include "ace/ACE_export.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ +#include "ace/Default_Constants.h" +#include "ace/Synch.h" + + +class ACE_Service_Type; + #define ACE_Component_Repository ACE_Service_Repository /** * @class ACE_Service_Repository @@ -200,4 +207,5 @@ private: #endif /* __ACE_INLINE__ */ #include "ace/post.h" + #endif /* _SERVICE_REPOSITORY_H */ diff --git a/ace/Strategies_T.cpp b/ace/Strategies_T.cpp index eee0936a94e..28d15a4faf0 100644 --- a/ace/Strategies_T.cpp +++ b/ace/Strategies_T.cpp @@ -1,5 +1,3 @@ -// $Id$ - #ifndef ACE_STRATEGIES_T_C #define ACE_STRATEGIES_T_C @@ -19,7 +17,11 @@ #include "ace/Strategies_T.i" #endif /* ACE_LACKS_INLINE_FUNCTIONS */ -ACE_RCSID(ace, Strategies_T, "$Id$") + +ACE_RCSID (ace, + Strategies_T, + "$Id$") + template <class SVC_HANDLER> int ACE_Singleton_Strategy<SVC_HANDLER>::open (SVC_HANDLER *sh, @@ -408,7 +410,7 @@ ACE_Process_Strategy<SVC_HANDLER>::activate_svc_handler (SVC_HANDLER *svc_handle template<class SVC_HANDLER, ACE_PEER_CONNECTOR_1, class MUTEX> ACE_Cached_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2, MUTEX>::ACE_Cached_Connect_Strategy -(ACE_Creation_Strategy<SVC_HANDLER> *cre_s, +(creation_strategy_type *cre_s, ACE_Concurrency_Strategy<SVC_HANDLER> *con_s, ACE_Recycling_Strategy<SVC_HANDLER> *rec_s, MUTEX *lock, @@ -467,8 +469,8 @@ ACE_Cached_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2, MUTEX>::~ACE_Cach this->recycling_strategy_ = 0; // Close down all cached service handlers. - CONNECTION_MAP_ENTRY *entry; - for (CONNECTION_MAP_ITERATOR iterator (connection_map_); + CONNECTION_MAP::ENTRY *entry; + for (CONNECTION_MAP::ITERATOR iterator (connection_map_); iterator.next (entry); iterator.advance ()) { @@ -479,7 +481,7 @@ ACE_Cached_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2, MUTEX>::~ACE_Cach template<class SVC_HANDLER, ACE_PEER_CONNECTOR_1, class MUTEX> int ACE_Cached_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2, MUTEX>::open -(ACE_Creation_Strategy<SVC_HANDLER> *cre_s, +(creation_strategy_type *cre_s, ACE_Concurrency_Strategy<SVC_HANDLER> *con_s, ACE_Recycling_Strategy<SVC_HANDLER> *rec_s) { @@ -556,7 +558,7 @@ ACE_Cached_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2, MUTEX>::check_hin int reuse_addr, int flags, int perms, - ACE_Hash_Map_Entry<ACE_Refcounted_Hash_Recyclable<ACE_PEER_CONNECTOR_ADDR>, SVC_HANDLER *> *&entry, + CONNECTION_MAP::ENTRY *&entry, int &found) { ACE_UNUSED_ARG (remote_addr); @@ -569,7 +571,7 @@ ACE_Cached_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2, MUTEX>::check_hin found = 0; // Get the recycling act for the svc_handler - CONNECTION_MAP_ENTRY *possible_entry = (CONNECTION_MAP_ENTRY *) sh->recycling_act (); + CONNECTION_MAP::ENTRY *possible_entry = (CONNECTION_MAP::ENTRY *) sh->recycling_act (); // Check to see if the hint svc_handler has been closed down if (possible_entry->ext_id_.recycle_state () == ACE_RECYCLABLE_CLOSED) @@ -631,7 +633,7 @@ ACE_Cached_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2, MUTEX>::find_or_c int reuse_addr, int flags, int perms, - ACE_Hash_Map_Entry<ACE_Refcounted_Hash_Recyclable<ACE_PEER_CONNECTOR_ADDR>, SVC_HANDLER *> *&entry, + CONNECTION_MAP::ENTRY *&entry, int &found) { // Explicit type conversion @@ -884,7 +886,7 @@ ACE_Cached_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2, MUTEX>::connect_s int perms, int& found) { - CONNECTION_MAP_ENTRY *entry = 0; + CONNECTION_MAP::ENTRY *entry = 0; // Check if the user passed a hint svc_handler if (sh != 0) @@ -943,7 +945,8 @@ template<class SVC_HANDLER, ACE_PEER_CONNECTOR_1, class MUTEX> int ACE_Cached_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2, MUTEX>::cache_i (const void *recycling_act) { // The wonders and perils of ACT - CONNECTION_MAP_ENTRY *entry = (CONNECTION_MAP_ENTRY *) recycling_act; + CONNECTION_MAP::ENTRY *entry = + ACE_static_cast (CONNECTION_MAP::ENTRY *, recycling_act); // Mark the <svc_handler> in the cache as not being <in_use>. // Therefore recyclable is IDLE. @@ -970,7 +973,8 @@ ACE_Cached_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2, MUTEX>::recycle_s ACE_Recyclable_State new_state) { // The wonders and perils of ACT - CONNECTION_MAP_ENTRY *entry = (CONNECTION_MAP_ENTRY *) recycling_act; + CONNECTION_MAP::ENTRY *entry = + ACE_static_cast (CONNECTION_MAP::ENTRY *, recycling_act); // Mark the <svc_handler> in the cache as not being <in_use>. // Therefore recyclable is IDLE. @@ -995,7 +999,8 @@ template<class SVC_HANDLER, ACE_PEER_CONNECTOR_1, class MUTEX> ACE_Recyclable_St ACE_Cached_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2, MUTEX>::recycle_state_i (const void *recycling_act) const { // The wonders and perils of ACT - CONNECTION_MAP_ENTRY *entry = (CONNECTION_MAP_ENTRY *) recycling_act; + CONNECTION_MAP::ENTRY *entry = + ACE_static_cast (CONNECTION_MAP::ENTRY *, recycling_act); // Mark the <svc_handler> in the cache as not being <in_use>. // Therefore recyclable is IDLE. @@ -1016,7 +1021,8 @@ template<class SVC_HANDLER, ACE_PEER_CONNECTOR_1, class MUTEX> int ACE_Cached_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2, MUTEX>::purge_i (const void *recycling_act) { // The wonders and perils of ACT - CONNECTION_MAP_ENTRY *entry = (CONNECTION_MAP_ENTRY *) recycling_act; + CONNECTION_MAP::ENTRY *entry = + ACE_static_cast (CONNECTION_MAP::ENTRY *, recycling_act); return this->connection_map_.unbind (entry); } @@ -1035,7 +1041,8 @@ template<class SVC_HANDLER, ACE_PEER_CONNECTOR_1, class MUTEX> int ACE_Cached_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2, MUTEX>::mark_as_closed_i (const void *recycling_act) { // The wonders and perils of ACT - CONNECTION_MAP_ENTRY *entry = (CONNECTION_MAP_ENTRY *) recycling_act; + CONNECTION_MAP::ENTRY *entry = + ACE_static_cast (CONNECTION_MAP::ENTRY *, recycling_act); // Mark the <svc_handler> in the cache as CLOSED. entry->ext_id_.recycle_state (ACE_RECYCLABLE_CLOSED); @@ -1065,7 +1072,8 @@ ACE_Cached_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2, MUTEX>::cleanup_h *act_holder = 0; // The wonders and perils of ACT - CONNECTION_MAP_ENTRY *entry = (CONNECTION_MAP_ENTRY *) recycling_act; + CONNECTION_MAP::ENTRY *entry = + ACE_static_cast, CONNECTION_MAP::ENTRY *, recycling_act); // Decrement the refcount on the <svc_handler>. int refcount = entry->ext_id_.decrement (); @@ -1102,8 +1110,9 @@ ACE_Cached_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2, MUTEX>::concurren } template<class SVC_HANDLER, ACE_PEER_CONNECTOR_1, class MUTEX> int -ACE_Cached_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2, MUTEX>::find (ACE_Refcounted_Hash_Recyclable<ACE_PEER_CONNECTOR_ADDR> &search_addr, - ACE_Hash_Map_Entry<ACE_Refcounted_Hash_Recyclable<ACE_PEER_CONNECTOR_ADDR>, SVC_HANDLER *> *&entry) +ACE_Cached_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2, MUTEX>::find ( + REFCOUNTED_HASH_RECYCLABLE_ADDRESS &search_addr, + CONNECTION_MAP::ENTRY *&entry) { typedef ACE_Hash_Map_Bucket_Iterator<REFCOUNTED_HASH_RECYCLABLE_ADDRESS, SVC_HANDLER *, diff --git a/ace/Strategies_T.h b/ace/Strategies_T.h index 8fb6d39f7f9..dcb9289b0d3 100644 --- a/ace/Strategies_T.h +++ b/ace/Strategies_T.h @@ -15,21 +15,20 @@ #include "ace/pre.h" -#include "ace/Hash_Map_Manager.h" +#include "ace/Hash_Map_Manager_T.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "ace/Service_Config.h" #include "ace/Reactor.h" -#include "ace/Synch_Options.h" #include "ace/Thread_Manager.h" #include "ace/Connection_Recycling_Strategy.h" #include "ace/Refcountable.h" #include "ace/Hashable.h" #include "ace/Recyclable.h" + // Needed for broken linkers that can't grok long symbols. #define ACE_Refcounted_Hash_Recyclable ARHR @@ -938,15 +937,15 @@ public: virtual int cleanup_hint (const void *recycling_act, void **act_holder = 0); - // = Typedefs for managing the map + // = Traits for managing the map typedef ACE_Refcounted_Hash_Recyclable<ACE_PEER_CONNECTOR_ADDR> REFCOUNTED_HASH_RECYCLABLE_ADDRESS; - typedef ACE_Hash_Map_Manager<REFCOUNTED_HASH_RECYCLABLE_ADDRESS, SVC_HANDLER *, ACE_Null_Mutex> + typedef ACE_Hash_Map_Manager_Ex<REFCOUNTED_HASH_RECYCLABLE_ADDRESS, SVC_HANDLER *, ACE_Hash<REFCOUNTED_HASH_RECYCLABLE_ADDRESS>, ACE_Equal_To<REFCOUNTED_HASH_RECYCLABLE_ADDRESS>, ACE_Null_Mutex> CONNECTION_MAP; - typedef ACE_Hash_Map_Iterator<REFCOUNTED_HASH_RECYCLABLE_ADDRESS, SVC_HANDLER *, ACE_Null_Mutex> - CONNECTION_MAP_ITERATOR; - typedef ACE_Hash_Map_Entry<REFCOUNTED_HASH_RECYCLABLE_ADDRESS, SVC_HANDLER *> - CONNECTION_MAP_ENTRY; + + // (Two) Deprecated and redundant typedefs + typedef CONNECTION_MAP::ITERATOR CONNECTION_MAP_ITERATOR; + typedef CONNECTION_MAP::ENTRY CONNECTION_MAP_ENTRY; typedef ACE_Reverse_Lock<MUTEX> REVERSE_MUTEX; @@ -967,8 +966,8 @@ protected: int perms); /// Find an idle handle. - int find (ACE_Refcounted_Hash_Recyclable<ACE_PEER_CONNECTOR_ADDR> &search_addr, - ACE_Hash_Map_Entry<ACE_Refcounted_Hash_Recyclable<ACE_PEER_CONNECTOR_ADDR>, SVC_HANDLER *> *&entry); + int find (REFCOUNTED_HASH_RECYCLABLE_ADDRESS &search_addr, + CONNECTION_MAP::ENTRY *&entry); /// Remove from cache (non-locking version). virtual int purge_i (const void *recycling_act); @@ -995,7 +994,7 @@ protected: int reuse_addr, int flags, int perms, - ACE_Hash_Map_Entry<ACE_Refcounted_Hash_Recyclable<ACE_PEER_CONNECTOR_ADDR>, SVC_HANDLER *> *&entry, + CONNECTION_MAP::ENTRY *&entry, int &found); int find_or_create_svc_handler_i (SVC_HANDLER *&sh, @@ -1005,17 +1004,18 @@ protected: int reuse_addr, int flags, int perms, - ACE_Hash_Map_Entry<ACE_Refcounted_Hash_Recyclable<ACE_PEER_CONNECTOR_ADDR>, SVC_HANDLER *> *&entry, + CONNECTION_MAP::ENTRY *&entry, int &found); - virtual int connect_svc_handler_i (SVC_HANDLER *&sh, - const ACE_PEER_CONNECTOR_ADDR &remote_addr, - ACE_Time_Value *timeout, - const ACE_PEER_CONNECTOR_ADDR &local_addr, - int reuse_addr, - int flags, - int perms, - int &found); + virtual int connect_svc_handler_i ( + SVC_HANDLER *&sh, + const ACE_PEER_CONNECTOR_ADDR &remote_addr, + ACE_Time_Value *timeout, + const ACE_PEER_CONNECTOR_ADDR &local_addr, + int reuse_addr, + int flags, + int perms, + int &found); /// Table that maintains the cache of connected <SVC_HANDLER>s. CONNECTION_MAP connection_map_; diff --git a/ace/Svc_Conf.y b/ace/Svc_Conf.y index a175ae35bea..002d4d59b00 100644 --- a/ace/Svc_Conf.y +++ b/ace/Svc_Conf.y @@ -8,11 +8,14 @@ #include "ace/ARGV.h" #include "ace/Module.h" #include "ace/Stream.h" +#include "ace/Service_Types.h" + ACE_RCSID (ace, Svc_Conf_y, "$Id$") + // Prototypes. static ACE_Module_Type *ace_get_module (ACE_Static_Node *str_rec, ACE_Static_Node *svc_type, diff --git a/ace/Svc_Conf_y.cpp b/ace/Svc_Conf_y.cpp index 426fccbb84c..c89c43fb9d9 100644 --- a/ace/Svc_Conf_y.cpp +++ b/ace/Svc_Conf_y.cpp @@ -28,11 +28,14 @@ #include "ace/ARGV.h" #include "ace/Module.h" #include "ace/Stream.h" +#include "ace/Service_Types.h" + ACE_RCSID (ace, Svc_Conf_y, "$Id$") + // Prototypes. static ACE_Module_Type *ace_get_module (ACE_Static_Node *str_rec, ACE_Static_Node *svc_type, diff --git a/ace/Synch_Options.cpp b/ace/Synch_Options.cpp index 0febeccfb29..0c7a1ba1951 100644 --- a/ace/Synch_Options.cpp +++ b/ace/Synch_Options.cpp @@ -1,14 +1,17 @@ -// $Id$ - #include "ace/Synch_Options.h" #if !defined (__ACE_INLINE__) #include "ace/Synch_Options.i" #endif /* __ACE_INLINE__ */ -ACE_RCSID(ace, Synch_Options, "$Id$") +#include "ace/Trace.h" + +ACE_RCSID (ace, + Synch_Options, + "$Id$") + -ACE_ALLOC_HOOK_DEFINE(ACE_Synch_Options) +ACE_ALLOC_HOOK_DEFINE (ACE_Synch_Options) void ACE_Synch_Options::dump (void) const @@ -28,7 +31,7 @@ ACE_Synch_Options ACE_Synch_Options::synch; /* static */ ACE_Synch_Options ACE_Synch_Options::asynch (ACE_Synch_Options::USE_REACTOR); -ACE_Synch_Options::ACE_Synch_Options (u_long options, +ACE_Synch_Options::ACE_Synch_Options (unsigned long options, const ACE_Time_Value &timeout, const void *arg) { @@ -37,7 +40,7 @@ ACE_Synch_Options::ACE_Synch_Options (u_long options, } void -ACE_Synch_Options::set (u_long options, +ACE_Synch_Options::set (unsigned long options, const ACE_Time_Value &timeout, const void *arg) { @@ -56,14 +59,14 @@ ACE_Synch_Options::set (u_long options, } int -ACE_Synch_Options::operator[] (u_long option) const +ACE_Synch_Options::operator[] (unsigned long option) const { ACE_TRACE ("ACE_Synch_Options::operator[]"); return (this->options_ & option) != 0; } void -ACE_Synch_Options::operator= (u_long option) +ACE_Synch_Options::operator= (unsigned long option) { ACE_TRACE ("ACE_Synch_Options::operator="); this->options_ |= option; diff --git a/ace/Synch_Options.h b/ace/Synch_Options.h index 82953be7e1b..858f0ccebe3 100644 --- a/ace/Synch_Options.h +++ b/ace/Synch_Options.h @@ -21,7 +21,8 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "ace/OS.h" +#include "ace/Time_Value.h" + /** * @class ACE_Synch_Options @@ -76,7 +77,7 @@ public: // = Initialization methods. /// Initialize the Synch_Options based on parameters. - ACE_Synch_Options (u_long options = 0, + ACE_Synch_Options (unsigned long options = 0, const ACE_Time_Value &timeout = ACE_Time_Value::zero, const void *arg = 0); @@ -84,15 +85,15 @@ public: ~ACE_Synch_Options (void); /// Initialize the Synch_Options based on parameters. - void set (u_long options = 0, + void set (unsigned long options = 0, const ACE_Time_Value &timeout = ACE_Time_Value::zero, const void *arg = 0); /// Get method for determining which options are enabled. - int operator[] (u_long option) const; + int operator[] (unsigned long option) const; /// Set method for enabling certain options. - void operator= (u_long option); + void operator= (unsigned long option); /// Returns the "magic cookie" argument. const void *arg (void) const; @@ -135,7 +136,7 @@ public: private: /// Keeps track of the enabled options. - u_long options_; + unsigned long options_; /// Amount of time to wait for timeouts. ACE_Time_Value timeout_; diff --git a/ace/Template_Instantiations.cpp b/ace/Template_Instantiations.cpp index 0aa01515cc5..28f6aa318e7 100644 --- a/ace/Template_Instantiations.cpp +++ b/ace/Template_Instantiations.cpp @@ -227,9 +227,6 @@ template class ACE_TSS_Singleton<ACE_Dynamic, ACE_Null_Mutex>; template class ACE_Hash_Map_Entry<ACE_NS_String, ACE_NS_Internal>; template class ACE_Hash<ACE_NS_String>; template class ACE_Equal_To<ACE_NS_String>; -template class ACE_Hash_Map_Manager<ACE_NS_String, ACE_NS_Internal, ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator<ACE_NS_String, ACE_NS_Internal, ACE_Null_Mutex>; -template class ACE_Hash_Map_Reverse_Iterator<ACE_NS_String, ACE_NS_Internal, ACE_Null_Mutex>; template class ACE_Hash_Map_Manager_Ex<ACE_NS_String, ACE_NS_Internal, ACE_Hash<ACE_NS_String>, ACE_Equal_To<ACE_NS_String>, ACE_Null_Mutex>; template class ACE_Hash_Map_Iterator_Ex<ACE_NS_String, ACE_NS_Internal, ACE_Hash<ACE_NS_String>, ACE_Equal_To<ACE_NS_String>, ACE_Null_Mutex>; template class ACE_Hash_Map_Reverse_Iterator_Ex<ACE_NS_String, ACE_NS_Internal, ACE_Hash<ACE_NS_String>, ACE_Equal_To<ACE_NS_String>, ACE_Null_Mutex>; @@ -245,9 +242,6 @@ template class ACE_Map_Iterator_Base<ACE_NS_String, ACE_NS_Internal, ACE_Null_Mu // from Filecache.cpp #if defined (ACE_HAS_TEMPLATE_SPECIALIZATION) template class ACE_Hash_Map_Entry<const char *, ACE_Filecache_Object *>; -template class ACE_Hash_Map_Manager<const char *, ACE_Filecache_Object *, ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator<const char *, ACE_Filecache_Object *, ACE_Null_Mutex>; -template class ACE_Hash_Map_Reverse_Iterator<const char *, ACE_Filecache_Object *, ACE_Null_Mutex>; template class ACE_Hash_Map_Manager_Ex<const char *, ACE_Filecache_Object *, ACE_Hash<const char *>, ACE_Equal_To<const char *>, ACE_Null_Mutex>; template class ACE_Hash_Map_Iterator_Base_Ex<const char *, ACE_Filecache_Object *, ACE_Hash<const char *>, ACE_Equal_To<const char *>, ACE_Null_Mutex>; template class ACE_Hash_Map_Iterator_Ex<const char *, ACE_Filecache_Object *, ACE_Hash<const char *>, ACE_Equal_To<const char *>, ACE_Null_Mutex>; @@ -256,9 +250,6 @@ template class ACE_Hash_Map_Reverse_Iterator_Ex<const char *, ACE_Filecache_Obje template class ACE_Hash_Map_Entry<ACE_TString, ACE_Filecache_Object *>; template class ACE_Hash<ACE_TString>; template class ACE_Equal_To<ACE_TString>; -template class ACE_Hash_Map_Manager<ACE_TString, ACE_Filecache_Object *, ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator<ACE_TString, ACE_Filecache_Object *, ACE_Null_Mutex>; -template class ACE_Hash_Map_Reverse_Iterator<ACE_TString, ACE_Filecache_Object *, ACE_Null_Mutex>; template class ACE_Hash_Map_Manager_Ex<ACE_TString, ACE_Filecache_Object *, ACE_Hash<ACE_TString>, ACE_Equal_To<ACE_TString>, ACE_Null_Mutex>; template class ACE_Hash_Map_Iterator_Base_Ex<ACE_TString, ACE_Filecache_Object *, ACE_Hash<ACE_TString>, ACE_Equal_To<ACE_TString>, ACE_Null_Mutex>; template class ACE_Hash_Map_Iterator_Ex<ACE_TString, ACE_Filecache_Object *, ACE_Hash<ACE_TString>, ACE_Equal_To<ACE_TString>, ACE_Null_Mutex>; diff --git a/ace/Token_Collection.cpp b/ace/Token_Collection.cpp index e362d9e2aed..291a0f3a450 100644 --- a/ace/Token_Collection.cpp +++ b/ace/Token_Collection.cpp @@ -1,5 +1,3 @@ -// $Id$ - #include "ace/Token_Collection.h" #if !defined (__ACE_INLINE__) @@ -8,7 +6,11 @@ #if defined (ACE_HAS_TOKENS_LIBRARY) -ACE_RCSID(ace, Token_Collection, "$Id$") + +ACE_RCSID (ace, + Token_Collection, + "$Id$") + ACE_Token_Collection::ACE_Token_Collection (int debug, const ACE_TCHAR *name) @@ -78,9 +80,9 @@ ACE_Token_Collection::acquire (int notify, { ACE_TRACE ("ACE_Token_Collection::acquire"); - COLLECTION_ITERATOR iterator (collection_); + COLLECTION::ITERATOR iterator (collection_); - for (COLLECTION_ENTRY *temp = 0; + for (COLLECTION::ENTRY *temp = 0; iterator.next (temp) != 0; iterator.advance ()) { @@ -143,9 +145,9 @@ ACE_Token_Collection::tryacquire (void (*sleep_hook)(void *)) { ACE_TRACE ("ACE_Token_Collection::tryacquire"); - COLLECTION_ITERATOR iterator (collection_); + COLLECTION::ITERATOR iterator (collection_); - for (COLLECTION_ENTRY *temp = 0; + for (COLLECTION::ENTRY *temp = 0; iterator.next (temp) != 0; iterator.advance ()) { @@ -166,9 +168,9 @@ ACE_Token_Collection::renew (int requeue_position, { ACE_TRACE ("ACE_Token_Collection::renew"); - COLLECTION_ITERATOR iterator (collection_); + COLLECTION::ITERATOR iterator (collection_); - for (COLLECTION_ENTRY *temp = 0; + for (COLLECTION::ENTRY *temp = 0; iterator.next (temp) != 0; iterator.advance ()) { @@ -208,9 +210,9 @@ ACE_Token_Collection::release (ACE_Synch_Options &) { ACE_TRACE ("ACE_Token_Collection::release"); - COLLECTION_ITERATOR iterator (collection_); + COLLECTION::ITERATOR iterator (collection_); - for (COLLECTION_ENTRY *temp = 0; + for (COLLECTION::ENTRY *temp = 0; iterator.next (temp) != 0; iterator.advance ()) { @@ -242,15 +244,15 @@ ACE_Token_Collection::release (const ACE_TCHAR *token_name, ACE_Token_Collection::~ACE_Token_Collection (void) { ACE_TRACE ("ACE_Token_Collection::~ACE_Token_Collection"); - COLLECTION_ITERATOR iterator (collection_); + COLLECTION::ITERATOR iterator (collection_); - for (COLLECTION_ENTRY *temp = 0; + for (COLLECTION::ENTRY *temp = 0; iterator.next (temp) != 0; iterator.advance ()) { delete temp->int_id_; // The ext_id_'s delete themselves when the array of - // COLLECTION_ENTRYs goes away. + // COLLECTION::ENTRYs goes away. } } diff --git a/ace/Token_Collection.h b/ace/Token_Collection.h index 3c6e4297214..60ecf8270e6 100644 --- a/ace/Token_Collection.h +++ b/ace/Token_Collection.h @@ -202,12 +202,18 @@ protected: COLLECTION; /// Allows iterations through collection_ - typedef ACE_Map_Iterator<TOKEN_NAME, ACE_Token_Proxy *, ACE_Null_Mutex> - COLLECTION_ITERATOR; + /** + * @note Deprecated typedef. Use COLLECTION::ITERATOR trait + * instead. + */ + typedef COLLECTION::ITERATOR COLLECTION_ITERATOR; /// Allows iterations through collection_ - typedef ACE_Map_Entry<TOKEN_NAME, ACE_Token_Proxy *> - COLLECTION_ENTRY; + /** + * @note Deprecated typedef. Use COLLECTION::ENTRY trait + * instead. + */ + typedef COLLECTION::ENTRY COLLECTION_ENTRY; /// COLLECTION maintains a mapping from token names to ACE_Tokens*. COLLECTION collection_; diff --git a/ace/Token_Invariants.cpp b/ace/Token_Invariants.cpp index e709e1ea65b..69f2c8fd32b 100644 --- a/ace/Token_Invariants.cpp +++ b/ace/Token_Invariants.cpp @@ -1,11 +1,13 @@ -// $Id$ - #include "ace/Token_Invariants.h" #include "ace/Object_Manager.h" #if defined (ACE_HAS_TOKENS_LIBRARY) -ACE_RCSID(ace, Token_Invariants, "$Id$") + +ACE_RCSID (ace, + Token_Invariants, + "$Id$") + ACE_Token_Invariant_Manager *ACE_Token_Invariant_Manager::instance_ = 0; @@ -203,16 +205,17 @@ ACE_Token_Invariant_Manager::get_rwlock (const ACE_TCHAR *token_name, ACE_Token_Invariant_Manager::~ACE_Token_Invariant_Manager (void) { ACE_TRACE ("ACE_Token_Invariant_Manager::~ACE_Token_Invariant_Manager"); - MUTEX_COLLECTION_ITERATOR iterator (mutex_collection_); - for (MUTEX_COLLECTION_ENTRY *temp = 0; + MUTEX_COLLECTION::ITERATOR iterator (mutex_collection_); + + for (MUTEX_COLLECTION::ENTRY *temp = 0; iterator.next (temp) != 0; iterator.advance ()) delete temp->int_id_; - RWLOCK_COLLECTION_ITERATOR iterator2 (rwlock_collection_); + RWLOCK_COLLECTION::ITERATOR iterator2 (rwlock_collection_); - for (RWLOCK_COLLECTION_ENTRY *temp2 = 0; + for (RWLOCK_COLLECTION::ENTRY *temp2 = 0; iterator2.next (temp2) != 0; iterator2.advance ()) delete temp2->int_id_; diff --git a/ace/Token_Invariants.h b/ace/Token_Invariants.h index e5c10ebaed6..84372a731a5 100644 --- a/ace/Token_Invariants.h +++ b/ace/Token_Invariants.h @@ -1,4 +1,4 @@ -/* -*- C++ -*- */ +// -*- C++ -*- //============================================================================= /** @@ -193,12 +193,18 @@ protected: MUTEX_COLLECTION; /// Allows iterations through collection. - typedef ACE_Map_Iterator<TOKEN_NAME, ACE_Mutex_Invariants *, ACE_Null_Mutex> - MUTEX_COLLECTION_ITERATOR; + /** + * @note Deprecated typedef. Use MUTEX_COLLECTION::ITERATOR trait + * instead. + */ + typedef MUTEX_COLLECTION::ITERATOR MUTEX_COLLECTION_ITERATOR; /// Allows iterations through collection. - typedef ACE_Map_Entry<TOKEN_NAME, ACE_Mutex_Invariants *> - MUTEX_COLLECTION_ENTRY; + /** + * @note Deprecated typedef. Use MUTEX_COLLECTION::ENTRY trait + * instead. + */ + typedef MUTEX_COLLECTION::ENTRY MUTEX_COLLECTION_ENTRY; /// MUTEX_COLLECTION maintains a mapping from token names to mutexes. MUTEX_COLLECTION mutex_collection_; @@ -208,12 +214,18 @@ protected: RWLOCK_COLLECTION; /// Allows iterations through collection. - typedef ACE_Map_Iterator<TOKEN_NAME, ACE_RWLock_Invariants *, ACE_Null_Mutex> - RWLOCK_COLLECTION_ITERATOR; + /** + * @note Deprecated typedef. Use RWLOCK_COLLECTION::ITERATOR trait + * instead. + */ + typedef RWLOCK_COLLECTION::ITERATOR RWLOCK_COLLECTION_ITERATOR; /// Allows iterations through collection. - typedef ACE_Map_Entry<TOKEN_NAME, ACE_RWLock_Invariants *> - RWLOCK_COLLECTION_ENTRY; + /** + * @note Deprecated typedef. Use RWLOCK_COLLECTION::ENTRY trait + * instead. + */ + typedef RWLOCK_COLLECTION::ENTRY RWLOCK_COLLECTION_ENTRY; /// MUTEX_COLLECTION maintains a mapping from token names to mutexes. RWLOCK_COLLECTION rwlock_collection_; diff --git a/ace/Token_Manager.cpp b/ace/Token_Manager.cpp index 13e21c361fc..d14871ab52c 100644 --- a/ace/Token_Manager.cpp +++ b/ace/Token_Manager.cpp @@ -1,5 +1,3 @@ -// $Id$ - #include "ace/Token_Manager.h" #include "ace/Object_Manager.h" @@ -9,7 +7,9 @@ #if defined (ACE_HAS_TOKENS_LIBRARY) -ACE_RCSID(ace, Token_Manager, "$Id$") +ACE_RCSID (ace, + Token_Manager, + "$Id$") // singleton token manager ACE_Token_Manager *ACE_Token_Manager::token_manager_ = 0; @@ -23,16 +23,16 @@ ACE_Token_Manager::~ACE_Token_Manager () { ACE_TRACE ("ACE_Token_Manager::~ACE_Token_Manager"); - COLLECTION_ITERATOR iterator (collection_); + COLLECTION::ITERATOR iterator (collection_); - for (COLLECTION_ENTRY *temp = 0; + for (COLLECTION::ENTRY *temp = 0; iterator.next (temp) != 0; iterator.advance ()) { // @ should I be doing an unbind here? delete temp->int_id_; // The ext_id_'s delete themselves when the array of - // COLLECTION_ENTRYs goes away. + // COLLECTION::ENTRYs goes away. } } @@ -119,8 +119,8 @@ ACE_Token_Manager::check_deadlock (ACE_Token_Proxy *proxy) // Whether or not we detect deadlock, we have to unmark all tokens // for the next time. - COLLECTION_ITERATOR iterator (collection_); - for (COLLECTION_ENTRY *temp = 0; + COLLECTION::ITERATOR iterator (collection_); + for (COLLECTION::ENTRY *temp = 0; iterator.next (temp) != 0; iterator.advance ()) temp->int_id_->visit (0); @@ -193,8 +193,8 @@ ACE_Token_Manager::check_deadlock (ACE_Tokens *token, ACE_Token_Proxy *proxy) ACE_Tokens * ACE_Token_Manager::token_waiting_for (const ACE_TCHAR *client_id) { - COLLECTION_ITERATOR iterator (collection_); - for (COLLECTION_ENTRY *temp = 0; + COLLECTION::ITERATOR iterator (collection_); + for (COLLECTION::ENTRY *temp = 0; iterator.next (temp) != 0; iterator.advance ()) { diff --git a/ace/Token_Manager.h b/ace/Token_Manager.h index df01b2f5bfb..15b17624b40 100644 --- a/ace/Token_Manager.h +++ b/ace/Token_Manager.h @@ -117,12 +117,18 @@ private: COLLECTION; /// Allows iterations through collection_ - typedef ACE_Map_Iterator<TOKEN_NAME, ACE_Tokens *, ACE_Null_Mutex> - COLLECTION_ITERATOR; + /** + * @note Deprecated typedef. Use COLLECTION::ITERATOR trait + * instead. + */ + typedef COLLECTION::ITERATOR COLLECTION_ITERATOR; /// Allows iterations through collection_ - typedef ACE_Map_Entry<TOKEN_NAME, ACE_Tokens *> - COLLECTION_ENTRY; + /** + * @note Deprecated typedef. Use COLLECTION::ENTRY trait + * instead. + */ + typedef COLLECTION::ENTRY COLLECTION_ENTRY; /// COLLECTION maintains a mapping from token names to ACE_Tokens*. COLLECTION collection_; diff --git a/ace/WIN32_Asynch_IO.cpp b/ace/WIN32_Asynch_IO.cpp index 1e35396546f..0300f1d6f76 100644 --- a/ace/WIN32_Asynch_IO.cpp +++ b/ace/WIN32_Asynch_IO.cpp @@ -1,8 +1,8 @@ -// $Id$ - #include "ace/WIN32_Asynch_IO.h" -// ACE_RCSID(ace, Asynch_IO, "$Id$") +ACE_RCSID (ace, + Win32_Asynch_IO, + "$Id$") #if (defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) @@ -218,18 +218,25 @@ ACE_WIN32_Asynch_Read_Stream_Result::handle (void) const return this->handle_; } -ACE_WIN32_Asynch_Read_Stream_Result::ACE_WIN32_Asynch_Read_Stream_Result (ACE_Handler &handler, - ACE_HANDLE handle, - ACE_Message_Block &message_block, - size_t bytes_to_read, - const void* act, - ACE_HANDLE event, - int priority, - int signal_number, - int scatter_enabled) +ACE_WIN32_Asynch_Read_Stream_Result::ACE_WIN32_Asynch_Read_Stream_Result ( + ACE_Handler &handler, + ACE_HANDLE handle, + ACE_Message_Block &message_block, + size_t bytes_to_read, + const void* act, + ACE_HANDLE event, + int priority, + int signal_number, + int scatter_enabled) : ACE_Asynch_Result_Impl (), ACE_Asynch_Read_Stream_Result_Impl (), - ACE_WIN32_Asynch_Result (handler, act, event, 0, 0, priority, signal_number), + ACE_WIN32_Asynch_Result (handler, + act, + event, + 0, + 0, + priority, + signal_number), bytes_to_read_ (bytes_to_read), message_block_ (message_block), handle_ (handle), @@ -633,15 +640,16 @@ ACE_WIN32_Asynch_Write_Stream_Result::handle (void) const return this->handle_; } -ACE_WIN32_Asynch_Write_Stream_Result::ACE_WIN32_Asynch_Write_Stream_Result (ACE_Handler &handler, - ACE_HANDLE handle, - ACE_Message_Block &message_block, - size_t bytes_to_write, - const void* act, - ACE_HANDLE event, - int priority, - int signal_number, - int gather_enabled) +ACE_WIN32_Asynch_Write_Stream_Result::ACE_WIN32_Asynch_Write_Stream_Result ( + ACE_Handler &handler, + ACE_HANDLE handle, + ACE_Message_Block &message_block, + size_t bytes_to_write, + const void* act, + ACE_HANDLE event, + int priority, + int signal_number, + int gather_enabled) : ACE_Asynch_Result_Impl (), ACE_Asynch_Write_Stream_Result_Impl (), ACE_WIN32_Asynch_Result (handler, act, event, 0, 0, priority, signal_number), @@ -1025,17 +1033,18 @@ ACE_WIN32_Asynch_Write_Stream::proactor (void) const return ACE_WIN32_Asynch_Operation::proactor (); } -ACE_WIN32_Asynch_Read_File_Result::ACE_WIN32_Asynch_Read_File_Result (ACE_Handler &handler, - ACE_HANDLE handle, - ACE_Message_Block &message_block, - size_t bytes_to_read, - const void* act, - u_long offset, - u_long offset_high, - ACE_HANDLE event, - int priority, - int signal_number, - int scatter_enabled) +ACE_WIN32_Asynch_Read_File_Result::ACE_WIN32_Asynch_Read_File_Result ( + ACE_Handler &handler, + ACE_HANDLE handle, + ACE_Message_Block &message_block, + size_t bytes_to_read, + const void* act, + u_long offset, + u_long offset_high, + ACE_HANDLE event, + int priority, + int signal_number, + int scatter_enabled) : ACE_Asynch_Result_Impl (), ACE_Asynch_Read_Stream_Result_Impl (), ACE_Asynch_Read_File_Result_Impl (), @@ -1424,17 +1433,18 @@ ACE_WIN32_Asynch_Read_File::proactor (void) const return ACE_WIN32_Asynch_Operation::proactor (); } -ACE_WIN32_Asynch_Write_File_Result::ACE_WIN32_Asynch_Write_File_Result (ACE_Handler &handler, - ACE_HANDLE handle, - ACE_Message_Block &message_block, - size_t bytes_to_write, - const void* act, - u_long offset, - u_long offset_high, - ACE_HANDLE event, - int priority, - int signal_number, - int gather_enabled) +ACE_WIN32_Asynch_Write_File_Result::ACE_WIN32_Asynch_Write_File_Result ( + ACE_Handler &handler, + ACE_HANDLE handle, + ACE_Message_Block &message_block, + size_t bytes_to_write, + const void* act, + u_long offset, + u_long offset_high, + ACE_HANDLE event, + int priority, + int signal_number, + int gather_enabled) : ACE_Asynch_Result_Impl (), ACE_Asynch_Write_Stream_Result_Impl (), ACE_Asynch_Write_File_Result_Impl (), @@ -1852,18 +1862,25 @@ ACE_WIN32_Asynch_Accept_Result::accept_handle (void) const return this->accept_handle_; } -ACE_WIN32_Asynch_Accept_Result::ACE_WIN32_Asynch_Accept_Result (ACE_Handler &handler, - ACE_HANDLE listen_handle, - ACE_HANDLE accept_handle, - ACE_Message_Block &message_block, - size_t bytes_to_read, - const void* act, - ACE_HANDLE event, - int priority, - int signal_number) +ACE_WIN32_Asynch_Accept_Result::ACE_WIN32_Asynch_Accept_Result ( + ACE_Handler &handler, + ACE_HANDLE listen_handle, + ACE_HANDLE accept_handle, + ACE_Message_Block &message_block, + size_t bytes_to_read, + const void* act, + ACE_HANDLE event, + int priority, + int signal_number) : ACE_Asynch_Result_Impl (), ACE_Asynch_Accept_Result_Impl (), - ACE_WIN32_Asynch_Result (handler, act, event, 0, 0, priority, signal_number), + ACE_WIN32_Asynch_Result (handler, + act, + event, + 0, + 0, + priority, + signal_number), bytes_to_read_ (bytes_to_read), message_block_ (message_block), listen_handle_ (listen_handle), @@ -2563,9 +2580,9 @@ ACE_WIN32_Asynch_Connect::cancel_uncompleted (int flg_notify, ACE_Handle_Set & s int retval = 0; - MAP_ITERATOR iter (result_map_); + MAP_MANAGER::ITERATOR iter (result_map_); - MAP_ENTRY * me = 0; + MAP_MANAGER::ENTRY * me = 0; set.reset (); @@ -2805,22 +2822,29 @@ ACE_WIN32_Asynch_Transmit_File_Result::flags (void) const return this->flags_; } -ACE_WIN32_Asynch_Transmit_File_Result::ACE_WIN32_Asynch_Transmit_File_Result (ACE_Handler &handler, - ACE_HANDLE socket, - ACE_HANDLE file, - ACE_Asynch_Transmit_File::Header_And_Trailer *header_and_trailer, - size_t bytes_to_write, - u_long offset, - u_long offset_high, - size_t bytes_per_send, - u_long flags, - const void *act, - ACE_HANDLE event, - int priority, - int signal_number) +ACE_WIN32_Asynch_Transmit_File_Result::ACE_WIN32_Asynch_Transmit_File_Result ( + ACE_Handler &handler, + ACE_HANDLE socket, + ACE_HANDLE file, + ACE_Asynch_Transmit_File::Header_And_Trailer *header_and_trailer, + size_t bytes_to_write, + u_long offset, + u_long offset_high, + size_t bytes_per_send, + u_long flags, + const void *act, + ACE_HANDLE event, + int priority, + int signal_number) : ACE_Asynch_Result_Impl (), ACE_Asynch_Transmit_File_Result_Impl (), - ACE_WIN32_Asynch_Result (handler, act, event, offset, offset_high, priority, signal_number), + ACE_WIN32_Asynch_Result (handler, + act, + event, + offset, + offset_high, + priority, + signal_number), socket_ (socket), file_ (file), header_and_trailer_ (header_and_trailer), @@ -3186,16 +3210,17 @@ ACE_WIN32_Asynch_Read_Dgram_Result::post_completion (ACE_Proactor_Impl *proactor return ACE_WIN32_Asynch_Result::post_completion (proactor); } -ACE_WIN32_Asynch_Read_Dgram_Result::ACE_WIN32_Asynch_Read_Dgram_Result (ACE_Handler &handler, - ACE_HANDLE handle, - ACE_Message_Block *message_block, - size_t bytes_to_read, - int flags, - int protocol_family, - const void* act, - ACE_HANDLE event, - int priority, - int signal_number) +ACE_WIN32_Asynch_Read_Dgram_Result::ACE_WIN32_Asynch_Read_Dgram_Result ( + ACE_Handler &handler, + ACE_HANDLE handle, + ACE_Message_Block *message_block, + size_t bytes_to_read, + int flags, + int protocol_family, + const void* act, + ACE_HANDLE event, + int priority, + int signal_number) : ACE_Asynch_Result_Impl (), ACE_Asynch_Read_Dgram_Result_Impl(), ACE_WIN32_Asynch_Result (handler, act, event, 0, 0, priority, signal_number), @@ -3516,18 +3541,25 @@ ACE_WIN32_Asynch_Write_Dgram_Result::post_completion (ACE_Proactor_Impl *proacto return ACE_WIN32_Asynch_Result::post_completion (proactor); } -ACE_WIN32_Asynch_Write_Dgram_Result::ACE_WIN32_Asynch_Write_Dgram_Result (ACE_Handler &handler, - ACE_HANDLE handle, - ACE_Message_Block *message_block, - size_t bytes_to_write, - int flags, - const void* act, - ACE_HANDLE event, - int priority, - int signal_number) +ACE_WIN32_Asynch_Write_Dgram_Result::ACE_WIN32_Asynch_Write_Dgram_Result ( + ACE_Handler &handler, + ACE_HANDLE handle, + ACE_Message_Block *message_block, + size_t bytes_to_write, + int flags, + const void* act, + ACE_HANDLE event, + int priority, + int signal_number) : ACE_Asynch_Result_Impl (), ACE_Asynch_Write_Dgram_Result_Impl(), - ACE_WIN32_Asynch_Result (handler, act, event, 0, 0, priority, signal_number), + ACE_WIN32_Asynch_Result (handler, + act, + event, + 0, + 0, + priority, + signal_number), bytes_to_write_ (bytes_to_write), message_block_ (message_block), flags_ (flags), diff --git a/ace/WIN32_Asynch_IO.h b/ace/WIN32_Asynch_IO.h index 6b48755b9ec..cbed064d077 100644 --- a/ace/WIN32_Asynch_IO.h +++ b/ace/WIN32_Asynch_IO.h @@ -1338,10 +1338,11 @@ private: typedef ACE_Map_Manager<ACE_HANDLE, ACE_WIN32_Asynch_Connect_Result *, ACE_SYNCH_NULL_MUTEX> MAP_MANAGER; - typedef ACE_Map_Iterator<ACE_HANDLE, ACE_WIN32_Asynch_Connect_Result *, ACE_SYNCH_NULL_MUTEX> - MAP_ITERATOR; - typedef ACE_Map_Entry<ACE_HANDLE, ACE_WIN32_Asynch_Connect_Result *> - MAP_ENTRY; + + // (Two) Deprecated typedefs. Use appropriate MAP_MANAGER traits + // instead. + typedef MAP_MANAGER::ITERATOR MAP_ITERATOR; + typedef MAP_MANAGER::ENTRY MAP_ENTRY; /// Map of Result pointers that correspond to all the <accept>'s /// pending. |