| 109 | }; |
| 110 | |
| 111 | void |
| 112 | Manager::pushImage(const DImage& image) |
| 113 | { |
| 114 | if (info_ == NULL) { |
| 115 | return; |
| 116 | } |
| 117 | |
| 118 | // image to be propagated. |
| 119 | UImage u_image; |
| 120 | |
| 121 | /*************************** |
| 122 | // The downstream image needs to be converted to a |
| 123 | // format compatible with the upstream layers (Dimage -> UImage) |
| 124 | // The Uimage cotains a lot of references to the complex data |
| 125 | // types. These are collecetd in several buckets (see below) and |
| 126 | // passed by reference. Usage of a custom guard class 'SeqGuard' |
| 127 | // automates memory cleanup. |
| 128 | ***************************/ |
| 129 | |
| 130 | // Participant buckets |
| 131 | SeqGuard<DDS::DomainParticipantQos> part_qos_guard; |
| 132 | SeqGuard<DDS::DomainParticipantQos>::Seq& part_qos = part_qos_guard.seq(); |
| 133 | |
| 134 | SeqGuard<UParticipant> part_guard; |
| 135 | SeqGuard<UParticipant>::Seq& parts = part_guard.seq(); |
| 136 | |
| 137 | for (DImage::ParticipantSeq::const_iterator iter = image.participants.begin(); |
| 138 | iter != image.participants.end(); iter++) { |
| 139 | const DParticipant& part = *iter; |
| 140 | |
| 141 | TAO_InputCDR in_cdr(part.participantQos.second.second |
| 142 | , part.participantQos.second.first); |
| 143 | |
| 144 | DDS::DomainParticipantQos* qos; |
| 145 | ACE_NEW_NORETURN(qos, DDS::DomainParticipantQos); |
| 146 | in_cdr >> *qos; |
| 147 | part_qos.push_back(qos); |
| 148 | |
| 149 | UParticipant* u_part; |
| 150 | ACE_NEW_NORETURN(u_part, UParticipant(part.domainId |
| 151 | , part.owner |
| 152 | , part.participantId |
| 153 | , *qos)); |
| 154 | parts.push_back(u_part); |
| 155 | |
| 156 | // push newly created UParticipant into UImage Participant bucket |
| 157 | u_image.participants.push_back(u_part); |
| 158 | } |
| 159 | |
| 160 | // Topic buckets |
| 161 | SeqGuard<DDS::TopicQos> topics_qos_guard; |
| 162 | SeqGuard<DDS::TopicQos>::Seq& topics_qos = topics_qos_guard.seq(); |
| 163 | |
| 164 | SeqGuard<UTopic> topics_guard; |
| 165 | SeqGuard<UTopic>::Seq& topics = topics_guard.seq(); |
| 166 | |
| 167 | for (DImage::TopicSeq::const_iterator iter = image.topics.begin(); |
| 168 | iter != image.topics.end(); iter++) { |
no test coverage detected