summaryrefslogtreecommitdiff
path: root/trunk/TAO/orbsvcs/tests/CosEvent/Timeout/TestEventConsumer_i.h
blob: 2f97247ece0f379c9c59acbbc2063d37025b59ef (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
/* -*- C++ -*- */
// $Id$

#ifndef TestEventConsumer_i_h_
#define TestEventConsumer_i_h_

#include "orbsvcs/CosEventCommS.h"

#include "ace/Task.h"
#include "ace/Condition_T.h"

class TestEventConsumer_i : public virtual POA_CosEventComm::PushConsumer
{
public:
  TestEventConsumer_i (CORBA::ORB_ptr orb, bool hang);

  // Override operations from PushConsumer interface.
  virtual void push (const CORBA::Any & data)
    throw (CORBA::SystemException, CosEventComm::Disconnected);

  virtual void disconnect_push_consumer () throw (CORBA::SystemException);

  void activate ();

  struct ORB_task : ACE_Task_Base
  {
    ORB_task (CORBA::ORB_ptr orb) : orb_ (CORBA::ORB::_duplicate (orb))
    {}

    CORBA::ORB_var orb_;

    int svc ();
  };

private:
  CORBA::ORB_var orb_;
  bool hang_;
  unsigned count_;
  ORB_task orbtask_;

  TAO_SYNCH_MUTEX mtx_;
  ACE_Condition<TAO_SYNCH_MUTEX> cond_;
  bool shutdown_;
};

#endif