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

Function osvrJointClientInit

src/osvr/JointClientKit/JointClientKitC.cpp:164–197  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

162}
163
164OSVR_ClientContext osvrJointClientInit(const char applicationIdentifier[],
165 OSVR_JointClientOpts opts) {
166 try {
167 using OptionPtr = std::unique_ptr<OSVR_JointClientContextOptsObject>;
168 // Take ownership of options, if any
169 OptionPtr opt(opts);
170
171 using JointContextPtr =
172 std::unique_ptr<osvr::client::JointClientContext>;
173 // Make the context.
174 auto ctx = JointContextPtr{
175 osvr::common::makeContext<osvr::client::JointClientContext>(
176 applicationIdentifier)};
177
178 if (opt) {
179 opt->apply(ctx->getServer());
180 } else {
181 // Default behavior when no options are passed.
182 ctx->getServer().loadAutoPlugins();
183 ctx->getServer().triggerHardwareDetect();
184 }
185 // Transfer ownership to the client app.
186 return ctx.release();
187 } catch (std::exception const &e) {
188 OSVR_DEV_VERBOSE(
189 "Caught an exception in osvrJointClientInit: " << e.what());
190 } catch (...) {
191
192 OSVR_DEV_VERBOSE(
193 "Caught an unrecognized exception type in osvrJointClientInit.");
194 }
195
196 return nullptr;
197}

Callers 3

TESTFunction · 0.85
TESTFunction · 0.85
mainFunction · 0.85

Calls 4

releaseMethod · 0.80
applyMethod · 0.45
loadAutoPluginsMethod · 0.45
triggerHardwareDetectMethod · 0.45

Tested by

no test coverage detected