Abstract parent of classes that want to register themselves with CASA's DBus server.
More...
|
static bool | dbusXmlCallNoRet (const casacore::String &fromName, const casacore::String &objectName, const casacore::String &methodName, const casacore::Record ¶meters, bool isAsync=false) |
| Calls the given method on the object with the given name that is registered with CASA's DBus server, using the given parameters. More...
|
|
static bool | dbusXmlCall (const casacore::String &fromName, const casacore::String &objectName, const casacore::String &methodName, const casacore::Record ¶meters, bool &retValue, bool *retValueSet=NULL) |
| Like dbusXmlCallNoRet(), except that if the remote method has a return value of the given type, then the value is set accordingly. More...
|
|
static bool | dbusXmlCall (const casacore::String &fromName, const casacore::String &objectName, const casacore::String &methodName, const casacore::Record ¶meters, int &retValue, bool *retValueSet=NULL) |
|
static bool | dbusXmlCall (const casacore::String &fromName, const casacore::String &objectName, const casacore::String &methodName, const casacore::Record ¶meters, casacore::uInt &retValue, bool *retValueSet=NULL) |
|
static bool | dbusXmlCall (const casacore::String &fromName, const casacore::String &objectName, const casacore::String &methodName, const casacore::Record ¶meters, double &retValue, bool *retValueSet=NULL) |
|
static bool | dbusXmlCall (const casacore::String &fromName, const casacore::String &objectName, const casacore::String &methodName, const casacore::Record ¶meters, casacore::String &retValue, bool *retValueSet=NULL) |
|
static bool | dbusXmlCall (const casacore::String &fromName, const casacore::String &objectName, const casacore::String &methodName, const casacore::Record ¶meters, casacore::Record &retValue, bool *retValueSet=NULL) |
|
static bool | dbusXmlCall (const casacore::String &fromName, const casacore::String &objectName, const casacore::String &methodName, const casacore::Record ¶meters, casacore::Array< bool > &retValue, bool *retValueSet=NULL) |
|
static bool | dbusXmlCall (const casacore::String &fromName, const casacore::String &objectName, const casacore::String &methodName, const casacore::Record ¶meters, casacore::Array< int > &retValue, bool *retValueSet=NULL) |
|
static QDBusConnection | connection () |
|
static QString | serviceOwner (const QString &service) |
|
static QString | serviceOwner (const std::string &service) |
|
static bool | serviceIsAvailable (const QString &service) |
|
static bool | serviceIsAvailable (const std::string &service) |
|
static QString | generateServiceName (const QString &name, const pid_t pid) |
|
|
| QtDBusXmlApp () |
| Constructor. More...
|
|
virtual | ~QtDBusXmlApp () |
| Destructor. More...
|
|
virtual void | dbusRunXmlMethod (const casacore::String &methodName, const casacore::Record ¶meters, casacore::Record &retValue, const casacore::String &callerName, bool isAsync)=0 |
| ABSTRACT METHODS //. More...
|
|
virtual void | dbusXmlReceived (const QtDBusXML &xml) |
| VIRTUAL METHODS //. More...
|
|
bool | dbusRegisterSelf (const casacore::String &name="") |
| IMPLEMENTED METHODS //. More...
|
|
void | dbusUnregisterSelf () |
| Unregisters this object with CASA's DBus server, if it is registered. More...
|
|
bool | dbusSelfIsRegistered () const |
| Returns true if this object is currently registered with CASA's DBus server, false otherwise. More...
|
|
casacore::String | dbusSelfRegisteredName () const |
| Returns the name that this object is registered with with CASA's DBus server, or an empty casacore::String if this application is not currently registered. More...
|
|
bool | dbusXmlCallNoRet (const casacore::String &objectName, const casacore::String &methodName, const casacore::Record ¶meters, bool isAsync=false) |
| Calls the static version of the method with this application's name. More...
|
|
bool | dbusXmlCall (const casacore::String &objectName, const casacore::String &methodName, const casacore::Record ¶meters, bool &retValue, bool *retValueSet=NULL) |
|
bool | dbusXmlCall (const casacore::String &objectName, const casacore::String &methodName, const casacore::Record ¶meters, int &retValue, bool *retValueSet=NULL) |
|
bool | dbusXmlCall (const casacore::String &objectName, const casacore::String &methodName, const casacore::Record ¶meters, casacore::uInt &retValue, bool *retValueSet=NULL) |
|
bool | dbusXmlCall (const casacore::String &objectName, const casacore::String &methodName, const casacore::Record ¶meters, double &retValue, bool *retValueSet=NULL) |
|
bool | dbusXmlCall (const casacore::String &objectName, const casacore::String &methodName, const casacore::Record ¶meters, casacore::String &retValue, bool *retValueSet=NULL) |
|
bool | dbusXmlCall (const casacore::String &objectName, const casacore::String &methodName, const casacore::Record ¶meters, casacore::Record &retValue, bool *retValueSet=NULL) |
|
bool | dbusXmlCall (const casacore::String &objectName, const casacore::String &methodName, const casacore::Record ¶meters, casacore::Array< bool > &retValue, bool *retValueSet=NULL) |
|
bool | dbusXmlCall (const casacore::String &objectName, const casacore::String &methodName, const casacore::Record ¶meters, casacore::Array< int > &retValue, bool *retValueSet=NULL) |
|
bool | connectToDBus (QObject *object, const QString &dbus_name="") |
|
Abstract parent of classes that want to register themselves with CASA's DBus server.
The class also provides public static methods for other code to send DBus messages without needing to subclass and register. This class hides the details of how the DBus communication happens behind the scenes and presents an interface using CASA objects like Records. Applications that want to use this DBus communication layer need to know about the following for each method call: The object name. Each object that registers with CASA's DBus server must do so with a unique name. Outside objects then can send messages to that object by using its name. Names have some restrictions; see dbusRegisterSelf(). You can check if a certain name is currently registered using dbusNameIsRegistered(). The method name. Each object keeps track of what methods it supports, and this process happens dynamically on a per-message basis. Whether to call asynchronously or not. See dbusXmlCallNoRet(). The method parameters. The parameters are set using name/value pairs in a Record. Like the method name, this is on a dynamic, per-object basis. IMPORTANT: not all types are currently supported; see QtDBusXML documentation to see what is currently implemented. The method return value. IMPORTANT: not all types are currently supported; see QtDBusXML documentation to see what is currently implemented.
If a class wants to receive DBus communications, it must take the following steps: 1) Subclass QtDBusXmlApp. 2) Implement the dbusRunXmlMethod() method, which is called when a DBus method call is received. For a discussion of the parameters to this method, see above. 3) Call dbusRegisterSelf() with a unique name.
Classes that wish to send but not receive messages do NOT need to subclass QtDBusXmlApp and can just use the public static methods to call methods on DBus-registered objects. For a discussion of the parameters to these static methods, see above.
Definition at line 77 of file QtDBusXmlApp.qo.h.
IMPLEMENTED METHODS //.
Registers this object with CASA's DBus server, if it is not already, with the given name and returns whether or not the registration succeeded. If the name is blank, then the last set name is used, UNLESS this is the first time registering in which case the registration will fail. The registration name MUST contain only numbers, letters, and underscores, and MUST be unique for the DBus server; trying to register with a name that is already in use will result in registration failure. (Note, however, that the name needs ONLY to be unique within the CASA DBus application names rather than all system-wide DBus application names.) Trying to register when already registered (see dbusSelfIsRegistered()) will result in registration failure; to change names, you must unregister and then reregister with the new name.
ABSTRACT METHODS //.
Runs the method with the specified name using the given parameters and placing the return value, if any, into the given retValue record. NOTE: when defining the return value, the name doesn't matter because the first entry is used. The caller name, and whether this is an asynchronous call or not, are also provided but do not need to be used. Note, however, that asynchronous method calls will NOT use a return value even if one is set.
Implemented in casa::PlotMSDBusApp.
Calls the given method on the object with the given name that is registered with CASA's DBus server, using the given parameters.
The given from name is sent to the remote object, but not used otherwise. If isAsync is true, then the remote method runs asynchronously, which means that control returns immediately after sending the message. This method does NOT give a return value, even if the remote method does. Returns true for success, false for failure. Will fail if the given object name is not registered with CASA's DBus server.
Referenced by dbusXmlCallNoRet().