OpenDDS  Snapshot(2023/04/07-19:43)
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
OpenDDS::DCPS::DataLinkSet Class Reference

#include <DataLinkSet.h>

Inheritance diagram for OpenDDS::DCPS::DataLinkSet:
Inheritance graph
[legend]
Collaboration diagram for OpenDDS::DCPS::DataLinkSet:
Collaboration graph
[legend]

Public Types

typedef ACE_SYNCH_MUTEX LockType
 
typedef ACE_Guard< LockTypeGuardType
 

Public Member Functions

 DataLinkSet ()
 
virtual ~DataLinkSet ()
 
int insert_link (const DataLink_rch &link)
 
void remove_link (const DataLink_rch &link)
 
void send (DataSampleElement *sample)
 Send to each DataLink in the set. More...
 
void send_control (DataSampleElement *sample)
 Send a control message that is wrapped in a DataSampleElement. More...
 
SendControlStatus send_control (GUID_t pub_id, const TransportSendListener_rch &listener, const DataSampleHeader &header, Message_Block_Ptr msg)
 Send control message to each DataLink in the set. More...
 
void send_response (GUID_t sub_id, const DataSampleHeader &header, Message_Block_Ptr response)
 
bool remove_sample (const DataSampleElement *sample)
 
bool remove_all_msgs (const GUID_t &pub_id)
 
void send_start (DataLinkSet *link_set)
 
void send_stop (GUID_t repoId)
 
DataLinkSet_rch select_links (const GUID_t *remoteIds, const CORBA::ULong num_targets)
 
bool empty ()
 
void send_final_acks (const GUID_t &readerid)
 
typedef OPENDDS_MAP (DataLinkIdType, DataLink_rch) MapType
 
LockTypelock ()
 Accessors for external iteration. More...
 
MapType & map ()
 
void terminate_send_if_suspended ()
 
bool is_leading (const GUID_t &writer_id, const GUID_t &reader_id) const
 
- Public Member Functions inherited from OpenDDS::DCPS::RcObject
virtual ~RcObject ()
 
virtual void _add_ref ()
 
virtual void _remove_ref ()
 
long ref_count () const
 
WeakObject_get_weak_object () const
 

Private Member Functions

void copy_map_to (MapType &target)
 lock and copy map for lock-free access More...
 

Private Attributes

MapType map_
 Hash map for DataLinks. More...
 
LockType lock_
 
SendResponseListener send_response_listener_
 Listener for TransportSendControlElements created in send_response. More...
 

Additional Inherited Members

- Protected Member Functions inherited from OpenDDS::DCPS::RcObject
 RcObject ()
 

Detailed Description

Definition at line 30 of file DataLinkSet.h.

Member Typedef Documentation

◆ GuardType

Definition at line 78 of file DataLinkSet.h.

◆ LockType

Definition at line 77 of file DataLinkSet.h.

Constructor & Destructor Documentation

◆ DataLinkSet()

OpenDDS::DCPS::DataLinkSet::DataLinkSet ( )

Definition at line 30 of file DataLinkSet.cpp.

References DBG_ENTRY_LVL.

31  : send_response_listener_("DataLinkSet")
32 {
33  DBG_ENTRY_LVL("DataLinkSet","DataLinkSet",6);
34 }
SendResponseListener send_response_listener_
Listener for TransportSendControlElements created in send_response.
Definition: DataLinkSet.h:103
#define DBG_ENTRY_LVL(CNAME, MNAME, DBG_LVL)
Definition: EntryExit.h:68

◆ ~DataLinkSet()

OpenDDS::DCPS::DataLinkSet::~DataLinkSet ( )
virtual

Definition at line 36 of file DataLinkSet.cpp.

References DBG_ENTRY_LVL.

37 {
38  DBG_ENTRY_LVL("DataLinkSet","~DataLinkSet",6);
39 }
#define DBG_ENTRY_LVL(CNAME, MNAME, DBG_LVL)
Definition: EntryExit.h:68

Member Function Documentation

◆ copy_map_to()

ACE_INLINE void OpenDDS::DCPS::DataLinkSet::copy_map_to ( MapType &  target)
private

lock and copy map for lock-free access

Definition at line 256 of file DataLinkSet.inl.

