MCPcopy Create free account
hub / github.com/TactilityProject/Tactility / optApp

Function optApp

Tactility/Source/app/i2cscanner/I2cScanner.cpp:73–80  ·  view source on GitHub ↗

Returns the app data if the app is active. Note that this could clash if the same app is started twice and a background thread is slow. */

Source from the content-addressed store, hash-verified

71
72/** Returns the app data if the app is active. Note that this could clash if the same app is started twice and a background thread is slow. */
73std::shared_ptr<I2cScannerApp> optApp() {
74 auto appContext = getCurrentAppContext();
75 if (appContext != nullptr && appContext->getManifest().appId == manifest.appId) {
76 return std::static_pointer_cast<I2cScannerApp>(appContext->getApp());
77 } else {
78 return nullptr;
79 }
80}
81
82#define PREFERENCES_BUS_INDEX_KEY "bus"
83

Callers

nothing calls this directly

Calls 2

getCurrentAppContextFunction · 0.85
getAppMethod · 0.80

Tested by

no test coverage detected