MCPcopy Create free account
hub / github.com/SmingHub/Sming / addPlugin

Method addPlugin

Sming/Components/Network/src/Network/Http/HttpResource.cpp:68–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66}
67
68void HttpResource::addPlugin(HttpResourcePlugin* plugin)
69{
70 if(plugin == nullptr) {
71 return;
72 }
73
74 auto ref = new PluginRef{plugin};
75 auto priority = plugin->getPriority();
76 auto current = plugins.head();
77 if(current == nullptr || (*current)->getPriority() < priority) {
78 plugins.insert(ref);
79 return;
80 }
81
82 while(current->next() != nullptr && (*current->getNext())->getPriority() > priority) {
83 current = current->getNext();
84 }
85
86 ref->insertAfter(current);
87}

Callers 1

setMethod · 0.45

Calls 6

getNextMethod · 0.80
getPriorityMethod · 0.45
headMethod · 0.45
insertMethod · 0.45
nextMethod · 0.45
insertAfterMethod · 0.45

Tested by

no test coverage detected