OpenDDS  Snapshot(2023/04/28-20:55)
TopicSettings.cpp
Go to the documentation of this file.
1 #include "TopicSettings.h"
2 
3 #include "ace/OS_NS_stdio.h"
4 #include "ace/Log_Priority.h"
5 #include "ace/Log_Msg.h"
6 
7 #include <cstring>
8 
10 
11 namespace OpenDDS { namespace FaceTSS { namespace config {
12 
13 int
14 TopicSettings::set(const char* name, const char* value)
15 {
16  int status = 0;
17  if (!std::strcmp(name, "platform_view_guid")) {
18  platform_view_guid_ = atoi(value);
19  } else if (!std::strcmp(name, "max_message_size")) {
20  max_message_size_ = atoi(value);
21  } else if (!std::strcmp(name, "type_name")) {
22  // Guarantee that value will fit in type_name_ and still be null terminated
23  // type_name_ is sized to TYPE_NAME_LEN
24  if (std::strlen(value) >= sizeof(type_name_)) {
25  ACE_ERROR((LM_ERROR, ACE_TEXT("Type name %C exceeds allowable length,"
26  "must be < %d\n"), value, TYPE_NAME_LEN));
27  status = 1;
28  } else {
29  std::strncpy(type_name_, value, sizeof(type_name_));
30  }
31  } else {
32  // no match
33  ACE_ERROR((LM_ERROR, ACE_TEXT("Don't know of setting %C\n"), name));
34  status = 1;
35  }
36 
37  return status;
38 }
39 
40 } } }
41 
int set(const char *name, const char *value)
#define ACE_ERROR(X)
const LogLevel::Value value
Definition: debug.cpp:61
FACE::MESSAGE_SIZE_TYPE max_message_size_
Definition: TopicSettings.h:21
const char *const name
Definition: debug.cpp:60
ACE_TEXT("TCP_Factory")
int atoi(const char *s)
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
LM_ERROR
The Internal API and Implementation of OpenDDS.
Definition: AddressCache.h:28
FACE::MESSAGE_TYPE_GUID platform_view_guid_
Definition: TopicSettings.h:20