OpenDDS  Snapshot(2023/04/28-20:55)
ParticipantQos_Handler.cpp
Go to the documentation of this file.
2 #include "dds/DdsDcpsInfrastructureC.h"
3 #include "dds/DCPS/debug.h"
4 
6 
7 bool
9  dds::qosProfile * profile,
10  const ACE_TCHAR * name)
11 {
12  if (name)
13  {
14 // // find the correct Participant_qos
15 // for (dds::qosProfile::Participant_qos_iterator dw_it = profile->begin_Participant_qos();
16 // dw_it != profile->end_Participant_qos();
17 // ++dw_it)
18 // {
19 // if (ACE_OS::strcmp(dw_name.c_str(), name) == 0)
20 // {
21 // return get_Participant_qos(dw_qos, *dw_it->get());
22 // }
23 // }
24  }
25  else
26  {
27  if (profile->count_domainparticipant_qos() == 0)
28  {
30  {
31  ACE_DEBUG((LM_TRACE,
32  ACE_TEXT("ParticipantQos_Handler::get_participant_qos - ")
33  ACE_TEXT("No Participant QOS available in profile <%s>\n"),
34  profile->name().c_str()));
35  }
36  return true;
37  }
38  // get the first Participant in the XML
39  dds::qosProfile::domainparticipant_qos_iterator dr_it = profile->begin_domainparticipant_qos();
40  return ParticipantQos_Handler::get_participant_qos(dp_qos, dr_it->get());
41  }
42 
43  ACE_ERROR((LM_ERROR,
44  ACE_TEXT("(%P|%t) ERROR: ParticipantQos_Handler::get_participant_qos - ")
45  ACE_TEXT("Unable to find ParticipantQos <%s>\n"),
46  name));
47  return false;
48 }
49 
50 bool
52  dds::domainparticipantQos * dp)
53 {
54 
55 // if (xml_qos->user_data())
56 // {
57  // TODO: Have a good look at this.
58 
59 // const std::string value = *xml_qos->user_data()->value();
60 //
61 // ACE_DEBUG((LM_TRACE,
62 // ACE_TEXT("QOS_DataReader_T<XML_QOS_TYPE, DDS_QOS_TYPE>::read_qos - ")
63 // ACE_TEXT("Set user_data to <%C>\n"),
64 // value.c_str()));
65 //
66 // dds_qos.user_data.value =
67 // *xml_qos->user_data()->value();
68 // }
69 
70 
71  if (dp->entity_factory_p())
72  {
73  if (dp->entity_factory().autoenable_created_entities_p())
74  {
76  dp->entity_factory().autoenable_created_entities();
77 
79  {
81  ACE_TEXT("ParticipantQos_Handler::get_participant_qos - ")
82  ACE_TEXT("Set entity_factory autoenable_created_entities to <%d>\n"),
84  }
85  }
86  }
87  return true;
88 }
89 
#define ACE_DEBUG(X)
#define ACE_ERROR(X)
EntityFactoryQosPolicy entity_factory
LM_TRACE
char ACE_TCHAR
const char *const name
Definition: debug.cpp:60
ACE_TEXT("TCP_Factory")
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
static bool get_participant_qos(::DDS::DomainParticipantQos &dp_qos, ::dds::qosProfile *profile, const ACE_TCHAR *name=0)