MCPcopy Create free account
hub / github.com/AlexandreRouma/SDRPlusPlus / registerInterface

Method registerInterface

core/src/module_com.cpp:3–15  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1#include <module_com.h>
2
3bool ModuleComManager::registerInterface(std::string moduleName, std::string name, void (*handler)(int code, void* in, void* out, void* ctx), void* ctx) {
4 std::lock_guard<std::mutex> lck(mtx);
5 if (interfaces.find(name) != interfaces.end()) {
6 spdlog::error("Tried creating module interface with an existing name: {0}", name);
7 return false;
8 }
9 ModuleComInterface iface;
10 iface.moduleName = moduleName;
11 iface.handler = handler;
12 iface.ctx = ctx;
13 interfaces[name] = iface;
14 return true;
15}
16
17bool ModuleComManager::unregisterInterface(std::string name) {
18 std::lock_guard<std::mutex> lck(mtx);

Callers 3

RecorderModuleMethod · 0.80
RadioModuleMethod · 0.80

Calls 3

findMethod · 0.80
errorFunction · 0.50
endMethod · 0.45

Tested by

no test coverage detected