Class MgmtClient
#include <MgmtClient.h >
The Supervisor app monitors all the running programs and provides a user interface to allow an admin to view detailed app state. But it can only see what the app shares. Use this class to declare what supervisor can view and change.
You will need to provide callbacks to MgmtClient can call into your app to get and set data. And you'll need to declare the variables available for supervisor to see.
const string& channel |
name of the channel to use (if not primary task channel) Default value: "" |
Constructor.
const string& newChannel |
the new channel to use |
Set the channel name
Get the channel name
Return value: the channel name
const string& category |
the variable category (app defines its categories) |
const string& newParam |
parameter name (app defines parameter names) |
string fixedValue |
the value of the parameter |
Declare a variable with a stable value that can be queried by supervisor using get.
Return value: true upon success, false upon error
const string& category |
the variable category (app defines its categories) |
const string& newParam |
parameter name (app defines parameter names) |
int* intRef |
a pointer the the variable |
Declare an int variable with a dynamic value that can be queried by supervisor using get.
Return value: true upon success, false upon error
const string& category |
the variable category (app defines its categories) |
const string& newParam |
parameter name (app defines parameter names) |
unsigned int* intRef |
a pointer the the variable |
Declare an unsigned int variable with a dynamic value that can be queried by supervisor using get.
Return value: true upon success, false upon error
const string& category |
the variable category (app defines its categories) |
const string& newParam |
parameter name (app defines parameter names) |
long* longRef |
a pointer the the variable |
Declare a long variable with a dynamic value that can be queried by supervisor using get.
Return value: true upon success, false upon error
const string& category |
the variable category (app defines its categories) |
const string& newParam |
parameter name (app defines parameter names) |
float* floatRef |
a pointer the the variable |
Declare a float variable with a dynamic value that can be queried by supervisor using get.
Return value: true upon success, false upon error
const string& category |
the variable category (app defines its categories) |
const string& newParam |
parameter name (app defines parameter names) |
string* stringRef |
a pointer the the variable |
Declare a string variable with a dynamic value that can be queried by supervisor using get.
Return value: true upon success, false upon error
const string& category |
the variable category (app defines its categories) |
const string& newParam |
parameter name (app defines parameter names) |
MgmtClientGet getFunction |
a function point to a function that can provide the parameter's value |
Declare a special variable with a dynamic value that can be queried by supervisor using get - that must be queried via function call.
Return value: true upon success, false upon error
const string& category |
the variable category (app defines its categories) |
const string& newParam |
parameter name (app defines parameter names) |
MgmtClientSet setFunction |
a function point to a function that can provide the parameter's value |
Declare the function to use to set/change the value of a variable. Your function performs error checking and bounds checking. If the new value changes the behavior of your app, then your function makes sure the behavior changes.
Return value: true upon success, false upon error
UserDevice& device |
the UserDevice instance for the user's UI |
const HashArray& newParam |
SysAdmin user interface (defined by app)
UserDevice& device |
the UserDevice instance for the user's UI |
const HashArray& newParam |
Operator user interface (defined by app)
UserDevice& device |
the UserDevice instance for the user's UI |
const string& cbtag |
the action the UI is requesting to be taken |
const XMLData& cbdata |
callback data for the action |
string response |
the user's response to the UI control |
Your app defines this method, typically in support of your supervisorGUI() and operatorGUI() methods
Your capp also calls this instead of your own of the same name if cbdata["sysadmin"] is True
const XMLData& newParam |
Your handleMessage() method should call this handleMessage() when it receives a "sysadmin" request. The class defines this method (not your app)
const string& category |
the parameter category |
const string& param |
the parameter name |
Query a parameter
const string& category |
the parameter category |
const string& param |
the parameter name |
const HashArray& value |
new value for parameter |
Set a parameter
Report another inbound message request
Report another inbound broadcast message request
Report another inbound user response
Report an inbound message that was erroneous
Report an inbound user response that could not be processed
float delta |
number of seconds |
Note the response time used by the MgmtClient class's handleMessage()
string channel |
The channel to use for communication |
int inboundRequestCount |
inbound # of message requests |
int inboundBroadcastCount |
inbound # of broadcast messages |
int inboundInputsCount |
inbound # of user responses |
int inboundRequestErrors |
inbound # of message request errors |
int inboundInputErrors |
inbound # of unprocessable user responses |
float inboundRequestTime |
last request latency time |
static long time0 |
clock timer used for latency tracking |
XMLData uidata |
For use by user interface code Note: MgmtClient UI can only be used by one user at a time because there is only one (static) instance of this variable in *App class |
vector <MgmtClientParameter > param |
Portfolio of app parameters available to supervisor |
bool initialized |
Flag: are we intialized yet |
const string& channel |
the channel to use Default value: "" |
Initialization routine (defined by app)
This calls addGetParameter*() and addSetParameter*() to define the management space
Ensure that we are initialized
Initialize the intrinsics
const string& category |
the parameter category |
const string& qparam |
the parameter name |
bool get |
true to check if parameter is available for get, false to check if available for set Default value: true |
Check to see if a parameter exists
bool get |
true to check if parameter is available for get, false to check if available for set |
Get a list of parameter categories
Return value: list of categories
bool get |
true to check if parameter is available for get, false to check if available for set |
const string& category |
For a particular category, query the list of parameter names
Return value: list of parameter names
Intrinsic paramter calculator for uptime.
Return value: uptime