OpenDDS  Snapshot(2023/04/28-20:55)
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
OpenDDS::FaceTSS::config::ConnectionSettings Class Reference

#include <ConnectionSettings.h>

Public Member Functions

 ConnectionSettings ()
 
int set (const char *name, const char *value)
 
const char * datawriter_qos_name () const
 
const char * datareader_qos_name () const
 
const char * publisher_qos_name () const
 
const char * subscriber_qos_name () const
 
const char * config_name () const
 
bool datawriter_qos_set () const
 
bool datareader_qos_set () const
 
bool publisher_qos_set () const
 
bool subscriber_qos_set () const
 
bool config_set () const
 

Public Attributes

char topic_name_ [ALLOWABLE_NAME_LEN]
 
char datawriter_qos_name_ [ALLOWABLE_NAME_LEN]
 
char datareader_qos_name_ [ALLOWABLE_NAME_LEN]
 
char publisher_qos_name_ [ALLOWABLE_NAME_LEN]
 
char subscriber_qos_name_ [ALLOWABLE_NAME_LEN]
 
FACE::CONNECTION_ID_TYPE connection_id_
 
FACE::CONNECTION_DIRECTION_TYPE direction_
 
int domain_id_
 
int participant_id_
 
char config_name_ [ALLOWABLE_NAME_LEN]
 

Static Public Attributes

static const size_t ALLOWABLE_NAME_LEN = 64
 

Detailed Description

Definition at line 13 of file ConnectionSettings.h.

Constructor & Destructor Documentation

◆ ConnectionSettings()

OpenDDS::FaceTSS::config::ConnectionSettings::ConnectionSettings ( )

Definition at line 13 of file ConnectionSettings.cpp.

References config_name_, datareader_qos_name_, datawriter_qos_name_, publisher_qos_name_, subscriber_qos_name_, and topic_name_.

14 : connection_id_(0),
15  direction_(FACE::SOURCE),
16  domain_id_(0),
18 {
19  std::strcpy(topic_name_, "");
20  std::strcpy(datawriter_qos_name_, "");
21  std::strcpy(datareader_qos_name_, "");
22  std::strcpy(publisher_qos_name_, "");
23  std::strcpy(subscriber_qos_name_, "");
24  std::strcpy(config_name_, "");
25 }
FACE::CONNECTION_DIRECTION_TYPE direction_

Member Function Documentation

◆ config_name()

const char * OpenDDS::FaceTSS::config::ConnectionSettings::config_name ( ) const

Definition at line 140 of file ConnectionSettings.cpp.

References config_name_.

Referenced by OpenDDS::FaceTSS::config::Parser::parse().

141 {
142  return config_name_;
143 }

◆ config_set()

bool OpenDDS::FaceTSS::config::ConnectionSettings::config_set ( ) const

Definition at line 170 of file ConnectionSettings.cpp.

References config_name_, and OPENDDS_END_VERSIONED_NAMESPACE_DECL.

Referenced by OpenDDS::FaceTSS::config::Parser::parse().

171 {
172  return config_name_[0];
173 }

◆ datareader_qos_name()

const char * OpenDDS::FaceTSS::config::ConnectionSettings::datareader_qos_name ( ) const

◆ datareader_qos_set()

bool OpenDDS::FaceTSS::config::ConnectionSettings::datareader_qos_set ( ) const

◆ datawriter_qos_name()

const char * OpenDDS::FaceTSS::config::ConnectionSettings::datawriter_qos_name ( ) const

◆ datawriter_qos_set()

bool OpenDDS::FaceTSS::config::ConnectionSettings::datawriter_qos_set ( ) const

◆ publisher_qos_name()

const char * OpenDDS::FaceTSS::config::ConnectionSettings::publisher_qos_name ( ) const

◆ publisher_qos_set()

bool OpenDDS::FaceTSS::config::ConnectionSettings::publisher_qos_set ( ) const

◆ set()

int OpenDDS::FaceTSS::config::ConnectionSettings::set ( const char *  name,
const char *  value 
)

Definition at line 28 of file ConnectionSettings.cpp.

References ACE_ERROR, ACE_TEXT(), ALLOWABLE_NAME_LEN, atoi(), config_name_, connection_id_, datareader_qos_name_, datawriter_qos_name_, direction_, domain_id_, LM_ERROR, participant_id_, publisher_qos_name_, subscriber_qos_name_, and topic_name_.

Referenced by OpenDDS::FaceTSS::config::Parser::parse_connection().

