MCPcopy Create free account
hub / github.com/OSVR/OSVR-Core / getAliasElement

Function getAliasElement

apps/osvr_reset_yaw.cpp:69–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67}
68
69boost::optional<osvr::common::elements::AliasElement>
70getAliasElement(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
86auto SETTLE_TIME = boost::posix_time::seconds(2);
87

Callers 1

mainFunction · 0.85

Calls 2

valueMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected