summaryrefslogtreecommitdiff
path: root/ACE/apps/JAWS2/JAWS/Cache_Manager.h
blob: c7837b935ba093df1e0f878cce815896dbc34f7c (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
/* -*- c++ -*- */
// $Id$

#ifndef JAWS_CACHE_MANAGER_H
#define JAWS_CACHE_MANAGER_H

#include "ace/ACE.h"

#include "JAWS/Cache_Manager_T.h"

class JAWS_String_Hash_Functor
{
public:
  JAWS_String_Hash_Functor (const char *s);
  operator unsigned long (void) const;

private:
  unsigned long i_;
};

class JAWS_String_Equal_Functor
{
public:
  JAWS_String_Equal_Functor (const char *s1, const char *s2);
  operator int (void) const;

private:
  int i_;
};

class JAWS_Strdup_String
{
public:

  JAWS_Strdup_String (void);
  JAWS_Strdup_String (const char *s);
  JAWS_Strdup_String (const JAWS_Strdup_String &s);
  ~JAWS_Strdup_String (void);

  operator const char * (void) const;
  void operator = (const char *s);
  void operator = (const JAWS_Strdup_String &s);

private:

  int *c_;
  char *s_;

};

typedef JAWS_Cache_Manager<JAWS_Strdup_String,
                          JAWS_Referenced_Cache_Object_Factory,
                          JAWS_String_Hash_Functor,
                          JAWS_String_Equal_Functor>
        JAWS_String_Referenced_Cache_Manager;

typedef JAWS_Cache_Manager<JAWS_Strdup_String,
                          JAWS_Counted_Cache_Object_Factory,
                          JAWS_String_Hash_Functor,
                          JAWS_String_Equal_Functor>
        JAWS_String_Counted_Cache_Manager;


#endif /* JAWS_CACHE_MANAGER_H */