summaryrefslogtreecommitdiff
path: root/TAO/tao/Cache_Entries.cpp
blob: 4e3ed2de940d053a1b2363f0b1c6e0e6663b0135 (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
//$Id$

#include "tao/Cache_Entries.h"
#include "tao/Transport.h"


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

ACE_RCSID(tao, Cache_Entries, "$Id$")

TAO_Cache_IntId::TAO_Cache_IntId (TAO_Transport *transport)
  : transport_ (transport),
    recycle_state_ (ACE_RECYCLABLE_UNKNOWN)
{
  transport->add_reference ();
}

TAO_Cache_IntId::~TAO_Cache_IntId (void)
{
  if (this->transport_)
    this->transport_->remove_reference ();
}

TAO_Cache_IntId&
TAO_Cache_IntId::operator= (const TAO_Cache_IntId &rhs)
{
  if (this != &rhs)
    {
      this->recycle_state_ = rhs.recycle_state_;

      TAO_Transport *old_transport = this->transport_;
      this->transport_ = rhs.transport_;
      if (this->transport_)
        this->transport_->add_reference ();
      if (old_transport)
        old_transport->remove_reference ();
    }

  return *this;
}