@@ -105,7 +105,7 @@ bool Participant::registerOnNewSubscriberMatchedCallback(
105
105
}
106
106
107
107
rtps::Writer *Participant::addWriter (Writer *pWriter) {
108
- Lock{m_mutex};
108
+ Lock lock {m_mutex};
109
109
for (unsigned int i = 0 ; i < m_writers.size (); i++) {
110
110
if (m_writers[i] == nullptr ) {
111
111
m_writers[i] = pWriter;
@@ -119,7 +119,7 @@ rtps::Writer *Participant::addWriter(Writer *pWriter) {
119
119
}
120
120
121
121
bool Participant::isWritersFull () {
122
- Lock{m_mutex};
122
+ Lock lock {m_mutex};
123
123
for (unsigned int i = 0 ; i < m_writers.size (); i++) {
124
124
if (m_writers[i] == nullptr ) {
125
125
return false ;
@@ -130,7 +130,7 @@ bool Participant::isWritersFull() {
130
130
}
131
131
132
132
rtps::Reader *Participant::addReader (Reader *pReader) {
133
- Lock{m_mutex};
133
+ Lock lock {m_mutex};
134
134
for (unsigned int i = 0 ; i < m_readers.size (); i++) {
135
135
if (m_readers[i] == nullptr ) {
136
136
m_readers[i] = pReader;
@@ -145,7 +145,7 @@ rtps::Reader *Participant::addReader(Reader *pReader) {
145
145
}
146
146
147
147
bool Participant::deleteReader (Reader *reader) {
148
- Lock{m_mutex};
148
+ Lock lock {m_mutex};
149
149
for (unsigned int i = 0 ; i < m_readers.size (); i++) {
150
150
if (m_readers[i]->getSEDPSequenceNumber () ==
151
151
reader->getSEDPSequenceNumber ()) {
@@ -160,7 +160,7 @@ bool Participant::deleteReader(Reader *reader) {
160
160
}
161
161
162
162
bool Participant::deleteWriter (Writer *writer) {
163
- Lock{m_mutex};
163
+ Lock lock {m_mutex};
164
164
for (unsigned int i = 0 ; i < m_writers.size (); i++) {
165
165
if (m_writers[i]->getSEDPSequenceNumber () ==
166
166
writer->getSEDPSequenceNumber ()) {
@@ -175,7 +175,7 @@ bool Participant::deleteWriter(Writer *writer) {
175
175
}
176
176
177
177
bool Participant::isReadersFull () {
178
- Lock{m_mutex};
178
+ Lock lock {m_mutex};
179
179
for (unsigned int i = 0 ; i < m_readers.size (); i++) {
180
180
if (m_readers[i] == nullptr ) {
181
181
return false ;
@@ -186,7 +186,7 @@ bool Participant::isReadersFull() {
186
186
}
187
187
188
188
rtps::Writer *Participant::getWriter (EntityId_t id) {
189
- Lock{m_mutex};
189
+ Lock lock {m_mutex};
190
190
for (uint8_t i = 0 ; i < m_writers.size (); ++i) {
191
191
if (m_writers[i] == nullptr ) {
192
192
continue ;
@@ -199,7 +199,7 @@ rtps::Writer *Participant::getWriter(EntityId_t id) {
199
199
}
200
200
201
201
rtps::Reader *Participant::getReader (EntityId_t id) {
202
- Lock{m_mutex};
202
+ Lock lock {m_mutex};
203
203
for (uint8_t i = 0 ; i < m_readers.size (); ++i) {
204
204
if (m_readers[i] == nullptr ) {
205
205
continue ;
@@ -225,7 +225,7 @@ rtps::Reader *Participant::getReaderByWriterId(const Guid_t &guid) {
225
225
}
226
226
227
227
rtps::Writer *Participant::getMatchingWriter (const TopicData &readerTopicData) {
228
- Lock{m_mutex};
228
+ Lock lock {m_mutex};
229
229
for (uint8_t i = 0 ; i < m_writers.size (); ++i) {
230
230
if (m_writers[i] == nullptr ) {
231
231
continue ;
@@ -241,7 +241,7 @@ rtps::Writer *Participant::getMatchingWriter(const TopicData &readerTopicData) {
241
241
}
242
242
243
243
rtps::Reader *Participant::getMatchingReader (const TopicData &writerTopicData) {
244
- Lock{m_mutex};
244
+ Lock lock {m_mutex};
245
245
for (uint8_t i = 0 ; i < m_readers.size (); ++i) {
246
246
if (m_readers[i] == nullptr ) {
247
247
continue ;
@@ -258,7 +258,7 @@ rtps::Reader *Participant::getMatchingReader(const TopicData &writerTopicData) {
258
258
259
259
rtps::Writer *
260
260
Participant::getMatchingWriter (const TopicDataCompressed &readerTopicData) {
261
- Lock{m_mutex};
261
+ Lock lock {m_mutex};
262
262
for (uint8_t i = 0 ; i < m_writers.size (); ++i) {
263
263
if (m_writers[i] == nullptr ) {
264
264
continue ;
@@ -275,7 +275,7 @@ Participant::getMatchingWriter(const TopicDataCompressed &readerTopicData) {
275
275
276
276
rtps::Reader *
277
277
Participant::getMatchingReader (const TopicDataCompressed &writerTopicData) {
278
- Lock{m_mutex};
278
+ Lock lock {m_mutex};
279
279
for (uint8_t i = 0 ; i < m_readers.size (); ++i) {
280
280
if (m_readers[i] == nullptr ) {
281
281
continue ;
@@ -292,12 +292,12 @@ Participant::getMatchingReader(const TopicDataCompressed &writerTopicData) {
292
292
293
293
bool Participant::addNewRemoteParticipant (
294
294
const ParticipantProxyData &remotePart) {
295
- Lock{m_mutex};
295
+ Lock lock {m_mutex};
296
296
return m_remoteParticipants.add (remotePart);
297
297
}
298
298
299
299
bool Participant::removeRemoteParticipant (const GuidPrefix_t &prefix) {
300
- Lock{m_mutex};
300
+ Lock lock {m_mutex};
301
301
auto isElementToRemove = [&](const ParticipantProxyData &proxy) {
302
302
return proxy.m_guid .prefix == prefix;
303
303
};
@@ -310,7 +310,7 @@ bool Participant::removeRemoteParticipant(const GuidPrefix_t &prefix) {
310
310
}
311
311
312
312
void Participant::removeAllProxiesOfParticipant (const GuidPrefix_t &prefix) {
313
- Lock{m_mutex};
313
+ Lock lock {m_mutex};
314
314
for (unsigned int i = 0 ; i < m_readers.size (); i++) {
315
315
if (m_readers[i] == nullptr ) {
316
316
continue ;
@@ -327,7 +327,7 @@ void Participant::removeAllProxiesOfParticipant(const GuidPrefix_t &prefix) {
327
327
}
328
328
329
329
void Participant::removeProxyFromAllEndpoints (const Guid_t &guid) {
330
- Lock{m_mutex};
330
+ Lock lock {m_mutex};
331
331
for (unsigned int i = 0 ; i < m_writers.size (); i++) {
332
332
if (m_writers[i] == nullptr ) {
333
333
continue ;
@@ -355,7 +355,7 @@ void Participant::removeProxyFromAllEndpoints(const Guid_t &guid) {
355
355
356
356
const rtps::ParticipantProxyData *
357
357
Participant::findRemoteParticipant (const GuidPrefix_t &prefix) {
358
- Lock{m_mutex};
358
+ Lock lock {m_mutex};
359
359
auto isElementToFind = [&](const ParticipantProxyData &proxy) {
360
360
return proxy.m_guid .prefix == prefix;
361
361
};
@@ -367,7 +367,7 @@ Participant::findRemoteParticipant(const GuidPrefix_t &prefix) {
367
367
368
368
void Participant::refreshRemoteParticipantLiveliness (
369
369
const GuidPrefix_t &prefix) {
370
- Lock{m_mutex};
370
+ Lock lock {m_mutex};
371
371
auto isElementToFind = [&](const ParticipantProxyData &proxy) {
372
372
return proxy.m_guid .prefix == prefix;
373
373
};
@@ -382,7 +382,7 @@ void Participant::refreshRemoteParticipantLiveliness(
382
382
}
383
383
384
384
bool Participant::hasReaderWithMulticastLocator (ip4_addr_t address) {
385
- Lock{m_mutex};
385
+ Lock lock {m_mutex};
386
386
for (uint8_t i = 0 ; i < m_readers.size (); i++) {
387
387
if (m_readers[i] == nullptr ) {
388
388
continue ;
@@ -395,15 +395,15 @@ bool Participant::hasReaderWithMulticastLocator(ip4_addr_t address) {
395
395
}
396
396
397
397
uint32_t Participant::getRemoteParticipantCount () {
398
- Lock{m_mutex};
398
+ Lock lock {m_mutex};
399
399
return m_remoteParticipants.getNumElements ();
400
400
}
401
401
402
402
rtps::MessageReceiver *Participant::getMessageReceiver () { return &m_receiver; }
403
403
404
404
bool Participant::checkAndResetHeartbeats () {
405
- Lock{m_mutex};
406
- Lock{m_spdpAgent.m_mutex };
405
+ Lock lock1 {m_mutex};
406
+ Lock lock2 {m_spdpAgent.m_mutex };
407
407
PARTICIPANT_LOG (" Have %u remote participants" ,
408
408
(unsigned int )m_remoteParticipants.getNumElements ());
409
409
PARTICIPANT_LOG (
@@ -521,7 +521,7 @@ void Participant::printInfo() {
521
521
rtps::SPDPAgent &Participant::getSPDPAgent () { return m_spdpAgent; }
522
522
523
523
void Participant::addBuiltInEndpoints (BuiltInEndpoints &endpoints) {
524
- Lock{m_mutex};
524
+ Lock lock {m_mutex};
525
525
m_hasBuilInEndpoints = true ;
526
526
m_spdpAgent.init (*this , endpoints);
527
527
m_sedpAgent.init (*this , endpoints);
0 commit comments