29 {
30  int status = 0;
31  if (!std::strcmp(name, "id")) {
33  } else if (!std::strcmp(name, "participantid")) {
35  } else if (!std::strcmp(name, "domain")) {
37  } else if (!std::strcmp(name, "topic")) {
38  if (std::strlen(value) >= ALLOWABLE_NAME_LEN) {
39  ACE_ERROR((LM_ERROR, ACE_TEXT("topic name %C exceeds allowable length,"
40  "must be < %B\n"), value, ALLOWABLE_NAME_LEN));
41  status = 1;
42  } else {
43  std::strncpy(topic_name_, value, sizeof(topic_name_));
44  }
45  } else if (!std::strcmp(name, "datawriterqos")) {
46  if (std::strlen(value) >= ALLOWABLE_NAME_LEN) {
47  ACE_ERROR((LM_ERROR, ACE_TEXT("datawriterqos name %C exceeds allowable length,"
48  "must be < %B\n"), value, ALLOWABLE_NAME_LEN));
49  status = 1;
50  } else {
51  std::strncpy(datawriter_qos_name_, value, sizeof(datawriter_qos_name_));
52  }
53  } else if (!std::strcmp(name, "datareaderqos")) {
54  if (std::strlen(value) >= ALLOWABLE_NAME_LEN) {
55  ACE_ERROR((LM_ERROR, ACE_TEXT("datareaderqos name %C exceeds allowable length,"
56  "must be < %B\n"), value, ALLOWABLE_NAME_LEN));
57  status = 1;
58  } else {
59  std::strncpy(datareader_qos_name_, value, sizeof(datareader_qos_name_));
60  }
61  } else if (!std::strcmp(name, "publisherqos")) {
62  if (std::strlen(value) >= ALLOWABLE_NAME_LEN) {
63  ACE_ERROR((LM_ERROR, ACE_TEXT("publisherqos name %C exceeds allowable length,"
64  "must be < %B\n"), value, ALLOWABLE_NAME_LEN));
65  status = 1;
66  } else {
67  std::strncpy(publisher_qos_name_, value, sizeof(publisher_qos_name_));
68  }
69  } else if (!std::strcmp(name, "subscriberqos")) {
70  if (std::strlen(value) >= ALLOWABLE_NAME_LEN) {
71  ACE_ERROR((LM_ERROR, ACE_TEXT("subscriberqos name %C exceeds allowable length,"
72  "must be < %B\n"), value, ALLOWABLE_NAME_LEN));
73  status = 1;
74  } else {
75  std::strncpy(subscriber_qos_name_, value, sizeof(subscriber_qos_name_));
76  }
77  } else if (!std::strcmp(name, "direction")) {
78  if (!std::strcmp(value, "source") ||
79  !std::strcmp(value, "one_way_request_source") ||
80  !std::strcmp(value, "two_way_request_synchronous_source") ||
81  !std::strcmp(value, "two_way_request_reply_asynchronous_source")) {
82  direction_ = FACE::SOURCE;
83  } else if (!std::strcmp(value, "destination") ||
84  !std::strcmp(value, "one_way_request_destination") ||
85  !std::strcmp(value, "two_way_request_synchronous_destination") ||
86  !std::strcmp(value, "two_way_request_reply_asynchronous_destination")) {
87  direction_ = FACE::DESTINATION;
88  } else if (!std::strcmp(value, "bi_directional") ||
89  !std::strcmp(value, "not_defined_connection_direction_type")) {
90  ACE_ERROR((LM_ERROR, ACE_TEXT("Direction not supported: %C\n"), value));
91  status = 1;
92  } else {
93  ACE_ERROR((LM_ERROR, ACE_TEXT("Don't know of direction %C\n"), value));
94  status = 1;
95  }
96  } else if (!std::strcmp(name, "config")) {
97  // Guarantee that value will fit in config_name_ and still be null terminated
98  // config_name_ is sized to ALLOWABLE_NAME_LEN
99  if (std::strlen(value) >= sizeof(config_name_)) {
100  ACE_ERROR((LM_ERROR, ACE_TEXT("config name %C exceeds allowable length,"
101  "must be < %B\n"), value, ALLOWABLE_NAME_LEN));
102  status = 1;
103  } else {
104  std::strncpy(config_name_, value, sizeof(config_name_));
105  }
106  } else {
107  // no match
108  ACE_ERROR((LM_ERROR, ACE_TEXT("Don't know of setting %C\n"), name));
109  status = 1;
110  }
111 
112  return status;
113 }
#define ACE_ERROR(X)
const LogLevel::Value value
Definition: debug.cpp:61
FACE::CONNECTION_DIRECTION_TYPE direction_
const char *const name
Definition: debug.cpp:60
ACE_TEXT("TCP_Factory")
int atoi(const char *s)

◆ subscriber_qos_name()

const char * OpenDDS::FaceTSS::config::ConnectionSettings::subscriber_qos_name ( ) const

◆ subscriber_qos_set()

bool OpenDDS::FaceTSS::config::ConnectionSettings::subscriber_qos_set ( ) const

Member Data Documentation

◆ ALLOWABLE_NAME_LEN

const size_t OpenDDS::FaceTSS::config::ConnectionSettings::ALLOWABLE_NAME_LEN = 64
static

Definition at line 15 of file ConnectionSettings.h.

Referenced by set().

◆ config_name_

char OpenDDS::FaceTSS::config::ConnectionSettings::config_name_[ALLOWABLE_NAME_LEN]

◆ connection_id_

FACE::CONNECTION_ID_TYPE OpenDDS::FaceTSS::config::ConnectionSettings::connection_id_

◆ datareader_qos_name_

char OpenDDS::FaceTSS::config::ConnectionSettings::datareader_qos_name_[ALLOWABLE_NAME_LEN]

◆ datawriter_qos_name_

char OpenDDS::FaceTSS::config::ConnectionSettings::datawriter_qos_name_[ALLOWABLE_NAME_LEN]

◆ direction_

FACE::CONNECTION_DIRECTION_TYPE OpenDDS::FaceTSS::config::ConnectionSettings::direction_

◆ domain_id_

int OpenDDS::FaceTSS::config::ConnectionSettings::domain_id_

◆ participant_id_

int OpenDDS::FaceTSS::config::ConnectionSettings::participant_id_

Definition at line 41 of file ConnectionSettings.h.

Referenced by FACE::TS::Create_Connection(), and set().

◆ publisher_qos_name_

char OpenDDS::FaceTSS::config::ConnectionSettings::publisher_qos_name_[ALLOWABLE_NAME_LEN]

◆ subscriber_qos_name_

char OpenDDS::FaceTSS::config::ConnectionSettings::subscriber_qos_name_[ALLOWABLE_NAME_LEN]

◆ topic_name_

char OpenDDS::FaceTSS::config::ConnectionSettings::topic_name_[ALLOWABLE_NAME_LEN]

The documentation for this class was generated from the following files: