Fixed typos
[ACE_TAO.git] / ACE / ace / Functor_String.h
blobc04cc01c53a40d4cac9bf79cff69af55305699a1
1 // -*- C++ -*-
3 //==========================================================================
4 /**
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
11 * file.
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)
21 # pragma once
22 #endif /* ACE_LACKS_PRAGMA_ONCE */
24 #include /**/ "ace/ACE_export.h"
25 #include "ace/SStringfwd.h"
26 #include <string>
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;
41 /**
42 * @brief Function object for determining whether two ACE_CStrings are
43 * equal.
45 template<>
46 class ACE_Export ACE_Equal_To<ACE_CString>
48 public:
49 int operator () (const ACE_CString &lhs,
50 const ACE_CString &rhs) const;
54 /**
55 * @brief Function object for hashing a ACE_CString
57 template<>
58 class ACE_Export ACE_Hash<ACE_CString>
60 public:
61 /// Calls ACE::hash_pjw
62 unsigned long operator () (const ACE_CString &lhs) const;
66 /**
67 * @brief Function object for determining whether the first const string
68 * is less than the second const string.
70 template<>
71 class ACE_Export ACE_Less_Than<ACE_CString>
73 public:
74 /// Simply calls ACE_OS::strcmp
75 int operator () (const ACE_CString &lhs,
76 const ACE_CString &rhs) const;
79 /**
80 * @brief Function object for determining whether two std::strings are
81 * equal.
83 template<>
84 class ACE_Export ACE_Equal_To<std::string>
86 public:
87 int operator () (const std::string &lhs,
88 const std::string &rhs) const;
92 /**
93 * @brief Function object for hashing a std::string
95 template<>
96 class ACE_Export ACE_Hash<std::string>
98 public:
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.
108 template<>
109 class ACE_Export ACE_Less_Than<std::string>
111 public:
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
122 * equal.
124 template<>
125 class ACE_Export ACE_Equal_To<ACE_WString>
127 public:
128 int operator () (const ACE_WString &lhs,
129 const ACE_WString &rhs) const;
134 * @brief Function object for hashing a ACE_WString
136 template<>
137 class ACE_Export ACE_Hash<ACE_WString>
139 public:
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.
148 template<>
149 class ACE_Export ACE_Less_Than<ACE_WString>
151 public:
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*/