2 * @file Implicit_Deactivator.cpp
4 * @author Carlos O'Ryan <coryan@uci.edu>
7 #include "Implicit_Deactivator.h"
8 #include "tao/PortableServer/Servant_Base.h"
9 #include "tao/Environment.h"
13 #if !defined(__ACE_INLINE__)
14 #include "Implicit_Deactivator.inl"
15 #endif /* __ACE_INLINE__ */
17 Implicit_Deactivator::Implicit_Deactivator (PortableServer::Servant servant
)
20 servant
->_default_POA ();
23 this->poa_
->servant_to_id (servant
);
26 Implicit_Deactivator::Implicit_Deactivator (Implicit_Deactivator
&rhs
)
34 Implicit_Deactivator::operator= (Implicit_Deactivator
&rhs
)
36 Implicit_Deactivator
tmp (rhs
);
37 // @@ This seems bogus, there should be a more efficient way to swap
39 std::swap (this->poa_
, tmp
.poa_
);
40 std::swap (this->id_
, tmp
.id_
);
44 Implicit_Deactivator::~Implicit_Deactivator ()
46 if (this->id_
.ptr () == 0)
51 this->poa_
->deactivate_object (this->id_
.in ());
53 catch (const CORBA::Exception
&)
55 // @@ TODO This event should be logged. Cannot throw because that
56 // would make it impossible to use this class effectively.
57 // Read Servant_var.cpp for more details.
62 Implicit_Deactivator::operator= (PortableServer::Servant servant
)
64 Implicit_Deactivator
tmp (servant
);
65 // @@ This seems bogus, there should be a more efficient way to swap
67 std::swap (this->poa_
, tmp
.poa_
);
68 std::swap (this->id_
, tmp
.id_
);