| 67 | } |
| 68 | |
| 69 | boost::optional<osvr::common::elements::AliasElement> |
| 70 | getAliasElement(osvr::clientkit::ClientContext &ctx, std::string const &path) { |
| 71 | osvr::common::PathNode const *node = nullptr; |
| 72 | try { |
| 73 | node = &(ctx.get()->getPathTree().getNodeByPath(path)); |
| 74 | } catch (std::exception &e) { |
| 75 | cerr << "Could not get node at path '" << path |
| 76 | << "' - exception: " << e.what() << endl; |
| 77 | return boost::none; |
| 78 | } |
| 79 | auto elt = boost::get<osvr::common::elements::AliasElement>(&node->value()); |
| 80 | if (!elt) { |
| 81 | return boost::none; |
| 82 | } |
| 83 | return *elt; |
| 84 | } |
| 85 | |
| 86 | auto SETTLE_TIME = boost::posix_time::seconds(2); |
| 87 | |