-\r
- std::cout << "7. Get Topics" << std::endl;\r
- std::cout << "8. Select Topics" << std::endl;\r
- std::cout << "0. Exit" << std::endl;\r
- std::cout << "input: " << std::endl;\r
-\r
- int num = 0;\r
- std::cin >> num;\r
- switch (num)\r
- {\r
- case 7:\r
- {\r
- std::cout << "getInterestTopics" << std::endl;\r
- if (provider != nullptr)\r
- {\r
- auto topicList = provider->getTopicList();\r
- if (topicList != nullptr)\r
- for (auto it : topicList->getTopicsList())\r
- {\r
- std::cout << "Topic Name: " << it->getTopicName() << std::endl;\r
- std::cout << "Topic state: " << (int) it->getState() << std::endl;\r
- }\r
- }\r
- }\r
- break;\r
- case 8:\r
- {\r
- std::cout << "selectInterestTopics" << std::endl;\r
- if (provider != nullptr)\r
- {\r
- NSTopicsList *topicList = new NSTopicsList();\r
- topicList->addTopic("OCF_TOPIC1", NSTopic::NSTopicState::UNSUBSCRIBED);\r
- topicList->addTopic("OCF_TOPIC2", NSTopic::NSTopicState::UNSUBSCRIBED);\r
- topicList->addTopic("OCF_TOPIC3", NSTopic::NSTopicState::UNSUBSCRIBED);\r
-\r
- provider->selectInterestTopics(topicList);\r
- }\r
- }\r
- break;\r
- case 0:\r
- default:\r
- break;\r
- }\r