References ACE_INLINE, lock_, and map_.

Referenced by send_control().

257 {
258  target.clear();
259 
260  // Lock the existing map
261  GuardType guard(this->lock_);
262 
263 
264  // Copy to target
265  for (MapType::iterator itr = map_.begin();
266  itr != map_.end();
267  ++itr) {
268  target.insert(*itr);
269  }
270 }
MapType map_
Hash map for DataLinks.
Definition: DataLinkSet.h:96
ACE_Guard< LockType > GuardType
Definition: DataLinkSet.h:78

◆ empty()

bool OpenDDS::DCPS::DataLinkSet::empty ( void  )

Definition at line 87 of file DataLinkSet.cpp.

References lock_, and map_.

88 {
89  GuardType guard(this->lock_);
90 
91  return map_.empty();
92 }
MapType map_
Hash map for DataLinks.
Definition: DataLinkSet.h:96
ACE_Guard< LockType > GuardType
Definition: DataLinkSet.h:78

◆ insert_link()

int OpenDDS::DCPS::DataLinkSet::insert_link ( const DataLink_rch link)

Definition at line 42 of file DataLinkSet.cpp.

References OpenDDS::DCPS::bind(), DBG_ENTRY_LVL, OpenDDS::DCPS::DataLink::id(), lock_, and map_.

Referenced by OpenDDS::DCPS::TransportClient::add_link(), OpenDDS::DCPS::TransportClient::send_control_to(), and OpenDDS::DCPS::TransportClient::send_response().

43 {
44  DBG_ENTRY_LVL("DataLinkSet","insert_link",6);
45  GuardType guard(this->lock_);
46  return OpenDDS::DCPS::bind(map_, link->id(), link);
47 }
MapType map_
Hash map for DataLinks.
Definition: DataLinkSet.h:96
int bind(Container &c, const FirstType &first, const SecondType &second)
Definition: Util.h:20
ACE_Guard< LockType > GuardType
Definition: DataLinkSet.h:78
#define DBG_ENTRY_LVL(CNAME, MNAME, DBG_LVL)
Definition: EntryExit.h:68

◆ is_leading()

bool OpenDDS::DCPS::DataLinkSet::is_leading ( const GUID_t writer_id,
const GUID_t reader_id 
) const

Definition at line 107 of file DataLinkSet.cpp.

References lock_, and map_.

Referenced by OpenDDS::DCPS::TransportClient::is_leading().

109 {
110  GuardType guard(this->lock_);
111  for (MapType::const_iterator pos = map_.begin(), limit = map_.end(); pos != limit; ++pos) {
112  if (pos->second->is_leading(writer_id, reader_id)) {
113  return true;
114  }
115  }
116 
117  return false;
118 }
MapType map_
Hash map for DataLinks.
Definition: DataLinkSet.h:96
ACE_Guard< LockType > GuardType
Definition: DataLinkSet.h:78

◆ lock()

LockType& OpenDDS::DCPS::DataLinkSet::lock ( void  )
inline

Accessors for external iteration.

Definition at line 84 of file DataLinkSet.h.

References lock_.

84 { return lock_; }

◆ map()

MapType& OpenDDS::DCPS::DataLinkSet::map ( void  )
inline

Definition at line 85 of file DataLinkSet.h.

85 { return map_; }
MapType map_
Hash map for DataLinks.
Definition: DataLinkSet.h:96

◆ OPENDDS_MAP()

typedef OpenDDS::DCPS::DataLinkSet::OPENDDS_MAP ( DataLinkIdType  ,
DataLink_rch   
)

◆ remove_all_msgs()

ACE_INLINE bool OpenDDS::DCPS::DataLinkSet::remove_all_msgs ( const GUID_t pub_id)

Definition at line 185 of file DataLinkSet.inl.

References ACE_INLINE, DBG_ENTRY_LVL, lock_, and map_.

Referenced by OpenDDS::DCPS::TransportClient::remove_all_msgs().

186 {
187  DBG_ENTRY_LVL("DataLinkSet", "remove_all_msgs", 6);
188  MapType map_copy;
189  {
190  GuardType guard(lock_);
191  map_copy = map_;
192  }
193  const MapType::iterator end = map_copy.end();
194  for (MapType::iterator itr = map_copy.begin(); itr != end; ++itr) {
195  itr->second->remove_all_msgs(pub_id);
196  }
197 
198  return true;
199 }
MapType map_
Hash map for DataLinks.
Definition: DataLinkSet.h:96
ACE_Guard< LockType > GuardType
Definition: DataLinkSet.h:78
#define DBG_ENTRY_LVL(CNAME, MNAME, DBG_LVL)
Definition: EntryExit.h:68

◆ remove_link()

void OpenDDS::DCPS::DataLinkSet::remove_link ( const DataLink_rch link)

Definition at line 50 of file DataLinkSet.cpp.

References ACE_TEXT(), DBG_ENTRY_LVL, OpenDDS::DCPS::DataLink::id(), LM_DEBUG, lock_, map_, OpenDDS::DCPS::unbind(), and VDBG.

Referenced by OpenDDS::DCPS::TransportClient::disassociate().

51 {
52  DBG_ENTRY_LVL("DataLinkSet", "remove_link", 6);
53  GuardType guard1(this->lock_);
54  if (unbind(map_, link->id()) != 0) {
55  // Just report to the log that we tried.
56  VDBG((LM_DEBUG,
57  ACE_TEXT("(%P|%t) DataLinkSet::remove_links: ")
58  ACE_TEXT("link_id %d not found in map.\n"),
59  link->id()));
60  }
61 }
MapType map_
Hash map for DataLinks.
Definition: DataLinkSet.h:96
ACE_Guard< LockType > GuardType
Definition: DataLinkSet.h:78
#define VDBG(DBG_ARGS)
ACE_TEXT("TCP_Factory")
#define DBG_ENTRY_LVL(CNAME, MNAME, DBG_LVL)
Definition: EntryExit.h:68
int unbind(Container &c, const typename Container::key_type &k, typename Container::mapped_type &v)
Definition: Util.h:40

◆ remove_sample()

ACE_INLINE bool OpenDDS::DCPS::DataLinkSet::remove_sample ( const DataSampleElement sample)

Definition at line 166 of file DataLinkSet.inl.

References ACE_INLINE, DBG_ENTRY_LVL, lock_, map_, and OpenDDS::DCPS::REMOVE_RELEASED.

Referenced by OpenDDS::DCPS::TransportClient::remove_sample().

167 {
168  DBG_ENTRY_LVL("DataLinkSet", "remove_sample", 6);
169  MapType map_copy;
170  {
171  GuardType guard(lock_);
172  map_copy = map_;
173  }
174  const MapType::iterator end = map_copy.end();
175  for (MapType::iterator itr = map_copy.begin(); itr != end; ++itr) {
176  if (itr->second->remove_sample(sample) == REMOVE_RELEASED) {
177  return true;
178  }
179  }
180 
181  return false;
182 }
MapType map_
Hash map for DataLinks.
Definition: DataLinkSet.h:96
ACE_Guard< LockType > GuardType
Definition: DataLinkSet.h:78
#define DBG_ENTRY_LVL(CNAME, MNAME, DBG_LVL)
Definition: EntryExit.h:68

◆ select_links()

OpenDDS::DCPS::DataLinkSet_rch OpenDDS::DCPS::DataLinkSet::select_links ( const GUID_t remoteIds,
const CORBA::ULong  num_targets 
)

Definition at line 64 of file DataLinkSet.cpp.

References OpenDDS::DCPS::bind(), DBG_ENTRY_LVL, lock_, and map_.

Referenced by OpenDDS::DCPS::TransportClient::send_i().

