Tango Core Classes Reference
9.3.4
|
Miscellaneous utility methods usefull in a Tango client. More...
#include "tango.h"
Public Member Functions | |
cb_sub_model | get_asynch_cb_sub_model () |
Get asynchronous callback sub-model. More... | |
void | get_asynch_replies () |
Fire callback methods for asynchronous request(s) More... | |
void | get_asynch_replies (long timeout) |
Fire callback methods for asynchronous request(s) with timeout. More... | |
size_t | pending_asynch_call (asyn_req_type ty) |
Get pending asynchronous requets number. More... | |
void | set_asynch_cb_sub_model (cb_sub_model csm) |
Set asynchronous callback sub-model. More... | |
Static Public Member Functions | |
static TANGO_IMP_EXP void | cleanup () |
Destroy the ApiUtil instance. More... | |
static TANGO_IMP_EXP int | get_env_var (const char *name, string &value) |
Get environment variable. More... | |
static TANGO_IMP_EXP ApiUtil * | instance () |
Retrieve the ApiUtil instance. More... | |
Miscellaneous utility methods usefull in a Tango client.
This class is a singleton. Therefore, it is not necessary to create it. It will be automatically done. A static method allows a user to retrieve the instance
|
inlinestatic |
|
inline |
Get asynchronous callback sub-model.
Get the asynchronous callback sub-model
void ApiUtil::get_asynch_replies | ( | ) |
Fire callback methods for asynchronous request(s)
Fire callback methods for all (any device) asynchronous requests (command and attribute) with already arrived replied. Returns immediately if there is no replies already arrived or if there is no asynchronous requests.
void ApiUtil::get_asynch_replies | ( | long | timeout | ) |
Fire callback methods for asynchronous request(s) with timeout.
Fire callback methods for all (any device) asynchronous requests (command and attributes) with already arrived replied. Wait and block the caller for timeout milliseconds if they are some device asynchronous requests which are not yet arrived. Returns immediately if there is no asynchronous request. If timeout is set to 0, the call waits until all the asynchronous requests sent has received a reply.
[in] | timeout | The timeout value |
|
static |
Get environment variable.
Get environment variable. On Unixes OS, this call tries to get the variable in the caller environment then in a file .tangorc in the user home directory and finally in a file /etc/tangorc. On Windows, this call looks in the user environment then in a file stored in TANGO_HOME%/tangorc. This method returns 0 of the environment variable is found. Otherwise, it returns -1.
[in] | name | The environment variable name |
[out] | value | The environment variable value |
|
inlinestatic |
|
inline |
Get pending asynchronous requets number.
Return number of asynchronous pending requests (any device).
[in] | ty | Asynchronous request type |
void ApiUtil::set_asynch_cb_sub_model | ( | cb_sub_model | csm | ) |
Set asynchronous callback sub-model.
Set the asynchronous callback sub-model between the pull and push sub-model. See Tango book chapter 4.5 to read the definition of these sub-models. By default, all Tango client using asynchronous callback model are in pull sub-model. This call must be used to switch to the push sub-model. NOTE that in push sub-model, a separate thread is spawned to deal with server replies.
[in] | csm | The asynchronous callback sub-model |