3 //==========================================================================
5 * @file Functor_String.h
7 * Class template specializations for ACE_*String types implementing
8 * function objects that are used in various places in ATC. They
9 * could be placed in Functor.h. But we don't want to couple string
10 * types to the rest of ACE+TAO. Hence they are placed in a separate
13 //==========================================================================
14 #ifndef ACE_FUNCTOR_STRING_H
15 #define ACE_FUNCTOR_STRING_H
16 #include /**/ "ace/pre.h"
18 #include /**/ "ace/config-all.h"
20 #if !defined (ACE_LACKS_PRAGMA_ONCE)
22 #endif /* ACE_LACKS_PRAGMA_ONCE */
24 #include /**/ "ace/ACE_export.h"
25 #include "ace/SStringfwd.h"
28 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
30 ////////////////////////////////////////////////////////////
31 // STL-style Functor Classes and Template Specializations //
32 ////////////////////////////////////////////////////////////
34 // Forward declaration since we are going to specialize that template
35 // here. The template itself requires this file so every user of the
36 // template should also see the specialization.
37 template <class TYPE
> class ACE_Hash
;
38 template <class TYPE
> class ACE_Equal_To
;
39 template <class TYPE
> class ACE_Less_Than
;
42 * @brief Function object for determining whether two ACE_CStrings are
46 class ACE_Export ACE_Equal_To
<ACE_CString
>
49 int operator () (const ACE_CString
&lhs
,
50 const ACE_CString
&rhs
) const;
55 * @brief Function object for hashing a ACE_CString
58 class ACE_Export ACE_Hash
<ACE_CString
>
61 /// Calls ACE::hash_pjw
62 unsigned long operator () (const ACE_CString
&lhs
) const;
67 * @brief Function object for determining whether the first const string
68 * is less than the second const string.
71 class ACE_Export ACE_Less_Than
<ACE_CString
>
74 /// Simply calls ACE_OS::strcmp
75 int operator () (const ACE_CString
&lhs
,
76 const ACE_CString
&rhs
) const;
80 * @brief Function object for determining whether two std::strings are
84 class ACE_Export ACE_Equal_To
<std::string
>
87 int operator () (const std::string
&lhs
,
88 const std::string
&rhs
) const;
93 * @brief Function object for hashing a std::string
96 class ACE_Export ACE_Hash
<std::string
>
99 /// Calls ACE::hash_pjw
100 unsigned long operator () (const std::string
&lhs
) const;
105 * @brief Function object for determining whether the first const string
106 * is less than the second const string.
109 class ACE_Export ACE_Less_Than
<std::string
>
112 /// Simply calls std::string::compare
113 int operator () (const std::string
&lhs
,
114 const std::string
&rhs
) const;
118 #if defined (ACE_USES_WCHAR)
121 * @brief Function object for determining whether two ACE_WStrings are
125 class ACE_Export ACE_Equal_To
<ACE_WString
>
128 int operator () (const ACE_WString
&lhs
,
129 const ACE_WString
&rhs
) const;
134 * @brief Function object for hashing a ACE_WString
137 class ACE_Export ACE_Hash
<ACE_WString
>
140 /// Calls ACE::hash_pjw
141 unsigned long operator () (const ACE_WString
&lhs
) const;
145 * @brief Function object for determining whether the first const wstring
146 * is less than the second const wstring.
149 class ACE_Export ACE_Less_Than
<ACE_WString
>
152 /// Simply calls ACE_OS::strcmp
153 int operator () (const ACE_WString
&lhs
,
154 const ACE_WString
&rhs
) const;
157 #endif /*ACE_USES_WCHAR*/
159 ACE_END_VERSIONED_NAMESPACE_DECL
161 #if defined (__ACE_INLINE__)
162 #include "ace/Functor_String.inl"
163 #endif /* __ACE_INLINE__ */
165 #include /**/ "ace/post.h"
166 #endif /*ACE_FUNCTOR_STRING_H*/