ERIS CORE

◆ registerApp()

void AppManager::registerApp ( AppBaseClass app)

provides an interface for apps to register themselves with the AppManager
once registered the AppManager will include the app in the update loop

Parameters
appto be added to the update loop

Definition at line 550 of file AppManager.cpp.

550  {
551  //assign a unique id to the object
552  app->id = next_id_assignment++;
553  app->draw = &draw;
554  app->am = this;
555  app->ad = &_ad;
556  app->sd = &sd;
557  app->sci = &sci;
558  if (root == 0) {root = app; return;}
559  else{
560  AppBaseClass *endNode = root;
561  //add to the linked list
562  while(endNode->next_app_node !=0){endNode=endNode->next_app_node;}
563  endNode->next_app_node = app;
564  app->previous_app_node = endNode;
565  }
566 };
AudioDirector _ad
Definition: ErisCore.cpp:20
ILI9341_t3_ERIS draw(TFT_CS, TFT_DC, TFT_RESET, TFT_MOSI, TFT_SCLK, TFT_MISO)
SvcSerialCommandInterface sci
Definition: ErisCore.cpp:22
AppBaseClass * previous_app_node
Definition: AppBaseClass.h:43
SvcSerialCommandInterface * sci
Definition: AppBaseClass.h:39
uint16_t id
Definition: AppBaseClass.h:46
AppBaseClass * next_app_node
Definition: AppBaseClass.h:44
AppManager * am
Definition: AppBaseClass.h:38
ILI9341_t3_ERIS * draw
Definition: AppBaseClass.h:41
AudioDirector * ad
Definition: AppBaseClass.h:37
base class definition / implementation from which all app classes will be derived and override
Definition: AppBaseClass.h:34
AppBaseClass * root
Definition: AppManager.h:38
uint16_t next_id_assignment
Definition: AppManager.h:40

References _ad, AppBaseClass::ad, AppBaseClass::am, AppBaseClass::draw, draw, AppBaseClass::id, AppBaseClass::next_app_node, next_id_assignment, AppBaseClass::previous_app_node, root, AppBaseClass::sci, sci, AppBaseClass::sd, and sd.

Referenced by AppBaseClass::selfRegister().

+ Here is the caller graph for this function: