summaryrefslogtreecommitdiff
path: root/perf/src/CosEvent/Consumer.h
blob: f90300ef04297d20abbc78f8cf5aca10af6494a2 (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
// **********************************************************************
//
// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************

#ifndef ICEPERF_CONSUMER_H
#define ICEPERF_CONSUMER_H

#include <vector>
#include <orbsvcs/CosEventCommS.h>

class Consumer : public POA_CosEventComm::PushConsumer
{
public:
    Consumer();

    int run(int argc, char* argv[]);

    virtual void push(const CORBA::Any &event ACE_ENV_ARG_DECL_NOT_USED)
	ACE_THROW_SPEC ((CORBA::SystemException));
    virtual void disconnect_push_consumer(ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
	ACE_THROW_SPEC ((CORBA::SystemException));

private:
    
    void started();
    bool stopped();
    void add(CORBA::LongLong);
    void calc();

    CORBA::ULong _event_count;

    CORBA::ULong _nExpectedTicks;
    std::vector<long> _results;

    bool _payload;
    CORBA::LongLong _startTime;
    CORBA::LongLong _stopTime;
    int _nPublishers;
    int _nStartedPublishers;
    int _nStoppedPublishers;
    ACE_Thread_Mutex _lock;
    int _payloadSize;

    CORBA::ORB_ptr _orb;
};

#endif /* CONSUMER_H */