summaryrefslogtreecommitdiff
path: root/ace/adapter/ace/Functor.h
blob: 6387ef9dd006e91041f6e9ed71e1eeca82124a5e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
// $Id$

#ifndef ACE_ADAPTER_FUNCTOR_H
#define ACE_ADAPTER_FUNCTOR_H
#include "ace/pre.h"

#include "../../Functor.h"

ACE_TEMPLATE_SPECIALIZATION
class ACE_Hash<const wchar_t *>
{
  // = TITLE
  //     Function object for hashing a const string
public:
  u_long operator () (const wchar_t *t) const
  { return ACE::hash_pjw  (t); }
};

ACE_TEMPLATE_SPECIALIZATION
class ACE_Hash<wchar_t *>
{
  // = TITLE
  //     Function object for hashing a string
public:
  u_long operator () (const wchar_t *t) const
  { return ACE::hash_pjw  (t); }
};

ACE_TEMPLATE_SPECIALIZATION
class ACE_Equal_To<const wchar_t *>
{
  // = TITLE
  //     Function object for determining whether two const strings are equal.
public:
  int operator () (const wchar_t *lhs,
                   const wchar_t *rhs) const
  { return ACE_OS::strcmp (lhs, rhs) == 0; }
};

ACE_TEMPLATE_SPECIALIZATION
class ACE_Export ACE_Equal_To<wchar_t *>
{
  // = TITLE
  //     Function object for determining whether two non-const
  //     strings are equal.
public:
  int operator () (const wchar_t *lhs,
                   const wchar_t *rhs) const
  { return ACE_OS::strcmp (lhs, rhs) == 0; }
};

ACE_TEMPLATE_SPECIALIZATION
class ACE_Export ACE_Less_Than<const wchar_t *>
{
  // = TITLE
  //     Function object for determining whether the first const string
  //     is less than the second const string.
public:
  int operator () (const wchar_t *lhs,
                   const wchar_t *rhs) const
  { return ACE_OS::strcmp (lhs, rhs) == 0; }
};

ACE_TEMPLATE_SPECIALIZATION
class ACE_Export ACE_Less_Than<wchar_t *>
{
  // = TITLE
  //     Function object for determining whether the first string
  //     is less than the second string.
public:
  int operator () (const wchar_t *lhs,
                   const wchar_t *rhs) const
  { return ACE_OS::strcmp (lhs, rhs) == 0; }
};

#include "ace/post.h"
#endif /* ACE_ADAPTER_FUNCTOR_H */