@name InternalTopic Interface @{
| 59 | /// @name InternalTopic Interface |
| 60 | /// @{ |
| 61 | void add_reader(InternalDataReader_rch reader) |
| 62 | { |
| 63 | ACE_GUARD(ACE_Thread_Mutex, g, mutex_); |
| 64 | |
| 65 | const SampleSequence& instances = reader->get_interesting_instances(); |
| 66 | |
| 67 | if (instances.empty()) { |
| 68 | readers_.insert(reader); |
| 69 | |
| 70 | if (qos_.durability.kind == DDS::TRANSIENT_LOCAL_DURABILITY_QOS && reader->durable()) { |
| 71 | for (typename InstanceMap::iterator pos = instance_map_.begin(), limit = instance_map_.end(); |
| 72 | pos != limit; ++pos) { |
| 73 | pos->second.add_reader(reader, static_rchandle_cast<InternalEntity>(rchandle_from(this))); |
| 74 | } |
| 75 | } |
| 76 | } else { |
| 77 | all_instance_readers_.insert(reader); |
| 78 | for (typename SampleSequence::const_iterator pos = instances.begin(), limit = instances.end(); |
| 79 | pos != limit; ++ pos) { |
| 80 | instance_readers_[*pos].insert(reader); |
| 81 | if (qos_.durability.kind == DDS::TRANSIENT_LOCAL_DURABILITY_QOS && reader->durable()) { |
| 82 | typename InstanceMap::iterator pos2 = instance_map_.find(*pos); |
| 83 | if (pos2 != instance_map_.end()) { |
| 84 | pos2->second.add_reader(reader, static_rchandle_cast<InternalEntity>(rchandle_from(this))); |
| 85 | } |
| 86 | } |
| 87 | } |
| 88 | } |
| 89 | } |
| 90 | |
| 91 | void remove_reader(InternalDataReader_rch reader) |
| 92 | { |