summaryrefslogtreecommitdiff
path: root/TAO/tests/MT_BiDir/Sender_i.h
blob: 8b9c159b1904a4b9676fc25a78fe19b3da4a4a68 (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
//
// $Id$
//

#ifndef MT_BIDIR_RECEIVER_H
#define MT_BIDIR_RECEIVER_H
#include /**/ "ace/pre.h"

#include "SenderS.h"

#if defined (_MSC_VER)
# pragma warning(push)
# pragma warning (disable:4250)
#endif /* _MSC_VER */

class ACE_Manual_Event;

/**
 * Simply print count how many bytes were received.
 */
class Sender_i
  : public virtual POA_Sender
  , public virtual PortableServer::RefCountServantBase
{
public:
  /// Constructor
  Sender_i (int no_clients,
            ACE_Manual_Event &event);

  // = The skeleton methods
  virtual CORBA::Long receiver_object (Receiver *recv
                                       ACE_ENV_ARG_DECL)
    ACE_THROW_SPEC ((CORBA::SystemException,
                     Sender::Table_Full));

  /// Public method defined locally
  void send_message (ACE_ENV_SINGLE_ARG_DECL);

private:
  /// Synchronizing acces to this class
  TAO_SYNCH_MUTEX mutex_;

  /// An event for waking other threads
  ACE_Manual_Event &event_;

  /// An array of receiver pointers
  Receiver **receivers_;

  /// Size of the <this->receivers_> array
  int no_clients_;

  /// Receiver index
  int last_index_;

  /// Payload that is being sent
  Receiver::Payload payload_;
};

#if defined(_MSC_VER)
# pragma warning(pop)
#endif /* _MSC_VER */

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