Changes to attempt to silence bcc64x
[ACE_TAO.git] / TAO / examples / Simple / chat / Broadcaster_i.h
blob8ba5d447ccc57d7613668f07fa28036a84f14946
1 /* -*- C++ -*- */
3 //=============================================================================
4 /**
5 * @file Broadcaster_i.h
7 * Defines the implementation header for the Broadcaster interface.
9 * @author Pradeep Gore <pradeep@cs.wustl.edu>
11 //=============================================================================
14 #ifndef BROADCASTER_I_H
15 #define BROADCASTER_I_H
17 #include "BroadcasterS.h"
18 #include "ReceiverC.h"
19 #include "tao/Utils/ORB_Manager.h"
20 #include "ace/Containers.h"
22 #if !defined (ACE_LACKS_PRAGMA_ONCE)
23 # pragma once
24 #endif /* ACE_LACKS_PRAGMA_ONCE */
26 #include "ace/SString.h"
28 /**
29 * @class Broadcaster_i
31 * @brief The implementation of the Broadcaster class, which is the
32 * servant object for the chat server.
34 class Broadcaster_i : public POA_Broadcaster
36 public:
37 /// Constructor.
38 Broadcaster_i () = default;
40 /// Destructor.
41 virtual ~Broadcaster_i () = default;
43 /// Saves receiver references in a list.
44 virtual void add (Receiver_ptr receiver,
45 const char *nickname);
47 /// Removes receiver references from the list.
48 virtual void remove (Receiver_ptr receiver);
50 /// Called by Broadcaster clients to send messages.
51 virtual void say (Receiver_ptr receiver,
52 const char *text);
54 public:
55 /// The ORB manager.
56 TAO_ORB_Manager orb_manager_;
58 /// Broadcasts the text to all registered clients.
59 void broadcast (const char* text);
61 /**
62 * @class Receiver_Data
64 * @brief Per-client info.
66 * Saves the Receiver_var and user nickname.
68 class Receiver_Data
70 public:
71 /// The == op required by the ACE_Unbounded set.
72 bool operator == (const Receiver_Data &receiver_data) const;
74 /// Stores the receiver reference.
75 Receiver_var receiver_;
77 /// Stores the client nickname.
78 ACE_CString nickname_;
81 typedef ACE_Unbounded_Set<Receiver_Data>
82 RECEIVER_SET;
83 typedef ACE_Unbounded_Set_Iterator<Receiver_Data>
84 RECEIVER_SET_ITERATOR;
86 /// Set of registered clients.
87 RECEIVER_SET receiver_set_;
90 #endif /* BROADCASTER_I_H */