OpenDDS  Snapshot(2023/04/28-20:55)
SubscriberQos_Handler.cpp
Go to the documentation of this file.
1 
3 #include "QOS_PubSub_T.h"
4 
6 
7 bool
9  dds::qosProfile * profile,
10  const ACE_TCHAR * name)
11 {
12  if (name)
13  {
14 // // find the correct DataReader_qos
15 // for (dds::qosProfile::DataReader_qos_iterator dw_it = profile->begin_DataReader_qos();
16 // dw_it != profile->end_DataReader_qos();
17 // ++dw_it)
18 // {
19 // if (ACE_OS::strcmp(dw_name.c_str(), name) == 0)
20 // {
21 // return get_DataReader_qos(dw_qos, *dw_it->get());
22 // }
23 // }
24  }
25  else
26  {
27  if (profile->count_subscriber_qos() == 0)
28  {
30  {
31  ACE_DEBUG((LM_TRACE,
32  ACE_TEXT("SubscriberQos_Handler::get_subscriber_qos - ")
33  ACE_TEXT("No Subscriber QOS available in profile <%s>\n"),
34  profile->name().c_str()));
35  }
36  return true;
37  }
38  // get the first DataReader in the XML
39  dds::qosProfile::subscriber_qos_iterator sub_it = profile->begin_subscriber_qos();
40  return SubscriberQos_Handler::get_subscriber_qos(sub_qos, sub_it->get());
41  }
42 
43  ACE_ERROR((LM_ERROR,
44  ACE_TEXT("(%P|%t) ERROR: SubscriberQos_Handler::get_subscriber_qos - ")
45  ACE_TEXT("Unable to find SubscriberQos <%s>\n"),
46  name));
47  return false;
48 }
49 
50 bool
52  dds::subscriberQos * sub)
53 {
55  sub_type subscriber_qos_handler;
56  subscriber_qos_handler.read_qos(sub_qos, sub);
57 
58  return true;
59 }
60 
#define ACE_DEBUG(X)
#define ACE_ERROR(X)
static bool get_subscriber_qos(::DDS::SubscriberQos &sub_qos, ::dds::qosProfile *profile, const ACE_TCHAR *name=0)
char ACE_TCHAR
void read_qos(DDS_QOS_TYPE &, const XML_QOS_TYPE)
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