blob: a10262d44f605b49279752b402faaa02f13acd75 (
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
72
73
74
75
|
/* -*- C++ -*- */
// $Id$
//
// ============================================================================
//
// = LIBRARY
// ORBSVCS Real-time Event Channel testsuite
//
// = FILENAME
// Counting_Consumer
//
// = AUTHOR
// Carlos O'Ryan (coryan@cs.wustl.edu)
//
// ============================================================================
#ifndef EC_COUNTING_CONSUMER_H
#define EC_COUNTING_CONSUMER_H
#include "ectest_export.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
#include "orbsvcs/RtecEventCommS.h"
#include "orbsvcs/RtecEventChannelAdminC.h"
class EC_Test_Export EC_Counting_Consumer : public POA_RtecEventComm::PushConsumer
{
// = TITLE
// Simple consumer object to implement EC tests.
//
// = DESCRIPTION
// This is a simple consumer that counts the events it receives.
//
public:
EC_Counting_Consumer (const char* name);
// Constructor
void connect (RtecEventChannelAdmin::ConsumerAdmin_ptr consumer_admin,
const RtecEventChannelAdmin::ConsumerQOS &qos,
CORBA::Environment &ACE_TRY_ENV);
void disconnect (CORBA::Environment &ACE_TRY_ENV);
void deactivate (CORBA::Environment &ACE_TRY_ENV);
// Simple connect/disconnect methods..
void dump_results (int expected_count, int tolerance);
// Print out an error message if the event count is too far from the
// expected count.
// = The RtecEventComm::PushConsumer methods
virtual void push (const RtecEventComm::EventSet& events,
CORBA::Environment &_env)
ACE_THROW_SPEC ((CORBA::SystemException));
virtual void disconnect_push_consumer (CORBA::Environment &)
ACE_THROW_SPEC ((CORBA::SystemException));
// The skeleton methods.
CORBA::ULong event_count;
// Keep track of the number of events received.
CORBA::ULong disconnect_count;
// Keep track of the number of disconnect calls received.
protected:
RtecEventChannelAdmin::ProxyPushSupplier_var supplier_proxy_;
// The proxy
const char* name_;
// The name
};
#endif /* ECT_CONSUMER_H */
|