MCPcopy Create free account
hub / github.com/OpenDDS/OpenDDS / parse_topics

Method parse_topics

dds/DCPS/StaticDiscovery.cpp:1739–1780  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1737}
1738
1739int
1740StaticDiscovery::parse_topics()
1741{
1742 RcHandle<ConfigStoreImpl> config_store = TheServiceParticipant->config_store();
1743 const ConfigStoreImpl::StringList sections = config_store->get_section_names("TOPIC");
1744
1745 // Loop through the [topic/*] sections
1746 for (ConfigStoreImpl::StringList::const_iterator pos = sections.begin(), limit = sections.end();
1747 pos != limit; ++pos) {
1748 const String& topic_name = *pos;
1749
1750 if (DCPS_debug_level > 0) {
1751 ACE_DEBUG((LM_NOTICE,
1752 ACE_TEXT("(%P|%t) NOTICE: StaticDiscovery::parse_topics ")
1753 ACE_TEXT("processing [topic/%C] section.\n"),
1754 topic_name.c_str()));
1755 }
1756
1757 EndpointRegistry::Topic topic;
1758 topic.name = config_store->get((String("TOPIC_") + topic_name + "_NAME").c_str(), topic_name);
1759 topic.type_name = config_store->get((String("TOPIC_") + topic_name + "_TYPE_NAME").c_str(), "");
1760 if (topic.type_name.empty()) {
1761 ACE_ERROR((LM_ERROR,
1762 ACE_TEXT("(%P|%t) StaticDiscovery::parse_topics ")
1763 ACE_TEXT("No type_name specified for [topic/%C] section.\n"),
1764 topic_name.c_str()));
1765 return -1;
1766 }
1767 if (topic.type_name.size() >= TYPE_NAME_MAX) {
1768 ACE_ERROR((LM_ERROR,
1769 ACE_TEXT("(%P|%t) StaticDiscovery::parse_topics ")
1770 ACE_TEXT("type_name (%C) must be less than 128 characters in [topic/%C] section.\n"),
1771 topic.type_name.c_str(), topic_name.c_str()));
1772 return -1;
1773
1774 }
1775
1776 registry.topic_map[topic_name] = topic;
1777 }
1778
1779 return 0;
1780}
1781
1782int
1783StaticDiscovery::parse_datawriterqos()

Callers

nothing calls this directly

Calls 8

StringClass · 0.85
config_storeMethod · 0.80
get_section_namesMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
getMethod · 0.45
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected