+ return os << "\turi : " << object->getUri() << std::endl <<
+ "\thost address : " << object->getAddress();
+}
+
+std::ostream& operator<<(std::ostream& os, const MenuItem& item)
+{
+ return os << item.title;
+}
+
+void onSelected(const RCSRemoteResourceObject::Ptr& object)
+{
+ g_selectedResource = object;
+}
+
+void onSelected(const MenuItem& item)
+{
+ std::cout << item.title << " start.." << std::endl;
+ item.handler();
+}
+
+int processUserInput(int min = std::numeric_limits<int>::min(),
+ int max = std::numeric_limits<int>::max())
+{
+ assert(min <= max);
+
+ int input;
+
+ std::cin >> input;
+ std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
+
+ if (!std::cin.fail() && min <= input && input <= max) return input;
+
+ std::cin.clear();
+ std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
+
+ throw std::runtime_error("Invalid Input, please try again");
+}
+
+template<typename D>
+void displayItem(int width, int index, const D& data)
+{
+ std::cout.width(width);
+ std::cout << std::right << index << ". ";
+ std::cout << data << std::endl;
+}
+
+template<typename T>
+void displayItems(const std::vector<T>& items)
+{
+ std::cout << std::endl;
+
+ const auto width = (items.size() + 1) / 10 + 1;
+
+ for(size_t i = 0; i < items.size(); ++i)