3 //==========================================================================
5 * @file Functor_String.h
7 * $Id: Functor_String.h 80826 2008-03-04 14:51:23Z wotte $
9 * Class template specializations for ACE_*String types implementing
10 * function objects that are used in various places in ATC. They
11 * could be placed in Functor.h. But we don't want to couple string
12 * types to the rest of ACE+TAO. Hence they are placed in a seperate
15 //==========================================================================
16 #ifndef ACE_FUNCTOR_STRING_H
17 #define ACE_FUNCTOR_STRING_H
18 #include /**/ "ace/pre.h"
20 #include /**/ "ace/config-all.h"
22 #if !defined (ACE_LACKS_PRAGMA_ONCE)
24 #endif /* ACE_LACKS_PRAGMA_ONCE */
26 #include /**/ "ace/ACE_export.h"
27 #include "ace/SStringfwd.h"
29 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
31 ////////////////////////////////////////////////////////////
32 // STL-style Functor Classes and Template Specializations //
33 ////////////////////////////////////////////////////////////
35 // Forward declaration since we are going to specialize that template
36 // here. The template itself requires this file so every user of the
37 // template should also see the specialization.
38 template <class TYPE
> class ACE_Hash
;
39 template <class TYPE
> class ACE_Equal_To
;
40 template <class TYPE
> class ACE_Less_Than
;
43 * @class ACE_Equal_To<ACE_CString>
45 * @brief Function object for determining whether two ACE_CStrings are
49 class ACE_Export ACE_Equal_To
<ACE_CString
>
52 int operator () (const ACE_CString
&lhs
,
53 const ACE_CString
&rhs
) const;
58 * @class ACE_Hash<ACE_CString>
60 * @brief Function object for hashing a ACE_CString
63 class ACE_Export ACE_Hash
<ACE_CString
>
66 /// Calls ACE::hash_pjw
67 unsigned long operator () (const ACE_CString
&lhs
) const;
72 * @class ACE_Less_Than<ACE_CString>
74 * @brief Function object for determining whether the first const string
75 * is less than the second const string.
78 class ACE_Export ACE_Less_Than
<ACE_CString
>
81 /// Simply calls ACE_OS::strcmp
82 int operator () (const ACE_CString
&lhs
,
83 const ACE_CString
&rhs
) const;
87 #if defined (ACE_USES_WCHAR)
90 * @class ACE_Equal_To<ACE_WString>
92 * @brief Function object for determining whether two ACE_CStrings are
96 class ACE_Export ACE_Equal_To
<ACE_WString
>
99 int operator () (const ACE_WString
&lhs
,
100 const ACE_WString
&rhs
) const;
105 * @class ACE_Hash<ACE_WString>
107 * @brief Function object for hashing a ACE_WString
110 class ACE_Export ACE_Hash
<ACE_WString
>
113 /// Calls ACE::hash_pjw
114 unsigned long operator () (const ACE_WString
&lhs
) const;
118 * @class ACE_Less_Than<ACE_WString>
120 * @brief Function object for determining whether the first const string
121 * is less than the second const string.
124 class ACE_Export ACE_Less_Than
<ACE_WString
>
127 /// Simply calls ACE_OS::strcmp
128 int operator () (const ACE_WString
&lhs
,
129 const ACE_WString
&rhs
) const;
132 #endif /*ACE_USES_WCHAR*/
134 ACE_END_VERSIONED_NAMESPACE_DECL
136 #if defined (__ACE_INLINE__)
137 #include "ace/Functor_String.inl"
138 #endif /* __ACE_INLINE__ */
140 #include /**/ "ace/post.h"
141 #endif /*ACE_FUNCTOR_STRING_H*/