66 {
67  DBG_ENTRY_LVL("DataLinkSet","select_links",6);
68 
69  DataLinkSet_rch selected_links ( make_rch<DataLinkSet>() );
70  GuardType guard(this->lock_);
71  for (MapType::iterator itr = map_.begin();
72  itr != map_.end();
73  ++itr) {
74  for (CORBA::ULong i = 0; i < num_targets; ++i) {
75  if (itr->second->is_target(remoteIds[i])) {
76  OpenDDS::DCPS::bind(selected_links->map_,
77  itr->second->id(), itr->second);
78  break;
79  }
80  }
81  }
82 
83  return selected_links;
84 }
MapType map_
Hash map for DataLinks.
Definition: DataLinkSet.h:96
int bind(Container &c, const FirstType &first, const SecondType &second)
Definition: Util.h:20
RcHandle< DataLinkSet > DataLinkSet_rch
The type definition for the smart-pointer to the underlying type.
Definition: DataLinkSet.h:27
ACE_Guard< LockType > GuardType
Definition: DataLinkSet.h:78
ACE_CDR::ULong ULong
#define DBG_ENTRY_LVL(CNAME, MNAME, DBG_LVL)
Definition: EntryExit.h:68

◆ send()

ACE_INLINE void OpenDDS::DCPS::DataLinkSet::send ( DataSampleElement sample)

Send to each DataLink in the set.

Definition at line 22 of file DataLinkSet.inl.

References ACE_INLINE, OpenDDS::DCPS::DataSampleHeader::add_cfentries(), OpenDDS::DCPS::CONTENT_FILTER_FLAG, OpenDDS::DCPS::TransportSendListener::data_dropped(), DBG_ENTRY_LVL, ACE_Message_Block::duplicate(), OpenDDS::DCPS::DataSampleElement::get_filter_per_link(), OpenDDS::DCPS::DataSampleElement::get_sample(), OpenDDS::DCPS::DataSampleElement::get_send_listener(), LM_DEBUG, lock_, map_, OpenDDS::DCPS::move(), OpenDDS::DCPS::TransportSendElement::msg(), OpenDDS::DCPS::DataSampleHeader::test_flag(), and VDBG_LVL.

23 {
24  DBG_ENTRY_LVL("DataLinkSet", "send", 6);
25  VDBG_LVL((LM_DEBUG, "(%P|%t) DBG: DataLinkSet::send element %@.\n",
26  sample), 5);
27 
28 #ifndef OPENDDS_NO_CONTENT_SUBSCRIPTION_PROFILE
29  const bool customHeader =
30  DataSampleHeader::test_flag(CONTENT_FILTER_FLAG, sample->get_sample());
31 #endif
32 
33  MapType map_copy;
34  {
35  GuardType guard(lock_);
36  map_copy = map_;
37  }
38 
39  if (map_copy.size()) {
40  TransportSendElement* send_element = new TransportSendElement(static_cast<int>(map_copy.size()), sample);
41  for (MapType::iterator itr = map_copy.begin(); itr != map_copy.end(); ++itr) {
42 
43 #ifndef OPENDDS_NO_CONTENT_SUBSCRIPTION_PROFILE
44  if (customHeader) {
45  typedef std::map<DataLinkIdType, GUIDSeq_var>::iterator FilterIter;
46  FilterIter fi = sample->get_filter_per_link().find(itr->first);
47  GUIDSeq* guids = 0;
48  if (fi != sample->get_filter_per_link().end()) {
49  guids = fi->second.ptr();
50  }
51 
52  VDBG_LVL((LM_DEBUG,
53  "(%P|%t) DBG: DataLink %@ filtering %d subscribers.\n",
54  itr->second.in(), guids ? guids->length() : 0), 5);
55 
56  Message_Block_Ptr mb (send_element->msg()->duplicate());
57 
58  DataSampleHeader::add_cfentries(guids, mb.get());
59 
60  TransportCustomizedElement* tce = new TransportCustomizedElement(send_element);
61  tce->set_msg(move(mb)); // tce now owns ACE_Message_Block chain
62 
63  itr->second->send(tce);
64 
65  } else {
66 #endif /* OPENDDS_NO_CONTENT_SUBSCRIPTION_PROFILE */
67 
68  // Tell the DataLink to send it.
69  itr->second->send(send_element);
70 
71 #ifndef OPENDDS_NO_CONTENT_SUBSCRIPTION_PROFILE
72  }
73 #endif
74  }
75  } else if (sample->get_send_listener()) {
76  sample->get_send_listener()->data_dropped(sample, true);
77  }
78 }
MapType map_
Hash map for DataLinks.
Definition: DataLinkSet.h:96
static void add_cfentries(const GUIDSeq *guids, ACE_Message_Block *mb)
T::rv_reference move(T &p)
Definition: unique_ptr.h:141
ACE_Guard< LockType > GuardType
Definition: DataLinkSet.h:78
static bool test_flag(DataSampleHeaderFlag flag, const ACE_Message_Block *buffer)
#define DBG_ENTRY_LVL(CNAME, MNAME, DBG_LVL)
Definition: EntryExit.h:68
#define VDBG_LVL(DBG_ARGS, LEVEL)
sequence< GUID_t > GUIDSeq
Definition: DdsDcpsGuid.idl:62
unique_ptr< ACE_Message_Block, Message_Block_Deleter > Message_Block_Ptr

