summaryrefslogtreecommitdiff
path: root/TAO/tao/Cache_Entries.h
blob: a018176b72b8ef5accc80f8edea44dcf95248f61 (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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
/* -*- C++ -*- */
// $Id$

// ============================================================================
//
// = LIBRARY
//    tao
//
// = FILENAME
//   Cache_Entries.h
//
// = AUTHOR
//    Bala Natarajan  <bala@cs.wustl.edu>
//
// ============================================================================

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

#include "tao/Base_Connection_Property.h"

#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */

#if defined(_MSC_VER)
#if (_MSC_VER >= 1200)
#pragma warning(push)
#endif /* _MSC_VER >= 1200 */
#pragma warning(disable:4250)
#endif /* _MSC_VER */

class TAO_Connection_Handler;

class TAO_Export TAO_Cache_IntId
{
  // = TITLE
  //     Helper class for TAO_Connection_Cache_Manager: unifies
  //     several  data items, so they can be stored together as a
  //     <value> for a <key> in a table holding the state of the
  //     Connection Cache.
  //
  // = DESCRIPTION
  //     Helper class that wraps the <value> part of the Map or
  //     table holding the Connection state.

public:
   // = Initialization and termination methods.

  TAO_Cache_IntId (void);
  // Constructor.

  TAO_Cache_IntId (TAO_Connection_Handler *handler);
  // Constructor.

  TAO_Cache_IntId (const TAO_Cache_IntId & rhs);
  // Copy constructor.

  ~TAO_Cache_IntId (void);
  // Destructor.

  TAO_Connection_Handler *handler (void);
  // Return the underlying handler

  const TAO_Connection_Handler *handler (void) const;
  // Return the underlying handler

  //Do we need a = operator? Lert me decide??
private:
  TAO_Connection_Handler *handler_;
  // The connection handler that needs to be cached.

  // @@ Need to add properties that need to be associated with this
  // connection when I get to purging....
};


class TAO_Export TAO_Cache_ExtId
{
  // = TITLE
  //     Helper class for TAO_Connection_Cache_Manager: unifies
  //     several  data items, so they can be stored together as a
  //     <value> for a <key> in a hash table holding the state of the
  //     Connection Cache.
  //
  // = DESCRIPTION
  //
public:
  // = Initialization and termination methods.

  TAO_Cache_ExtId (void);
  // Constructor.

  TAO_Cache_ExtId (TAO_Base_Connection_Property *prop);
  // Constructor.

  TAO_Cache_ExtId (const TAO_Cache_ExtId & rhs);
  // Copy constructor.

  ~TAO_Cache_ExtId (void);
  // Destructor.

  // = Assignment and comparison operators.
  void operator= (const TAO_Cache_ExtId &rhs);
  // Assignment operator (does copy memory).

  int operator== (const TAO_Cache_ExtId &rhs) const;
  // Equality comparison operator (must match both id_ and kind_).

  int operator!= (const TAO_Cache_ExtId &rhs) const;
  // Inequality comparison operator.

  u_long hash (void) const;
  // <hash> function is required in order for this class to be usable by
  // ACE_Hash_Map_Manager.

  void duplicate (void);
  // Make a deep copy of the underlying pointer

  CORBA::ULong index (void);
  // Return the index value

  void index (CORBA::ULong index);
  // Set the index value

  // = Accessors

private:
  // = Data members.

  TAO_Base_Connection_Property *connection_property_;
  // A property object that we represent.

  CORBA::Boolean is_delete_;
  // Do we need to delete connection_propert_?

  CORBA::ULong index_;
  // This is a supplementary index
};


#if defined (__ACE_INLINE__)
# include "tao/Cache_Entries.i"
#endif /* __ACE_INLINE__ */

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