summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/examples/Notify/ThreadPool/Consumer_Client.h
blob: 75e6abe17a3e433e265e9c1588dd6708e21826ff (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
76
/* -*- C++ -*- */
/**
 *  @file Consumer_Client.h
 *
 *  @author Pradeep Gore <pradeep@oomworks.com>
 */

#ifndef TAO_Notify_CONSUMER_CLIENT_H
#define TAO_Notify_CONSUMER_CLIENT_H

#include /**/ "ace/pre.h"
#include "ace/Task.h"
#include "ace/SString.h"

#include "ORB_Objects.h"
#include "tao/RTCORBA/RTCORBA.h"

class TAO_Notify_ThreadPool_Consumer;

/**
 * @class TAO_Notify_ThreadPool_Consumer_Client
 *
 * @brief
 */
class TAO_Notify_ThreadPool_Consumer_Client  : public ACE_Task_Base
{
public:
  /// Constructor
  TAO_Notify_ThreadPool_Consumer_Client (TAO_Notify_ORB_Objects& orb_objects);

  /// Destructor
  ~TAO_Notify_ThreadPool_Consumer_Client ();

  /// Init
  void _init (void);

  /// Run
  void run (void);

  /// Parse Args
  int parse_args (int argc, ACE_TCHAR *argv[]);

  /// The thread entry point.
  virtual int svc (void);

  /// Dump stats.
  void dump_stats (void);

protected:
  /// Create an RT POA with a single threadpool.
  PortableServer::POA_ptr create_rt_poa (void);

  /// ORB Objects.
  TAO_Notify_ORB_Objects orb_objects_;

  /// Lock to serialize internal state.
  TAO_SYNCH_MUTEX lock_;

  /// Count how many consumers are done
  int consumer_done_count_;

  /// The Consumer.
  TAO_Notify_ThreadPool_Consumer* consumer_;

  /// ProxySuppler Thread count.
  int proxy_supplier_thread_count_;

  /// Max events that we expect to receive.
  int max_events_;

  /// Delay in ms
  long delay_;
};

#include /**/ "ace/post.h"
#endif /* TAO_Notify_CONSUMER_CLIENT_H */