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
|
#include "sink_i.h"
#include "ace/OS_NS_unistd.h"
// Constructor
Sink_i::Sink_i (CORBA::ORB_ptr orb)
: orb_(CORBA::ORB::_duplicate(orb))
, tickCount_(0)
, tockCount_(0)
{
// no-op
}
// Destructor
Sink_i::~Sink_i ()
{
// no-op
}
bool
Sink_i::parse_args(int &, ACE_TCHAR *[])
{
return true;
}
// Implement the tick method
void
Sink_i::tick ()
{
ACE_OS::sleep(1);
tickCount_ += 1;
ACE_DEBUG((LM_DEBUG, "Sink (%P|%t) tick: %d\n", tickCount_));
}
void
Sink_i::tock ()
{
ACE_OS::sleep(1);
tockCount_ += 1;
ACE_DEBUG((LM_DEBUG, "Sink (%P|%t) tock: %d\n", tockCount_));
}
::CORBA::ULong
Sink_i::tickCount ()
{
ACE_DEBUG((LM_DEBUG, "Sink (%P|%t) tickCount: %d\n", tickCount_));
return tickCount_;
}
::CORBA::ULong
Sink_i::tockCount ()
{
ACE_DEBUG((LM_DEBUG, "Sink (%P|%t) tockCount: %d\n", tockCount_));
return tockCount_;
}
// Shutdown.
void
Sink_i::shutdown ()
{
ACE_DEBUG ((LM_DEBUG,
"Sink (%P|%t) shutting down. Ticks: %d Tocks %d\n",
(int)tickCount_,
(int)tockCount_));
// Instruct the ORB to shutdown.
this->orb_->shutdown ();
}
|