ERIS CORE

◆ sendMessage()

bool AppManager::sendMessage ( AppBaseClass sender,
const char *  to_app,
const char *  message 
)

provides an interface for apps to send messages to other apps

Parameters
sender
to_app
message
Returns
true
false

Definition at line 469 of file AppManager.cpp.

469  {
470  // sends a message to the requested app
471  AppBaseClass *node = root;
472  do{
473  if (node->isName(to_app)){
474  node->messageHandler(sender,message);
475  return true;
476  }
477  node=node->next_app_node;//check next node
478  }while(node !=NULL);
479  return false;
480 }
AppBaseClass * next_app_node
Definition: AppBaseClass.h:44
bool isName(const char *name_string)
Compares the name_string to the app class instance name (string)
Definition: AppBaseClass.h:93
virtual void messageHandler(AppBaseClass *sender, const char *message)
receiver method for inter-app string based communication
Definition: AppBaseClass.h:248
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::isName(), AppBaseClass::messageHandler(), AppBaseClass::next_app_node, and root.

Referenced by AppWren::AppWren(), AppAudioToPolyphonic::messageHandler(), SvcSerialCommandInterface::messageHandler_WREN_SCRIPT_COMPILE(), SvcSerialCommandInterface::messageHandler_WREN_SCRIPT_EXECUTE(), SvcSerialCommandInterface::messageHandler_WREN_SCRIPT_SAVE(), AppAudioToPolyphonic::onFocus(), SvcMIDI::publish(), sendMessageCallback(), and SvcSerialCommandInterface::update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: