Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / TAO / tests / Stack_Recursion / Sender.cpp
blob57c5307451871cecc4d281facfacda754afb745b
1 #include "Sender.h"
3 Sender::Sender (CORBA::ORB_ptr orb)
4 : message_count_ (0)
5 , byte_count_ (0)
6 , orb_ (CORBA::ORB::_duplicate (orb))
7 , is_done_ (false)
11 void
12 Sender::dump_results ()
14 ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->mutex_);
15 ACE_DEBUG ((LM_DEBUG,
16 "Total messages = %d\n"
17 "Total bytes = %d\n",
18 this->message_count_,
19 this->byte_count_));
22 bool
23 Sender::is_done () const
25 return this->is_done_;
28 CORBA::Boolean
29 Sender::get_data (CORBA::ULong size,
30 Test::Payload_out payload)
32 ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
33 ace_mon,
34 this->mutex_,
35 0);
37 ++this->message_count_;
38 payload =
39 new Test::Payload (size);
40 payload->length (size);
41 this->byte_count_ += size;
43 return 1;
46 CORBA::Long
47 Sender::get_event_count ()
49 ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
50 ace_mon,
51 this->mutex_,
52 0);
53 return this->message_count_;
57 void
58 Sender::ping ()
62 void
63 Sender::shutdown ()
65 if (this->is_done_ == false)
67 ACE_GUARD (TAO_SYNCH_MUTEX,
68 ace_mon,
69 this->mutex_);
71 if (this->is_done_ == false)
72 this->is_done_ = true;