◆ send_control() [1/2]

ACE_INLINE void OpenDDS::DCPS::DataLinkSet::send_control ( DataSampleElement sample)

Send a control message that is wrapped in a DataSampleElement.

Definition at line 81 of file DataLinkSet.inl.

References ACE_INLINE, DBG_ENTRY_LVL, LM_DEBUG, lock_, map_, and VDBG.

Referenced by OpenDDS::DCPS::TransportClient::send_control(), and OpenDDS::DCPS::TransportClient::send_control_to().

82 {
83  DBG_ENTRY_LVL("DataLinkSet", "send_control", 6);
84  VDBG((LM_DEBUG, "(%P|%t) DBG: DataLinkSet::send_control %@.\n", sample));
85  MapType map_copy;
86  {
87  GuardType guard(lock_);
88  map_copy = map_;
89  }
90 
91  TransportSendControlElement* send_element =
92  new TransportSendControlElement(static_cast<int>(map_copy.size()), sample);
93 
94  for (MapType::iterator itr = map_copy.begin(); itr != map_copy.end(); ++itr) {
95  itr->second->send(send_element);
96  }
97 }
MapType map_
Hash map for DataLinks.
Definition: DataLinkSet.h:96
ACE_Guard< LockType > GuardType
Definition: DataLinkSet.h:78
#define VDBG(DBG_ARGS)
#define DBG_ENTRY_LVL(CNAME, MNAME, DBG_LVL)
Definition: EntryExit.h:68

◆ send_control() [2/2]

ACE_INLINE OpenDDS::DCPS::SendControlStatus OpenDDS::DCPS::DataLinkSet::send_control ( GUID_t  pub_id,
const TransportSendListener_rch listener,
const DataSampleHeader header,
Message_Block_Ptr  msg 
)

Send control message to each DataLink in the set.

Definition at line 100 of file DataLinkSet.inl.

References ACE_DEBUG, ACE_INLINE, ACE_TEXT(), OpenDDS::DCPS::LogGuid::c_str(), copy_map_to(), DBG_ENTRY_LVL, OpenDDS::DCPS::DCPS_debug_level, header, OpenDDS::DCPS::RcHandle< T >::in(), LM_DEBUG, OpenDDS::DCPS::move(), and OpenDDS::DCPS::SEND_CONTROL_OK.

104 {
105  DBG_ENTRY_LVL("DataLinkSet","send_control",6);
106  //Optimized - use cached allocator.
107 
108  MapType dup_map;
109  copy_map_to(dup_map);
110 
111  if (dup_map.empty()) {
112  // similar to the "no links" case in TransportClient::send()
113  if (DCPS_debug_level > 4) {
114  const LogGuid logger(pub_id);
115  ACE_DEBUG((LM_DEBUG,
116  ACE_TEXT("(%P|%t) DataLinkSet::send_control: ")
117  ACE_TEXT("no links for publication %C, ")
118  ACE_TEXT("not sending control message.\n"),
119  logger.c_str()));
120  }
121  listener->control_delivered(msg);
122  return SEND_CONTROL_OK;
123  }
124 
125  TransportSendControlElement* const send_element =
126  new TransportSendControlElement(static_cast<int>(dup_map.size()), pub_id,
127  listener.in(), header, move(msg));
128 
129  for (MapType::iterator itr = dup_map.begin();
130  itr != dup_map.end();
131  ++itr) {
132  itr->second->send_start();
133  itr->second->send(send_element);
134  itr->second->send_stop(pub_id);
135  }
136 
137  return SEND_CONTROL_OK;
138 }
#define ACE_DEBUG(X)
Christopher Diggins *renamed files *fixing compilation errors *adding Visual C project file *removed make Max Lybbert *removed references to missing and unused header
Definition: CHANGELOG.txt:8
void copy_map_to(MapType &target)
lock and copy map for lock-free access
T::rv_reference move(T &p)
Definition: unique_ptr.h:141
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
ACE_TEXT("TCP_Factory")
#define DBG_ENTRY_LVL(CNAME, MNAME, DBG_LVL)
Definition: EntryExit.h:68

