blob: 91cbe46044584e2777befa5a41e4ca7de8bcf490 (
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
|
/* -*- C++ -*- */
//=============================================================================
/**
* @file Counting_Consumer.h
*
* @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_Counting_Consumer
*
* @brief Simple consumer object to implement EC tests.
*
* This is a simple consumer that counts the events it receives.
*/
class EC_Test_Export EC_Counting_Consumer : public POA_RtecEventComm::PushConsumer
{
public:
/// Constructor
EC_Counting_Consumer (const char* name);
/// Simple connect/disconnect methods..
void connect (RtecEventChannelAdmin::ConsumerAdmin_ptr consumer_admin,
const RtecEventChannelAdmin::ConsumerQOS &qos);
void disconnect (void);
void deactivate (void);
/// Print out an error message if the event count is too far from the
/// expected count.
void dump_results (int expected_count, int tolerance);
// = The RtecEventComm::PushConsumer methods
/// The skeleton methods.
virtual void push (const RtecEventComm::EventSet& events);
virtual void disconnect_push_consumer (void);
/// Keep track of the number of events received.
CORBA::ULong event_count;
/// Keep track of the number of disconnect calls received.
CORBA::ULong disconnect_count;
protected:
/// The proxy
RtecEventChannelAdmin::ProxyPushSupplier_var supplier_proxy_;
/// The name
const char* name_;
};
#endif /* ECT_CONSUMER_H */
|