~ubuntu-branches/ubuntu/breezy/ace/breezy

« back to all changes in this revision

Viewing changes to ace/Cleanup_Strategies_T.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad, Benjamin Montgomery, Adam Conrad
  • Date: 2005-09-18 22:51:38 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 sarge) (0.1.2 woody)
  • Revision ID: james.westby@ubuntu.com-20050918225138-seav22q6fyylb536
Tags: 5.4.7-3ubuntu1
[ Benjamin Montgomery ]
* Added a patch for amd64 and powerpc that disables the compiler
  option -fvisibility-inlines-hidden

[ Adam Conrad ]
* Added DPATCH_OPTION_CPP=1 to debian/patches/00options to make
  Benjamin's above changes work correctly with dpatch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
//Cleanup_Strategies_T.cpp,v 4.8 2000/06/14 19:29:31 othman Exp
2
 
 
3
 
#ifndef CLEANUP_STRATEGIES_T_C
4
 
#define CLEANUP_STRATEGIES_T_C
5
 
 
6
 
#include "ace/Cleanup_Strategies_T.h"
7
 
 
8
 
#if !defined (ACE_LACKS_PRAGMA_ONCE)
9
 
#define ACE_LACKS_PRAGMA_ONCE
10
 
#endif /* ACE_LACKS_PRAGMA_ONCE */
11
 
 
12
 
ACE_RCSID(ace, Cleanup_Strategies_T, "Cleanup_Strategies_T.cpp,v 4.8 2000/06/14 19:29:31 othman Exp")
13
 
 
14
 
////////////////////////////////////////////////////////////////////////////
15
 
 
16
 
template <class KEY, class VALUE, class CONTAINER> int
17
 
ACE_Cleanup_Strategy<KEY, VALUE, CONTAINER>::cleanup (CONTAINER &container,
18
 
                                                      KEY *key,
19
 
                                                      VALUE *value)
20
 
{
21
 
  ACE_UNUSED_ARG (value);
22
 
 
23
 
  return container.unbind (*key);
24
 
}
25
 
 
26
 
////////////////////////////////////////////////////////////////////////////
27
 
 
28
 
template <class KEY, class VALUE, class CONTAINER> int
29
 
ACE_Recyclable_Handler_Cleanup_Strategy<KEY, VALUE, CONTAINER>::cleanup (CONTAINER &container,
30
 
                                                                         KEY *key,
31
 
                                                                         VALUE *)
32
 
{
33
 
  VALUE value;
34
 
 
35
 
  if (container.unbind (*key, value) == -1)
36
 
    return -1;
37
 
 
38
 
  value.first ()->recycler (0, 0);
39
 
 
40
 
  value.first ()->close ();
41
 
 
42
 
  return 0;
43
 
}
44
 
 
45
 
/////////////////////////////////////////////////////////////////////////////
46
 
 
47
 
template <class KEY, class VALUE, class CONTAINER> int
48
 
ACE_Refcounted_Recyclable_Handler_Cleanup_Strategy<KEY, VALUE, CONTAINER>::cleanup (CONTAINER &,
49
 
                                                                                    KEY *,
50
 
                                                                                    VALUE *value)
51
 
{
52
 
  return value->first ()->handle_close_i ();
53
 
}
54
 
 
55
 
////////////////////////////////////////////////////////////////////////////
56
 
 
57
 
template <class KEY, class VALUE, class CONTAINER> int
58
 
ACE_Handler_Cleanup_Strategy<KEY, VALUE, CONTAINER>::cleanup (CONTAINER &container,
59
 
                                                              KEY *key,
60
 
                                                              VALUE *value)
61
 
{
62
 
  // Remove the item from cache only if the handler isnt in use.
63
 
  if ((*value)->active () == 0)
64
 
    {
65
 
      (*value)->close ();
66
 
 
67
 
      if (container.unbind (*key) == -1)
68
 
        return -1;
69
 
 
70
 
    }
71
 
 
72
 
  return 0;
73
 
}
74
 
 
75
 
////////////////////////////////////////////////////////////////////////////
76
 
 
77
 
template <class KEY, class VALUE, class CONTAINER> int
78
 
ACE_Null_Cleanup_Strategy<KEY, VALUE, CONTAINER>::cleanup (CONTAINER &container,
79
 
                                                           KEY *key,
80
 
                                                           VALUE *value)
81
 
{
82
 
  ACE_UNUSED_ARG (container);
83
 
  ACE_UNUSED_ARG (key);
84
 
  ACE_UNUSED_ARG (value);
85
 
 
86
 
  return 0;
87
 
}
88
 
 
89
 
#endif /* CLEANUP_STRATEGIES_T_C */