| 58 | } |
| 59 | |
| 60 | DDS::DomainParticipant_var |
| 61 | OpenDDS::Model::Entities::participant( |
| 62 | const OPENDDS_STRING& name, |
| 63 | const OPENDDS_STRING& transportConfig |
| 64 | ) |
| 65 | { |
| 66 | // See if its already here. |
| 67 | StringToParticipantMap::const_iterator which |
| 68 | = this->participantByString_.find( name); |
| 69 | if( which != this->participantByString_.end()) { |
| 70 | return DDS::DomainParticipant::_duplicate( which->second); |
| 71 | } |
| 72 | |
| 73 | // See if there is a configuration profile for it. |
| 74 | Config::ParticipantProfileMap::const_iterator where |
| 75 | = this->config_.participantProfileMap().find( name); |
| 76 | if( where == this->config_.participantProfileMap().end()) { |
| 77 | ACE_ERROR((LM_ERROR, |
| 78 | ACE_TEXT("(%P|%t) ERROR: Entities::participant() - ") |
| 79 | ACE_TEXT("unable to find profile to configure participant: [%C].\n"), |
| 80 | name.c_str() |
| 81 | )); |
| 82 | return 0; |
| 83 | } |
| 84 | |
| 85 | // Create it. |
| 86 | ParticipantProfile* profile = where->second; |
| 87 | if( OpenDDS::DCPS::DCPS_debug_level>1) { |
| 88 | ACE_DEBUG((LM_DEBUG, |
| 89 | ACE_TEXT("(%P|%t) Entities::participant() - ") |
| 90 | ACE_TEXT("Creating participant [%C].\n"), |
| 91 | name.c_str() |
| 92 | )); |
| 93 | } |
| 94 | this->participantByString_[ name] |
| 95 | = this->delegate_.createParticipant( |
| 96 | static_cast<unsigned long>(profile->domainId), |
| 97 | profile->qos, |
| 98 | OpenDDS::DCPS::DEFAULT_STATUS_MASK, |
| 99 | transportConfig |
| 100 | ); |
| 101 | return DDS::DomainParticipant::_duplicate( |
| 102 | this->participantByString_[ name] |
| 103 | ); |
| 104 | } |
| 105 | |
| 106 | DDS::Topic_var |
| 107 | OpenDDS::Model::Entities::topic( |