MCPcopy Create free account
hub / github.com/benkuper/Chataigne / setSourceAndOutModule

Method setSourceAndOutModule

Source/Module/Routing/ModuleRouterValue.cpp:44–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42}
43
44void ModuleRouterValue::setSourceAndOutModule(Module * s, Module * m)
45{
46 if (outModule == m) return;
47
48 var prevData = var();
49
50 if (outModule != nullptr)
51 {
52 if (routeParams != nullptr)
53 {
54 removeChildControllableContainer(routeParams.get());
55 prevData = routeParams->getJSONData();
56 }
57 routeParams = nullptr;
58 }
59
60 outModule = m;
61
62 if (outModule != nullptr)
63 {
64
65 routeParams.reset(outModule->createRouteParamsForSourceValue(s, sourceValue, valueIndex));
66 if (routeParams != nullptr)
67 {
68 routeParams->loadJSONData(prevData);
69 addChildControllableContainer(routeParams.get());
70 }
71 else
72 {
73 NLOGERROR(niceName, "Error when trying to create routing values for out module : " << outModule->niceName);
74 return;
75 }
76
77 }
78
79 valueListeners.call(&ValueListener::routeParamsChanged, this);
80}
81
82var ModuleRouterValue::getJSONData(bool includeNonOverriden)
83{

Callers 3

setSourceModuleMethod · 0.80
setDestModuleMethod · 0.80
reloadSourceValuesMethod · 0.80

Calls 6

getMethod · 0.45
getJSONDataMethod · 0.45
resetMethod · 0.45
loadJSONDataMethod · 0.45
callMethod · 0.45

Tested by

no test coverage detected