blob: b83317551fb553d506eb5fdfecf480bfbbdef53d (
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
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
71
|
// $Id$
#include "Supplier.h"
#include "orbsvcs/Event_Service_Constants.h"
#include "orbsvcs/Event/EC_Event_Channel.h"
#include "orbsvcs/RtecEventCommC.h"
ACE_RCSID(EC_Examples, Supplier, "$Id$")
Supplier::Supplier (RtecEventComm::EventSourceID id,
const RtecEventChannelAdmin::ProxyPushConsumer_ptr consumer_proxy)
:id_ (id),
consumer_proxy_ (consumer_proxy)
{
}
void
Supplier::timeout_occured (void)
{
RtecEventComm::EventSet event (1);
if (id_ == 1)
{
event.length (1);
event[0].header.type = ACE_ES_EVENT_UNDEFINED;
event[0].header.source = id_;
event[0].header.ttl = 1;
}
else
{
event.length (1);
event[0].header.type = ACE_ES_EVENT_UNDEFINED + 1;
event[0].header.source = id_;
event[0].header.ttl = 1;
}
consumer_proxy_->push (event ACE_ENV_ARG_PARAMETER);
}
void
Supplier::disconnect_push_supplier (void)
ACE_THROW_SPEC ((CORBA::SystemException))
{
}
Timeout_Consumer::Timeout_Consumer (Supplier* supplier)
:supplier_impl_ (supplier)
{
}
void
Timeout_Consumer::push (const RtecEventComm::EventSet& events
ACE_ENV_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException))
{
if (events.length () == 0)
{
ACE_DEBUG ((LM_DEBUG,
"TimeoutConsumer (%t) no events\n"));
return;
}
ACE_DEBUG ((LM_DEBUG, "(%t) Timeout Event received\n"));
supplier_impl_->timeout_occured ();
}
void
Timeout_Consumer::disconnect_push_consumer (void)
ACE_THROW_SPEC ((CORBA::SystemException))
{
}
|