@@ -4359,7 +4359,10 @@ const std::vector<std::shared_ptr<const Entity>> Database::get_entities_nts(
4359
4359
case EntityKind::USER:
4360
4360
for (const auto & user : host->users )
4361
4361
{
4362
- entities.push_back (user.second );
4362
+ if (!user.second .expired ())
4363
+ {
4364
+ entities.push_back (user.second );
4365
+ }
4363
4366
}
4364
4367
break ;
4365
4368
case EntityKind::PROCESS:
@@ -4394,7 +4397,10 @@ const std::vector<std::shared_ptr<const Entity>> Database::get_entities_nts(
4394
4397
case EntityKind::PROCESS:
4395
4398
for (const auto & process : user->processes )
4396
4399
{
4397
- entities.push_back (process.second );
4400
+ if (!process.second .expired ())
4401
+ {
4402
+ entities.push_back (process.second );
4403
+ }
4398
4404
}
4399
4405
break ;
4400
4406
case EntityKind::DOMAIN:
@@ -4426,15 +4432,21 @@ const std::vector<std::shared_ptr<const Entity>> Database::get_entities_nts(
4426
4432
}
4427
4433
break ;
4428
4434
case EntityKind::USER:
4429
- entities.push_back (process->user );
4435
+ if (!process->user .expired ())
4436
+ {
4437
+ entities.push_back (process->user );
4438
+ }
4430
4439
break ;
4431
4440
case EntityKind::PROCESS:
4432
4441
entities.push_back (process);
4433
4442
break ;
4434
4443
case EntityKind::PARTICIPANT:
4435
4444
for (const auto & participant : process->participants )
4436
4445
{
4437
- entities.push_back (participant.second );
4446
+ if (!participant.second .expired ())
4447
+ {
4448
+ entities.push_back (participant.second );
4449
+ }
4438
4450
}
4439
4451
break ;
4440
4452
case EntityKind::DOMAIN:
@@ -4464,13 +4476,19 @@ const std::vector<std::shared_ptr<const Entity>> Database::get_entities_nts(
4464
4476
case EntityKind::PARTICIPANT:
4465
4477
for (const auto & participant : domain->participants )
4466
4478
{
4467
- entities.push_back (participant.second );
4479
+ if (!participant.second .expired ())
4480
+ {
4481
+ entities.push_back (participant.second );
4482
+ }
4468
4483
}
4469
4484
break ;
4470
4485
case EntityKind::TOPIC:
4471
4486
for (const auto & topic : domain->topics )
4472
4487
{
4473
- entities.push_back (topic.second );
4488
+ if (!topic.second .expired ())
4489
+ {
4490
+ entities.push_back (topic.second );
4491
+ }
4474
4492
}
4475
4493
break ;
4476
4494
case EntityKind::HOST:
@@ -4515,21 +4533,30 @@ const std::vector<std::shared_ptr<const Entity>> Database::get_entities_nts(
4515
4533
}
4516
4534
break ;
4517
4535
case EntityKind::DOMAIN:
4518
- entities.push_back (participant->domain );
4536
+ if (!participant->domain .expired ())
4537
+ {
4538
+ entities.push_back (participant->domain );
4539
+ }
4519
4540
break ;
4520
4541
case EntityKind::PARTICIPANT:
4521
4542
entities.push_back (participant);
4522
4543
break ;
4523
4544
case EntityKind::DATAWRITER:
4524
4545
for (const auto & writer : participant->data_writers )
4525
4546
{
4526
- entities.push_back (writer.second );
4547
+ if (!writer.second .expired ())
4548
+ {
4549
+ entities.push_back (writer.second );
4550
+ }
4527
4551
}
4528
4552
break ;
4529
4553
case EntityKind::DATAREADER:
4530
4554
for (const auto & reader : participant->data_readers )
4531
4555
{
4532
- entities.push_back (reader.second );
4556
+ if (!reader.second .expired ())
4557
+ {
4558
+ entities.push_back (reader.second );
4559
+ }
4533
4560
}
4534
4561
break ;
4535
4562
case EntityKind::TOPIC:
@@ -4556,21 +4583,30 @@ const std::vector<std::shared_ptr<const Entity>> Database::get_entities_nts(
4556
4583
switch (entity_kind)
4557
4584
{
4558
4585
case EntityKind::DOMAIN:
4559
- entities.push_back (topic->domain );
4586
+ if (!topic->domain .expired ())
4587
+ {
4588
+ entities.push_back (topic->domain );
4589
+ }
4560
4590
break ;
4561
4591
case EntityKind::TOPIC:
4562
4592
entities.push_back (topic);
4563
4593
break ;
4564
4594
case EntityKind::DATAWRITER:
4565
4595
for (const auto & writer : topic->data_writers )
4566
4596
{
4567
- entities.push_back (writer.second );
4597
+ if (!writer.second .expired ())
4598
+ {
4599
+ entities.push_back (writer.second );
4600
+ }
4568
4601
}
4569
4602
break ;
4570
4603
case EntityKind::DATAREADER:
4571
4604
for (const auto & reader : topic->data_readers )
4572
4605
{
4573
- entities.push_back (reader.second );
4606
+ if (!reader.second .expired ())
4607
+ {
4608
+ entities.push_back (reader.second );
4609
+ }
4574
4610
}
4575
4611
break ;
4576
4612
case EntityKind::HOST:
@@ -4600,18 +4636,27 @@ const std::vector<std::shared_ptr<const Entity>> Database::get_entities_nts(
4600
4636
switch (entity_kind)
4601
4637
{
4602
4638
case EntityKind::TOPIC:
4603
- entities.push_back (writer->topic );
4639
+ if (!writer->topic .expired ())
4640
+ {
4641
+ entities.push_back (writer->topic );
4642
+ }
4604
4643
break ;
4605
4644
case EntityKind::PARTICIPANT:
4606
- entities.push_back (writer->participant );
4645
+ if (!writer->participant .expired ())
4646
+ {
4647
+ entities.push_back (writer->participant );
4648
+ }
4607
4649
break ;
4608
4650
case EntityKind::DATAWRITER:
4609
4651
entities.push_back (writer);
4610
4652
break ;
4611
4653
case EntityKind::LOCATOR:
4612
4654
for (const auto & locator : writer->locators )
4613
4655
{
4614
- entities.push_back (locator.second );
4656
+ if (!locator.second .expired ())
4657
+ {
4658
+ entities.push_back (locator.second );
4659
+ }
4615
4660
}
4616
4661
break ;
4617
4662
case EntityKind::DATAREADER:
@@ -4640,18 +4685,27 @@ const std::vector<std::shared_ptr<const Entity>> Database::get_entities_nts(
4640
4685
switch (entity_kind)
4641
4686
{
4642
4687
case EntityKind::TOPIC:
4643
- entities.push_back (reader->topic );
4688
+ if (!reader->topic .expired ())
4689
+ {
4690
+ entities.push_back (reader->topic );
4691
+ }
4644
4692
break ;
4645
4693
case EntityKind::PARTICIPANT:
4646
- entities.push_back (reader->participant );
4694
+ if (!reader->participant .expired ())
4695
+ {
4696
+ entities.push_back (reader->participant );
4697
+ }
4647
4698
break ;
4648
4699
case EntityKind::DATAREADER:
4649
4700
entities.push_back (reader);
4650
4701
break ;
4651
4702
case EntityKind::LOCATOR:
4652
4703
for (const auto & locator : reader->locators )
4653
4704
{
4654
- entities.push_back (locator.second );
4705
+ if (!locator.second .expired ())
4706
+ {
4707
+ entities.push_back (locator.second );
4708
+ }
4655
4709
}
4656
4710
break ;
4657
4711
case EntityKind::DATAWRITER:
@@ -4682,13 +4736,19 @@ const std::vector<std::shared_ptr<const Entity>> Database::get_entities_nts(
4682
4736
case EntityKind::DATAREADER:
4683
4737
for (const auto & reader : locator->data_readers )
4684
4738
{
4685
- entities.push_back (reader.second );
4739
+ if (!reader.second .expired ())
4740
+ {
4741
+ entities.push_back (reader.second );
4742
+ }
4686
4743
}
4687
4744
break ;
4688
4745
case EntityKind::DATAWRITER:
4689
4746
for (const auto & writer : locator->data_writers )
4690
4747
{
4691
- entities.push_back (writer.second );
4748
+ if (!writer.second .expired ())
4749
+ {
4750
+ entities.push_back (writer.second );
4751
+ }
4692
4752
}
4693
4753
break ;
4694
4754
case EntityKind::LOCATOR:
0 commit comments