Class MAE
#include <MAE.h >
This class is the starting point of the MAE platform. Create a single instance for MAE to operate correctly in your main source file. More than likely, you'll instead declare a sub-class - MAEApp, MAEDaemon, or MAEUtility - which is tailored to your tasks's purpose.
static MgmtClient mgmt |
Each MAE app has the option to be managed by the supervisor app. If so, it uses this MgmtClient data structure. |
static bool forkit |
Flag: When MAE starts your application, should it fork? If not, then add this line to your program: bool MAE::forkit= false; to override the default of true. |
const string& programName |
the name of the task as registered inside MAE |
const string& appchannels |
a comma separated list of message channels used. Default is one channel using the program's name. Default value: "" |
Constructor for MAE task.
Declare this task as a daemon - a persistent program providing support to other MAE tasks.
Declare this task as a utility - a one-shot program that performs a task and exits.
Declare this task as an app - a persistent program servicing user requests via UI.
Query if the current task behaves like a daemon.
Query if the current task behaves like a utility.
Query if the current task behaves like an app.
int argc |
number of parameters passed to program from OS |
char** argv |
the parameters passed to program from OS |
MAE defines a ::main(). It creates a single instance of this MAE class and then calls _main(). It necessarily needs to be public so ::main() can call it.
Return the global instance of the MAE class.
Return value: a pointer to the global MAE instance.
int argc |
the number of command line arguments (including program name) |
char** argv |
an array of arguments (char *) to the program |
Application Provided Method.
MAE calls this when the task environment setup to let task initialize itself.
Application Provided Method.
MAE calls this after init() to perform RPC registrations.
The genmae prgram generates this inside the msg*.cpp file.
Application Provided Method.
MAE calls this once this task's environment is fully initialized.
This is where your task performs its main functionality.
Messenger& msgr |
handle to Messenger service |
const string& src |
the source channel that sent the message |
const string& dest |
the destination channel for the message |
const string& request |
the action/keyword/request for this message |
XMLData& param |
the data payload for this request |
Application Provided Method.
Called to handle a message from an app/daemon.
Messenger& msgr |
handle to Messenger service |
const string& src |
the source channel that sent the message |
const string& dest |
the destination channel for the message, e.g. broadcast |
const string& request |
the action/keyword/request for this message |
XMLData& param |
the data payload for this request |
Application Provided Method.
MAE calls this to handle a broadcast message from an app/daemon.
const string& dest |
the destination channel to receive response |
UserDevice& device |
handle to User's device/screen |
const string& cbtag |
the action to take with the response |
const XMLData& cbdata |
the data associated with the action |
string response |
the User's response |
Application Provided Method.
MAE calls this to handle a user response message.
UserDevice& device |
handle to User's device/screen |
const string& cbtag |
the action to take with the response |
const XMLData& cbdata |
the data associated with the action |
const string& dir |
mouse click direction - up, down, move |
float x |
mouse x coordinate of click |
float y |
mouse y coordinate of click |
Application Provided Method.
MAE calls this to handle a user mouse response.
Messenger& msgr |
handle to Messenger service |
const string& src |
the source channel that sent the message |
const string& dest |
the destination channel for the message, e.g. gui |
const string& request |
the action/keyword/request for this message |
XMLData& param |
the data payload for this request |
Application Provided Method.
MAE calls this to handle an API request
string service |
the action/keyword/request for this message |
XMLData& params |
the parameters in this message |
string appname |
the client's app id |
string user |
(future use) |
void* data |
(future use) |
Application Provided Method.
MAE calls this to handle a RPC request
Application Provided Method.
MAE calls this Register the app's various UI and message callbacks.
int rc |
the program's exit code (0 means normal exit, 1+ means err exit) |
const string& msg |
an explanation why the app is shutting down |
Application Provided Method.
Either the user or the ecosystem has initiated a task exit.
int _unused |
(ignored) Default value: 0 |
Toggle the debug mode for the program.
Ensures FILE*dbgf is pointing to a valid log file, e.g. /usr/mae/log/ <taskname >dbg.log
static enum taskType |
The task type, e.g. daemon, utility, app |
string taskname |
The name of the running task |
string channels |
The name of the running task |
channels; channels |
The channels used by this task |
static string dbgfilename |
When debug enabled, this is the debug filename used |
static MsgBroadcast broadcast |
For communication to broadcast channel |
static MAE* instance |
The running instance of MAE |
int a |
(ignored) |
Program exit signal handlers