ERIS CORE

◆ unregisterApp()

bool FLASHMEM AppManager::unregisterApp ( AppBaseClass app)

provides an interface for apps to unregister themselves with the AppManager
once unregistered the AppManager will no longer include the app in the update loop

Parameters
app
Returns
true if app was removed
false if app could not be found

Definition at line 577 of file AppManager.cpp.

577  {
578  if (root == 0) return false;
579  else{
580  AppBaseClass *endNode = root;
581  //walk the linked list to find a match
582  while(endNode != app && endNode != NULL){endNode=endNode->next_app_node;}
583  if (endNode->next_app_node != app) return false;//no match; just return
584  //remove the node
585  endNode = endNode->next_app_node;
586  if(endNode!=NULL){
587  if(endNode->next_app_node!=NULL){
588  endNode->next_app_node->previous_app_node = endNode;
589  }
590  }
591  }
592  return true;
593 };
AppBaseClass * previous_app_node
Definition: AppBaseClass.h:43
AppBaseClass * next_app_node
Definition: AppBaseClass.h:44
base class definition / implementation from which all app classes will be derived and override
Definition: AppBaseClass.h:34
AppBaseClass * root
Definition: AppManager.h:38

References AppBaseClass::next_app_node, AppBaseClass::previous_app_node, and root.

Referenced by AppBaseClass::~AppBaseClass().

+ Here is the caller graph for this function: