| 178 | } |
| 179 | |
| 180 | OpenDDS::DCPS::TopicStatus TAO_DDS_DCPSInfo_i::assert_topic( |
| 181 | OpenDDS::DCPS::GUID_t_out topicId, |
| 182 | DDS::DomainId_t domainId, |
| 183 | const OpenDDS::DCPS::GUID_t& participantId, |
| 184 | const char * topicName, |
| 185 | const char * dataTypeName, |
| 186 | const DDS::TopicQos & qos, |
| 187 | bool /*hasDcpsKey -- only used for RTPS Discovery*/) |
| 188 | { |
| 189 | ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, guard, this->lock_, OpenDDS::DCPS::INTERNAL_ERROR); |
| 190 | // Grab the domain. |
| 191 | DCPS_IR_Domain_Map::iterator where = this->domains_.find(domainId); |
| 192 | |
| 193 | if (where == this->domains_.end()) { |
| 194 | throw OpenDDS::DCPS::Invalid_Domain(); |
| 195 | } |
| 196 | |
| 197 | // Grab the participant. |
| 198 | DCPS_IR_Participant* participantPtr |
| 199 | = where->second->participant(participantId); |
| 200 | |
| 201 | if (0 == participantPtr) { |
| 202 | throw OpenDDS::DCPS::Invalid_Participant(); |
| 203 | } |
| 204 | |
| 205 | OpenDDS::DCPS::TopicStatus topicStatus |
| 206 | = where->second->add_topic( |
| 207 | topicId, |
| 208 | topicName, |
| 209 | dataTypeName, |
| 210 | qos, |
| 211 | participantPtr); |
| 212 | |
| 213 | if (this->um_ && (participantPtr->isBitPublisher() == false)) { |
| 214 | Update::UTopic topic(domainId, topicId, participantId |
| 215 | , topicName, dataTypeName |
| 216 | , const_cast<DDS::TopicQos &>(qos)); |
| 217 | this->um_->create(topic); |
| 218 | |
| 219 | if (OpenDDS::DCPS::DCPS_debug_level > 4) { |
| 220 | OpenDDS::DCPS::RepoIdConverter converter(topicId); |
| 221 | ACE_DEBUG((LM_DEBUG, |
| 222 | ACE_TEXT("(%P|%t) TAO_DDS_DCPSInfo_i::assert_topic: ") |
| 223 | ACE_TEXT("pushing creation of topic %C in domain %d.\n"), |
| 224 | std::string(converter).c_str(), |
| 225 | domainId)); |
| 226 | } |
| 227 | } |
| 228 | return topicStatus; |
| 229 | } |
| 230 | |
| 231 | bool |
| 232 | TAO_DDS_DCPSInfo_i::add_topic(const OpenDDS::DCPS::GUID_t& topicId, |
nothing calls this directly
no test coverage detected