OpenDDS  Snapshot(2023/04/28-20:55)
ReceiveListenerSetMap.h
Go to the documentation of this file.
1 /*
2  *
3  *
4  * Distributed under the OpenDDS License.
5  * See: http://www.opendds.org/license.html
6  */
7 
8 #ifndef OPENDDS_DCPS_TRANSPORT_FRAMEWORK_RECEIVELISTENERSETMAP_H
9 #define OPENDDS_DCPS_TRANSPORT_FRAMEWORK_RECEIVELISTENERSETMAP_H
10 
11 #include "dds/DCPS/dcps_export.h"
12 #include "ReceiveListenerSet.h"
13 #include "ReceiveListenerSet_rch.h"
14 #include "dds/DCPS/Definitions.h"
15 #include "dds/DCPS/PoolAllocator.h"
16 
18 
19 namespace OpenDDS {
20 namespace DCPS {
21 
22 class ReceivedDataSample;
23 
25 public:
26 
28 
30  virtual ~ReceiveListenerSetMap();
31 
32  int insert(GUID_t publisher_id,
33  GUID_t subscriber_id,
34  const TransportReceiveListener_wrch& receive_listener);
35 
36  ReceiveListenerSet_rch find(GUID_t publisher_id) const;
37 
38  int remove(GUID_t publisher_id, GUID_t subscriber_id);
39 
40  /// This method is called when the (remote) subscriber is being
41  /// released. This method will return a 0 if the subscriber_id is
42  /// successfully disassociated with the publisher_id *and* there
43  /// are still other subscribers associated with the publisher_id.
44  /// This method will return 1 if, after the disassociation, the
45  /// publisher_id is no longer associated with any subscribers (which
46  /// also means it's element was removed from our map_).
47  int release_subscriber(GUID_t publisher_id, GUID_t subscriber_id);
48 
49  ReceiveListenerSet_rch remove_set(GUID_t publisher_id);
50 
51  ssize_t size() const;
52 
53  /// Give access to the underlying map for iteration purposes.
54  MapType& map();
55  const MapType& map() const;
56 
57  void operator= (const ReceiveListenerSetMap& rh);
58 
59  void clear();
60 
61 private:
62 
63  ReceiveListenerSet_rch find_or_create(GUID_t publisher_id);
64 
65  MapType map_;
66 };
67 
68 } // namespace DCPS
69 } // namespace OpenDDS
70 
72 
73 #if defined (__ACE_INLINE__)
75 #endif /* __ACE_INLINE__ */
76 
77 #endif /* OPENDDS_DCPS_RECEIVELISTENERSETMAP_H */
#define OpenDDS_Dcps_Export
Definition: dcps_export.h:24
int ssize_t
typedef OPENDDS_MAP_CMP(GUID_t, WriterCoherentSample, GUID_tKeyLessThan) GroupCoherentSamples
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
int insert(Container &c, const ValueType &v)
Definition: Util.h:105
The Internal API and Implementation of OpenDDS.
Definition: AddressCache.h:28
int find(Container &c, const Key &key, typename Container::mapped_type *&value)
Definition: Util.h:71