MCPcopy Create free account
hub / github.com/BlueAndi/Pixelix / addToPluginList

Method addToPluginList

lib/TopicHandlerService/src/TopicHandlerService.cpp:476–516  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

474}
475
476void TopicHandlerService::addToPluginList(IPluginMaintenance* plugin, const String& topic)
477{
478 if ((nullptr != plugin) &&
479 (false == topic.isEmpty()))
480 {
481 PluginMetaDataList::iterator pluginMetaDataIt = m_pluginMetaDataList.begin();
482 bool found = false;
483
484 /* Check whether the plugin is already added with its topic. */
485 while (m_pluginMetaDataList.end() != pluginMetaDataIt)
486 {
487 PluginMetaData* pluginMetaData = *pluginMetaDataIt;
488
489 /* Found? */
490 if ((plugin == pluginMetaData->plugin) &&
491 (topic == pluginMetaData->topic))
492 {
493 ++pluginMetaData->count;
494 found = true;
495 break;
496 }
497
498 ++pluginMetaDataIt;
499 }
500
501 /* If plugin and its topic is not found, it will be added to the list. */
502 if (false == found)
503 {
504 PluginMetaData* pluginMetaData = new (std::nothrow) PluginMetaData();
505
506 if (nullptr != pluginMetaData)
507 {
508 pluginMetaData->plugin = plugin;
509 pluginMetaData->topic = topic;
510 pluginMetaData->count = 1U;
511
512 m_pluginMetaDataList.push_back(pluginMetaData);
513 }
514 }
515 }
516}
517
518void TopicHandlerService::removeFromPluginList(IPluginMaintenance* plugin, const String& topic)
519{

Callers

nothing calls this directly

Calls 3

isEmptyMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected