Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

Functor.i

Go to the documentation of this file.
00001 /* -*- C++ -*- */
00002 // $Id: Functor.i,v 1.1.1.4.2.1 2003/04/21 19:14:54 chad Exp $
00003 
00004 // ============================================================================
00005 //
00006 // = LIBRARY
00007 //    ace
00008 //
00009 // = FILENAME
00010 //    Functor.i
00011 //
00012 // = DESCRIPTION
00013 //    Inlinable method definitions for non-templatized classes
00014 //    and template specializations implementing the GOF Command Pattern,
00015 //    and STL-style functors.
00016 //
00017 // = AUTHOR
00018 //    Chris Gill           <cdgill@cs.wustl.edu>
00019 //
00020 //    Based on Command Pattern implementations originally done by
00021 //
00022 //    Carlos O'Ryan        <coryan@cs.wustl.edu>  and
00023 //    Douglas C. Schmidt   <schmidt@cs.wustl.edu> and
00024 //    Sergio Flores-Gaitan <sergio@cs.wustl.edu>
00025 //
00026 //    and on STL-style functor implementations originally done by
00027 //
00028 //    Irfan Pyarali  <irfan@cs.wustl.edu>
00029 //
00030 // ============================================================================
00031 
00032 //////////////////////////////////////////////////////////////
00033 // GOF Command Pattern Classes and Template Specializations //
00034 //////////////////////////////////////////////////////////////
00035 
00036 // Default constructor.
00037 
00038 ACE_INLINE
00039 ACE_Command_Base::ACE_Command_Base (void)
00040 {
00041 }
00042 
00043 // Virtaul destructor.
00044 
00045 ACE_INLINE
00046 ACE_Command_Base::~ACE_Command_Base (void)
00047 {
00048 }
00049 
00050 ////////////////////////////////////////////////////////////
00051 // STL-style Functor Classes and Template Specializations //
00052 ////////////////////////////////////////////////////////////
00053 
00054 //ACE_TEMPLATE_METHOD_SPECIALIZATION
00055 ACE_INLINE u_long
00056 ACE_Hash<char>::operator () (char t) const
00057 {
00058   return t;
00059 }
00060 
00061 //ACE_TEMPLATE_METHOD_SPECIALIZATION
00062 ACE_INLINE u_long
00063 ACE_Hash<signed char>::operator () (signed char t) const
00064 {
00065   return t;
00066 }
00067 
00068 //ACE_TEMPLATE_METHOD_SPECIALIZATION
00069 ACE_INLINE u_long
00070 ACE_Hash<unsigned char>::operator () (unsigned char t) const
00071 {
00072   return t;
00073 }
00074 
00075 //ACE_TEMPLATE_METHOD_SPECIALIZATION
00076 ACE_INLINE u_long
00077 ACE_Hash<ACE_INT16>::operator () (ACE_INT16 t) const
00078 {
00079   return t;
00080 }
00081 
00082 //ACE_TEMPLATE_METHOD_SPECIALIZATION
00083 ACE_INLINE u_long
00084 ACE_Hash<ACE_UINT16>::operator () (ACE_UINT16 t) const
00085 {
00086   return t;
00087 }
00088 
00089 //ACE_TEMPLATE_METHOD_SPECIALIZATION
00090 ACE_INLINE u_long
00091 ACE_Hash<ACE_INT32>::operator () (ACE_INT32 t) const
00092 {
00093   return t;
00094 }
00095 
00096 //ACE_TEMPLATE_METHOD_SPECIALIZATION
00097 ACE_INLINE u_long
00098 ACE_Hash<ACE_UINT32>::operator () (ACE_UINT32 t) const
00099 {
00100   return t;
00101 }
00102 
00103 //ACE_TEMPLATE_METHOD_SPECIALIZATION
00104 ACE_INLINE u_long
00105 ACE_Hash<ACE_UINT64>::operator () (ACE_UINT64 t) const
00106 {
00107   return ACE_U64_TO_U32 (t);
00108 }
00109 
00110 
00111 //ACE_TEMPLATE_METHOD_SPECIALIZATION
00112 ACE_INLINE u_long
00113 ACE_Hash<const ACE_TCHAR *>::operator () (const ACE_TCHAR *t) const
00114 {
00115   return ACE::hash_pjw (t);
00116 }
00117 
00118 //ACE_TEMPLATE_METHOD_SPECIALIZATION
00119 ACE_INLINE u_long
00120 ACE_Hash<ACE_TCHAR *>::operator () (const ACE_TCHAR *t) const
00121 {
00122   return ACE::hash_pjw (t);
00123 }
00124 
00125 //ACE_TEMPLATE_METHOD_SPECIALIZATION
00126 ACE_INLINE u_long
00127 ACE_Hash<void *>::operator () (const void *t) const
00128 {
00129   return (u_long)((ptr_arith_t) t);
00130 }
00131 
00132 /***********************************************************************/
00133 //ACE_TEMPLATE_METHOD_SPECIALIZATION
00134 ACE_INLINE int
00135 ACE_Equal_To<const ACE_TCHAR *>::operator () (const ACE_TCHAR *lhs, const ACE_TCHAR *rhs) const
00136 {
00137   return !ACE_OS::strcmp (lhs, rhs);
00138 }
00139 
00140 //ACE_TEMPLATE_METHOD_SPECIALIZATION
00141 ACE_INLINE int
00142 ACE_Equal_To<ACE_TCHAR *>::operator () (const ACE_TCHAR *lhs, const ACE_TCHAR *rhs) const
00143 {
00144   return !ACE_OS::strcmp (lhs, rhs);
00145 }
00146 
00147 ACE_INLINE int
00148 ACE_Equal_To<ACE_UINT16>::operator () (const ACE_UINT16 lhs, const ACE_UINT16 rhs) const
00149 {
00150   return (lhs == rhs);
00151 }
00152 
00153 //ACE_TEMPLATE_METHOD_SPECIALIZATION
00154 ACE_INLINE int
00155 ACE_Equal_To<ACE_INT16>::operator () (const ACE_INT16 lhs, const ACE_INT16 rhs) const
00156 {
00157   return (lhs == rhs);
00158 }
00159 
00160 //ACE_TEMPLATE_METHOD_SPECIALIZATION
00161 ACE_INLINE int
00162 ACE_Equal_To<ACE_UINT32>::operator () (const ACE_UINT32 lhs, const ACE_UINT32 rhs) const
00163 {
00164   return (lhs == rhs);
00165 }
00166 
00167 //ACE_TEMPLATE_METHOD_SPECIALIZATION
00168 ACE_INLINE int
00169 ACE_Equal_To<ACE_INT32>::operator () (const ACE_INT32 lhs, const ACE_INT32 rhs) const
00170 {
00171   return (lhs == rhs);
00172 }
00173 
00174 //ACE_TEMPLATE_METHOD_SPECIALIZATION
00175 ACE_INLINE int
00176 ACE_Equal_To<ACE_UINT64>::operator () (const ACE_UINT64 lhs, const ACE_UINT64 rhs) const
00177 {
00178   return (lhs == rhs);
00179 }
00180 
00181 /****************************************************************************/
00182 //ACE_TEMPLATE_METHOD_SPECIALIZATION
00183 ACE_INLINE int
00184 ACE_Less_Than<const ACE_TCHAR *>::operator () (const ACE_TCHAR *lhs, const ACE_TCHAR *rhs) const
00185 {
00186   return (ACE_OS::strcmp (lhs, rhs) < 0) ? 1 : 0;
00187 }
00188 
00189 //ACE_TEMPLATE_METHOD_SPECIALIZATION
00190 ACE_INLINE int
00191 ACE_Less_Than<ACE_TCHAR *>::operator () (const ACE_TCHAR *lhs, const ACE_TCHAR *rhs) const
00192 {
00193   return (ACE_OS::strcmp (lhs, rhs) < 0) ? 1 : 0;
00194 }
00195 
00196 
00197 #if defined (ACE_USES_WCHAR)
00198 
00199 //ACE_TEMPLATE_METHOD_SPECIALIZATION
00200 ACE_INLINE u_long
00201 ACE_Hash<const ACE_ANTI_TCHAR *>::operator () (const ACE_ANTI_TCHAR *t) const
00202 {
00203   return ACE::hash_pjw (t);
00204 }
00205 
00206 //ACE_TEMPLATE_METHOD_SPECIALIZATION
00207 ACE_INLINE u_long
00208 ACE_Hash<ACE_ANTI_TCHAR *>::operator () (const ACE_ANTI_TCHAR *t) const
00209 {
00210   return ACE::hash_pjw (t);
00211 }
00212 
00213 //ACE_TEMPLATE_METHOD_SPECIALIZATION
00214 ACE_INLINE int
00215 ACE_Equal_To<const ACE_ANTI_TCHAR *>::operator () (const ACE_ANTI_TCHAR *lhs, const ACE_ANTI_TCHAR *rhs) const
00216 {
00217   return !ACE_OS::strcmp (lhs, rhs);
00218 }
00219 
00220 //ACE_TEMPLATE_METHOD_SPECIALIZATION
00221 ACE_INLINE int
00222 ACE_Equal_To<ACE_ANTI_TCHAR *>::operator () (const ACE_ANTI_TCHAR *lhs, const ACE_ANTI_TCHAR *rhs) const
00223 {
00224   return !ACE_OS::strcmp (lhs, rhs);
00225 }
00226 
00227 //ACE_TEMPLATE_METHOD_SPECIALIZATION
00228 ACE_INLINE int
00229 ACE_Less_Than<const ACE_ANTI_TCHAR *>::operator () (const ACE_ANTI_TCHAR *lhs, const ACE_ANTI_TCHAR *rhs) const
00230 {
00231   return (ACE_OS::strcmp (lhs, rhs) < 0) ? 1 : 0;
00232 }
00233 
00234 //ACE_TEMPLATE_METHOD_SPECIALIZATION
00235 ACE_INLINE int
00236 ACE_Less_Than<ACE_ANTI_TCHAR *>::operator () (const ACE_ANTI_TCHAR *lhs, const ACE_ANTI_TCHAR *rhs) const
00237 {
00238   return (ACE_OS::strcmp (lhs, rhs) < 0) ? 1 : 0;
00239 }
00240 
00241 #endif  // ACE_USES_WCHAR

Generated on Mon Jun 16 11:19:44 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002