summaryrefslogtreecommitdiff
path: root/TAO/tao/Cache_Entries.inl
blob: 0f16e744b0e0773c624df60d3e00e6afa3eb611c (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
149
150
151
152
153
154
155
156
157
158
159
160
/* -*- C++ -*- */
// $Id$

ACE_INLINE
TAO_Cache_IntId::TAO_Cache_IntId (void)
  : handler_ (0),
    recycle_state_ (ACE_RECYCLABLE_UNKNOWN)
{
}

ACE_INLINE
TAO_Cache_IntId::TAO_Cache_IntId (TAO_Connection_Handler *handler)
  : handler_ (handler)
{
}

ACE_INLINE
TAO_Cache_IntId::TAO_Cache_IntId (const TAO_Cache_IntId &rhs)
{
  this->handler_ = rhs.handler_;
}

ACE_INLINE
TAO_Cache_IntId::~TAO_Cache_IntId (void)
{
}

ACE_INLINE void
TAO_Cache_IntId::operator= (const TAO_Cache_IntId &rhs)
{
  this->handler_ = rhs.handler_;
}

ACE_INLINE int
TAO_Cache_IntId::operator== (const TAO_Cache_IntId &rhs) const
{
  return (this->handler_ == rhs.handler_);
}

ACE_INLINE int
TAO_Cache_IntId::operator!= (const TAO_Cache_IntId &rhs) const
{
  return (this->handler_ != rhs.handler_);
}

ACE_INLINE TAO_Connection_Handler *
TAO_Cache_IntId::handler (void)
{
  return this->handler_;
}

ACE_INLINE const TAO_Connection_Handler *
TAO_Cache_IntId::handler (void) const
{
  return this->handler_;
}

ACE_INLINE void
TAO_Cache_IntId::recycle_state (ACE_Recyclable_State st)
{
  this->recycle_state_ = st;
}

ACE_INLINE ACE_Recyclable_State
TAO_Cache_IntId::recycle_state (void)
{
  return this->recycle_state_;
}


/*******************************************************/
ACE_INLINE
TAO_Cache_ExtId::TAO_Cache_ExtId (void)
  : connection_property_ (0),
    is_delete_ (0),
    index_ (0)
{
}

ACE_INLINE
TAO_Cache_ExtId::TAO_Cache_ExtId (TAO_Base_Connection_Property *prop)
  : connection_property_ (prop),
    is_delete_ (0),
    index_ (0)
{

}

ACE_INLINE
TAO_Cache_ExtId::~TAO_Cache_ExtId (void)
{
  if (this->is_delete_)
    delete this->connection_property_;
}

ACE_INLINE
TAO_Cache_ExtId::TAO_Cache_ExtId (const TAO_Cache_ExtId &rhs)
{
  this->connection_property_ = rhs.connection_property_;
  this->is_delete_ = rhs.is_delete_;
  this->index_ = rhs.index_;
}

ACE_INLINE void
TAO_Cache_ExtId::operator= (const TAO_Cache_ExtId &rhs)
{
  this->connection_property_ = rhs.connection_property_;
  this->is_delete_ = rhs.is_delete_;
  this->index_ = rhs.index_;
}

ACE_INLINE int
TAO_Cache_ExtId::operator== (const TAO_Cache_ExtId &rhs) const
{
  return (*this->connection_property_ == *rhs.connection_property_ &&
            this->index_ == rhs.index_);
}

ACE_INLINE int
TAO_Cache_ExtId::operator!= (const TAO_Cache_ExtId &rhs) const
{
  return (*this->connection_property_ != *rhs.connection_property_ ||
          this->index_ != rhs.index_);
}

ACE_INLINE u_long
TAO_Cache_ExtId::hash (void) const
{
  return (this->connection_property_->hash () + this->index_);
}

ACE_INLINE void
TAO_Cache_ExtId::duplicate (void)
{
  TAO_Base_Connection_Property *prop = 0;

  // Make a deep copy
  prop = this->connection_property_->duplicate ();


  // Release memory if there was some allocated in the first place
 if (this->is_delete_)
   delete this->connection_property_;

  this->is_delete_ = 1;
  this->connection_property_ = prop;
}


ACE_INLINE CORBA::ULong
TAO_Cache_ExtId::index (void)
{
  return this->index_;
}

ACE_INLINE void
TAO_Cache_ExtId::index (CORBA::ULong index)
{
  this->index_ = index;
}