◆ send_final_acks()

ACE_INLINE void OpenDDS::DCPS::DataLinkSet::send_final_acks ( const GUID_t readerid)

Definition at line 273 of file DataLinkSet.inl.

References lock_, and map_.

Referenced by OpenDDS::DCPS::TransportClient::send_final_acks().

274 {
275  MapType map_copy;
276  {
277  GuardType guard(lock_);
278  map_copy = map_;
279  map_.clear();
280  }
281 
282  for (MapType::iterator itr = map_copy.begin(); itr != map_copy.end(); ++itr) {
283  itr->second->send_final_acks(readerid);
284  }
285 }
MapType map_
Hash map for DataLinks.
Definition: DataLinkSet.h:96
ACE_Guard< LockType > GuardType
Definition: DataLinkSet.h:78

◆ send_response()

ACE_INLINE void OpenDDS::DCPS::DataLinkSet::send_response ( GUID_t  sub_id,
const DataSampleHeader header,
Message_Block_Ptr  response 
)

Definition at line 141 of file DataLinkSet.inl.

References ACE_INLINE, DBG_ENTRY_LVL, lock_, map_, OpenDDS::DCPS::move(), send_response_listener_, and OpenDDS::DCPS::SendResponseListener::track_message().

Referenced by OpenDDS::DCPS::TransportClient::send_response().

145 {
146  DBG_ENTRY_LVL("DataLinkSet","send_response",6);
147  GuardType guard(this->lock_);
148 
149  TransportSendControlElement* const send_element =
150  new TransportSendControlElement(static_cast<int>(map_.size()), pub_id,
152  move(response));
153  if (!send_element) return;
155 
156  for (MapType::iterator itr = map_.begin();
157  itr != map_.end();
158  ++itr) {
159  itr->second->send_start();
160  itr->second->send(send_element);
161  itr->second->send_stop(pub_id);
162  }
163 }
MapType map_
Hash map for DataLinks.
Definition: DataLinkSet.h:96
SendResponseListener send_response_listener_
Listener for TransportSendControlElements created in send_response.
Definition: DataLinkSet.h:103
Christopher Diggins *renamed files *fixing compilation errors *adding Visual C project file *removed make Max Lybbert *removed references to missing and unused header
Definition: CHANGELOG.txt:8
T::rv_reference move(T &p)
Definition: unique_ptr.h:141
ACE_Guard< LockType > GuardType
Definition: DataLinkSet.h:78
#define DBG_ENTRY_LVL(CNAME, MNAME, DBG_LVL)
Definition: EntryExit.h:68

◆ send_start()

ACE_INLINE void OpenDDS::DCPS::DataLinkSet::send_start ( DataLinkSet link_set)

Calls send_start() on the links in link_set and also adds the links from link_set to *this.

Definition at line 202 of file DataLinkSet.inl.

References ACE_ERROR, ACE_INLINE, OpenDDS::DCPS::bind(), DBG_ENTRY_LVL, LM_ERROR, lock_, map_, and OpenDDS::DCPS::OPENDDS_VECTOR().

Referenced by OpenDDS::DCPS::TransportClient::send_i().

