MCPcopy Create free account
hub / github.com/cathery/sys-con / Insert

Function Insert

source/Sysmodule/source/controller_handler.cpp:26–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24 }
25
26 Result Insert(std::unique_ptr<IController>&& controllerPtr)
27 {
28 std::unique_ptr<SwitchVirtualGamepadHandler> switchHandler;
29 if (UseAbstractedPad)
30 {
31 switchHandler = std::make_unique<SwitchAbstractedPadHandler>(std::move(controllerPtr));
32 WriteToLog("Inserting controller as abstracted pad");
33 }
34 else
35 {
36 switchHandler = std::make_unique<SwitchHDLHandler>(std::move(controllerPtr));
37 WriteToLog("Inserting controller as HDLs");
38 }
39
40 Result rc = switchHandler->Initialize();
41 if (R_SUCCEEDED(rc))
42 {
43 SwitchUtils::ScopedLock scoped_lock(controllerMutex);
44 controllerHandlers.push_back(std::move(switchHandler));
45 }
46
47 return rc;
48 }
49
50 std::vector<std::unique_ptr<SwitchVirtualGamepadHandler>>& Get()
51 {

Callers 2

UsbEventThreadFuncFunction · 0.85
UsbSonyEventThreadFuncFunction · 0.85

Calls 2

WriteToLogFunction · 0.85
InitializeMethod · 0.45

Tested by

no test coverage detected