| 398 | } |
| 399 | |
| 400 | void |
| 401 | Config::loadParticipant( |
| 402 | ACE_Configuration_Heap& heap, |
| 403 | ACE_Configuration_Section_Key& sectionKey, |
| 404 | std::basic_string<ACE_TCHAR> sectionName |
| 405 | ) |
| 406 | { |
| 407 | /** |
| 408 | * [participant/<name>] |
| 409 | * # Participant Qos Policy values |
| 410 | * UserData = <string> |
| 411 | * EntityFactory = <bool> |
| 412 | * |
| 413 | * DomainId = <number> |
| 414 | */ |
| 415 | |
| 416 | // Note that this requires that the Service Participant already be |
| 417 | // initialized before we configure from the scenario file. Also, |
| 418 | // since we have not created any Entities yet, we go to the initial |
| 419 | // default values rather than to the containing Entity. |
| 420 | ParticipantProfile* profile = new ParticipantProfile(); |
| 421 | profile->qos = TheServiceParticipant->initial_DomainParticipantQos(); |
| 422 | ACE_TString valueString; |
| 423 | |
| 424 | // DomainId = <number> |
| 425 | profile->domainId = DEFAULT_DOMAINID; |
| 426 | if( 0 == heap.get_string_value( sectionKey, DOMAINID_KEYNAME, valueString)) { |
| 427 | profile->domainId = ACE_OS::atoi( valueString.c_str()); |
| 428 | } |
| 429 | if( OpenDDS::DCPS::DCPS_debug_level>1) { |
| 430 | ACE_DEBUG((LM_DEBUG, |
| 431 | ACE_TEXT("(%P|%t) Config::loadParticipant() - ") |
| 432 | ACE_TEXT(" [participant/%s] %s == %d.\n"), |
| 433 | sectionName.c_str(), |
| 434 | DOMAINID_KEYNAME, |
| 435 | profile->domainId |
| 436 | )); |
| 437 | } |
| 438 | |
| 439 | // UserData = <string> OPTIONAL |
| 440 | valueString.clear(); |
| 441 | heap.get_string_value( sectionKey, USERDATA_KEYNAME, valueString); |
| 442 | if (valueString.length() > 0) { |
| 443 | profile->qos.user_data.value.replace( |
| 444 | static_cast<CORBA::ULong>(valueString.length()), |
| 445 | static_cast<CORBA::ULong>(valueString.length()), |
| 446 | const_cast<CORBA::Octet*>( |
| 447 | reinterpret_cast<const CORBA::Octet*>( valueString.c_str()) |
| 448 | ) |
| 449 | ); |
| 450 | if( OpenDDS::DCPS::DCPS_debug_level>1) { |
| 451 | ACE_DEBUG((LM_DEBUG, |
| 452 | ACE_TEXT("(%P|%t) Config::loadParticipant() - ") |
| 453 | ACE_TEXT(" [participant/%s] %s == %s.\n"), |
| 454 | sectionName.c_str(), |
| 455 | USERDATA_KEYNAME, |
| 456 | valueString.c_str() |
| 457 | )); |
nothing calls this directly
no test coverage detected