203 {
204  DBG_ENTRY_LVL("DataLinkSet","send_start",6);
205 
206  typedef OPENDDS_VECTOR(DataLink_rch) SendStartVec;
207  SendStartVec send_start_vec;
208 
209  {
210  GuardType guard1(lock_);
211  GuardType guard2(in->lock_);
212  for (MapType::iterator itr = in->map_.begin(); itr != in->map_.end(); ++itr) {
213  // Attempt to add the current DataLink to this set.
214  int result = OpenDDS::DCPS::bind(map_, itr->first, itr->second);
215 
216  if (result == 0) {
217  // We successfully added the current DataLink to this set,
218  // meaning that it wasn't already a member. We should tell
219  // the DataLink about the send_start() event.
220  send_start_vec.push_back(itr->second);
221 
222  } else if (result == -1) {
223  ACE_ERROR((LM_ERROR,
224  "(%P|%t) ERROR: Failed to bind data link into set.\n"));
225  }
226 
227  // Note that there is a possibility that the result == 1, which
228  // means that the DataLink already exists in our map_-> We skip
229  // all of these cases.
230  }
231  }
232 
233  for (SendStartVec::iterator it = send_start_vec.begin(); it != send_start_vec.end(); ++it) {
234  (*it)->send_start();
235  }
236 }
#define ACE_ERROR(X)
MapType map_
Hash map for DataLinks.
Definition: DataLinkSet.h:96
typedef OPENDDS_VECTOR(ActionConnectionRecord) ConnectionRecords
RcHandle< DataLink > DataLink_rch
The type definition for the smart-pointer to the underlying type.
Definition: DataLink_rch.h:34
int bind(Container &c, const FirstType &first, const SecondType &second)
Definition: Util.h:20
ACE_Guard< LockType > GuardType
Definition: DataLinkSet.h:78
#define DBG_ENTRY_LVL(CNAME, MNAME, DBG_LVL)
Definition: EntryExit.h:68

◆ send_stop()

ACE_INLINE void OpenDDS::DCPS::DataLinkSet::send_stop ( GUID_t  repoId)

Calls send_stop() on the links with ID repoId and then clears the set.

Definition at line 239 of file DataLinkSet.inl.

References ACE_INLINE, DBG_ENTRY_LVL, lock_, and map_.

Referenced by OpenDDS::DCPS::TransportClient::send_i().

240 {
241  DBG_ENTRY_LVL("DataLinkSet","send_stop",6);
242  // Iterate over our map_ and tell each DataLink about the send_stop() event.
243  MapType map_copy;
244  {
245  GuardType guard(lock_);
246  map_copy = map_;
247  map_.clear();
248  }
249 
250  for (MapType::iterator itr = map_copy.begin(); itr != map_copy.end(); ++itr) {
251  itr->second->send_stop(repoId);
252  }
253 }
MapType map_
Hash map for DataLinks.
Definition: DataLinkSet.h:96
ACE_Guard< LockType > GuardType
Definition: DataLinkSet.h:78
#define DBG_ENTRY_LVL(CNAME, MNAME, DBG_LVL)
Definition: EntryExit.h:68

◆ terminate_send_if_suspended()

void OpenDDS::DCPS::DataLinkSet::terminate_send_if_suspended ( )

Definition at line 94 of file DataLinkSet.cpp.

References lock_, and map_.

Referenced by OpenDDS::DCPS::TransportClient::terminate_send_if_suspended().

95 {
96  MapType map_copy;
97  {
98  GuardType guard(lock_);
99  map_copy = map_;
100  }
101  for (MapType::iterator itr = map_copy.begin();
102  itr != map_copy.end(); ++itr) {
103  itr->second->terminate_send_if_suspended();
104  }
105 }
MapType map_
Hash map for DataLinks.
Definition: DataLinkSet.h:96
ACE_Guard< LockType > GuardType
Definition: DataLinkSet.h:78

Member Data Documentation

◆ lock_

LockType OpenDDS::DCPS::DataLinkSet::lock_
mutableprivate

This lock will protect critical sections of code that play a role in the sending of data.

Definition at line 100 of file DataLinkSet.h.

Referenced by copy_map_to(), empty(), insert_link(), is_leading(), remove_all_msgs(), remove_link(), remove_sample(), select_links(), send(), send_control(), send_final_acks(), send_response(), send_start(), send_stop(), and terminate_send_if_suspended().

◆ map_

MapType OpenDDS::DCPS::DataLinkSet::map_
private

◆ send_response_listener_

SendResponseListener OpenDDS::DCPS::DataLinkSet::send_response_listener_
private

Listener for TransportSendControlElements created in send_response.

Definition at line 103 of file DataLinkSet.h.

Referenced by send_response().


The documentation for this class was generated from the following files: