Use =default for skeleton copy constructor
[ACE_TAO.git] / TAO / tests / Big_Twoways / Session_Control.cpp
blob59a9f6a04ef90bb6429695c2e290bd8c0643ed43
1 #include "Session_Control.h"
3 Session_Control::Session_Control (CORBA::ULong session_count)
4 : session_count_ (session_count)
5 , success_ (1)
9 int
10 Session_Control::all_sessions_finished () const
12 return this->session_count_ == 0;
15 Session_Control::~Session_Control ()
17 if (this->session_count_ == 0 && this->success_)
19 ACE_DEBUG ((LM_DEBUG,
20 "(%P|%t) Session_Control::~Session_control, "
21 " good, all sessions did finish\n"));
23 else if (session_count_ != 0)
25 ACE_ERROR ((LM_ERROR,
26 "ERROR: (%P|%t) Session_Control::~Session_control, "
27 " %d sessions did not finish\n",
28 this->session_count_));
30 else
32 ACE_ERROR ((LM_ERROR,
33 "ERROR: (%P|%t) Session_Control::~Session_control, "
34 " some sessions failed\n"));
38 void
39 Session_Control::session_finished (CORBA::Boolean success)
41 ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->mutex_);
42 if (this->session_count_ == 0)
44 ACE_ERROR ((LM_ERROR,
45 "ERROR: (%P|%t) Session_Control::session_finished, "
46 "unexpected callback\n"));
48 if (success == 0)
49 this->success_ = 0;
51 this->session_count_--;
52 ACE_DEBUG ((LM_DEBUG,
53 "(%P|%t) Session_Control::session_finished, "
54 "%d sessions to go\n",
55 this->session_count_));
56 if (session_count_ == 0)
58 PortableServer::POA_var poa =
59 this->_default_POA ();
60 PortableServer::ObjectId_var oid =
61 poa->servant_to_id (this);
62 poa->deactivate_object (oid.in ());