Functor_String.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //==========================================================================
00004 /**
00005  *  @file    Functor_String.h
00006  *
00007  *  Functor_String.h,v 4.7 2005/11/24 09:48:54 ossama Exp
00008  *
00009  *   Class template specializations for ACE_*String types implementing
00010  *   function objects that are used in  various places in ATC. They
00011  *   could be placed in Functor.h. But we don't want to couple string
00012  *   types to the rest of ACE+TAO. Hence they are placed in a seperate
00013  *   file.
00014  */
00015 //==========================================================================
00016 #ifndef ACE_FUNCTOR_STRING_H
00017 #define ACE_FUNCTOR_STRING_H
00018 #include /**/ "ace/pre.h"
00019 
00020 #include "ace/config-all.h"
00021 
00022 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00023 # pragma once
00024 #endif /* ACE_LACKS_PRAGMA_ONCE */
00025 
00026 #include "ace/ACE_export.h"
00027 #include "ace/SStringfwd.h"
00028 
00029 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00030 
00031 ////////////////////////////////////////////////////////////
00032 // STL-style Functor Classes and Template Specializations //
00033 ////////////////////////////////////////////////////////////
00034 
00035 // Forward declaration since we are going to specialize that template
00036 // here. The template itself requires this file so every user of the
00037 // template should also see the specialization.
00038 template <class TYPE> class ACE_Hash;
00039 template <class TYPE> class ACE_Equal_To;
00040 template <class TYPE> class ACE_Less_Than;
00041 
00042 /**
00043  * @class ACE_Equal_To<ACE_CString>
00044  *
00045  * @brief Function object for determining whether two ACE_CStrings are
00046  * equal.
00047  */
00048 template<>
00049 class ACE_Export ACE_Equal_To<ACE_CString>
00050 {
00051 public:
00052   int operator () (const ACE_CString &lhs,
00053                    const ACE_CString &rhs) const;
00054 };
00055 
00056 
00057 /**
00058  * @class ACE_Hash<ACE_CString>
00059  *
00060  * @brief Function object for hashing a ACE_CString
00061  */
00062 template<>
00063 class ACE_Export ACE_Hash<ACE_CString>
00064 {
00065 public:
00066   /// Calls ACE::hash_pjw
00067   unsigned long operator () (const ACE_CString &lhs) const;
00068 };
00069 
00070 
00071 /**
00072  * @class ACE_Less_Than<ACE_CString>
00073  *
00074  * @brief Function object for determining whether the first const string
00075  * is less than the second const string.
00076  */
00077 template<>
00078 class ACE_Export ACE_Less_Than<ACE_CString>
00079 {
00080 public:
00081   /// Simply calls ACE_OS::strcmp
00082   int operator () (const ACE_CString &lhs,
00083                    const ACE_CString &rhs) const;
00084 };
00085 
00086 
00087 #if defined (ACE_USES_WCHAR)
00088 
00089 /**
00090  * @class ACE_Equal_To<ACE_WString>
00091  *
00092  * @brief Function object for determining whether two ACE_CStrings are
00093  * equal.
00094  */
00095 template<>
00096 class ACE_Export ACE_Equal_To<ACE_WString>
00097 {
00098 public:
00099   int operator () (const ACE_WString &lhs,
00100                    const ACE_WString &rhs) const;
00101 };
00102 
00103 
00104 /**
00105  * @class ACE_Hash<ACE_WString>
00106  *
00107  * @brief Function object for hashing a ACE_WString
00108  */
00109 template<>
00110 class ACE_Export ACE_Hash<ACE_WString>
00111 {
00112 public:
00113   /// Calls ACE::hash_pjw
00114   unsigned long operator () (const ACE_WString &lhs) const;
00115 };
00116 
00117 /**
00118  * @class ACE_Less_Than<ACE_WString>
00119  *
00120  * @brief Function object for determining whether the first const string
00121  * is less than the second const string.
00122  */
00123 template<>
00124 class ACE_Export ACE_Less_Than<ACE_WString>
00125 {
00126 public:
00127   /// Simply calls ACE_OS::strcmp
00128   int operator () (const ACE_WString &lhs,
00129                    const ACE_WString &rhs) const;
00130 };
00131 
00132 #endif /*ACE_USES_WCHAR*/
00133 
00134 ACE_END_VERSIONED_NAMESPACE_DECL
00135 
00136 #if defined (__ACE_INLINE__)
00137 #include "ace/Functor_String.inl"
00138 #endif /* __ACE_INLINE__ */
00139 
00140 #include /**/ "ace/post.h"
00141 #endif /*ACE_FUNCTOR_STRING_H*/

Generated on Thu Nov 9 09:41:51 2006 for ACE by doxygen 1.3.6