32 #include <QDomDocument>
33 #include <QDBusArgument>
89 if(
time != NULL) qtime =
new QString();
90 if(
from != NULL) qfrom =
new QString();
91 if(
to != NULL) qto =
new QString();
92 if(
methodName != NULL) qmethodName =
new QString();
94 if(
time != NULL) { *
time = qtime->toStdString();
delete qtime; }
95 if(
from != NULL) { *
from = qfrom->toStdString();
delete qfrom; }
96 if(
to != NULL) { *
to = qto->toStdString();
delete qto; }
121 QString
qtime()
const;
130 QString
qfrom()
const;
342 bool createIfAbsent =
false)
const;
346 const QString&
value);
366 bool createIfAbsent =
false) {
367 return elemChild(doc.documentElement(),
name, createIfAbsent); }
368 static QDomElement
elemChild(QDomElement elem,
const QString&
name,
369 bool createIfAbsent =
false);
376 bool createIfAbsent =
false) {
379 bool createIfAbsent =
false) {
380 return elemChild(elem, name, createIfAbsent).text();
388 const QString&
value,
bool createIfAbsent =
false) {
391 const QString&
value,
bool createIfAbsent =
false) {
397 static void setElemText(QDomElement elem,
const QString& text);
bool methodIsAsync() const
bool returnedIsArrayBool() const
casacore::Record returnedValue() const
Gets/Sets the returned value as a record.
bool returnedIsInt() const
virtual ~QtDBusXML()
Destructor.
static void extractXML(const QtDBusXML &xml, casacore::String *time=NULL, casacore::String *from=NULL, casacore::String *to=NULL, casacore::String *methodName=NULL, casacore::Record *methodParams=NULL, casacore::Record *retValue=NULL)
Reads the values from the given XML message into the given parameters which are not NULL...
void setMethodName(const casacore::String &value, bool isAsync=false)
static void elemFromArrayBool(QDomElement elem, const casacore::Array< casacore::Bool > &value)
casacore::String to() const
Gets/Sets the to tag.
StatsData< AccumType > copy(const StatsData< AccumType > &stats)
static QtDBusXML fromString(const casacore::String &xmlStr)
Constructs and returns an XML message from the given XML string.
static void elemFromArrayInt(QDomElement elem, const casacore::Array< casacore::Int > &value)
QString elemChildText(const QString &name) const
Helper method for elemChildText().
void initialize()
Initialize object; meant to be called from constructor.
void setElemChildText(const QString &name, const QString &value)
Helper method for setElemChildText().
Subclass of QDomDocument that represents an XML scheme that is to be used with CASA's Qt dbus communi...
bool methodParamIsArrayInt(const casacore::String ¶mName) const
bool methodParamIsInt(const casacore::String ¶mName) const
QDomDocument & domDocument()
Returns the underlying QDomDocument.
QDomElement methodParam(const QString ¶mName, bool createIfAbsent=false) const
Helper method that returns the element for the method parameter with the given name, or a null element if it is not.
virtual Type type()
Return the type enum.
bool returnedSet() const
Returns whether or not a returned value was set.
bool fromXMLString(const casacore::String &value)
Sets the whole XML as a string, and returns whether the operation.
casacore::String methodParamType(const casacore::String ¶mName) const
Returns the type of the method parameter with the given name, or an empty string if there is none...
bool returnedIsArrayInt() const
casacore::Record returnedRecord() const
static void setElemChildText(QDomElement elem, const QString &name, const QString &value, bool createIfAbsent=false)
static bool qstringToBool(const QString &value)
Static //.
casacore::uInt methodParamUInt(const casacore::String ¶mName) const
void setTime()
Sets the time tag to the current time.
double returnedDouble() const
int methodParamInt(const casacore::String ¶mName) const
static QtDBusXML constructXML(const casacore::String &from="", const casacore::String &to="", const casacore::String &methodName="", bool methodIsAsync=false, const casacore::Record &methodParams=casacore::Record(), const casacore::Record &retValue=casacore::Record())
Static Methods //.
void setFrom(const casacore::String &value)
void setMethodIsAsync(bool value)
void setMethodParam(const casacore::String ¶mName, double value)
static casacore::Array< casacore::Int > elemToArrayInt(QDomElement value)
Converts between a QDomElement and casacore::Int casacore::Array for values.
ABSTRACT CLASSES Abstract class for colors Any implementation of color should be able to provide a hexadecimal form of the if a human readable name(i.e."black").In many places throughout the plotter
QString methodParamQString(const QString ¶mName) const
bool methodParamIsUInt(const casacore::String ¶mName) const
double methodParamDouble(const casacore::String ¶mName) const
casacore::String returnedString() const
casacore::Record methodParams() const
Gets/Sets all method parameter values as a Record.
void setMethodParam(const casacore::String ¶mName, const casacore::Record &value)
casacore::Array< int > returnedArrayInt() const
QDomDocument itsXML_
XML document.
bool returnedIsBool() const
Returns whether the returned value is the specified type or not.
QtDBusXML()
Non-Static Methods //.
void setReturnedValue(const casacore::String &value)
static casacore::Record elemToRecord(QDomElement value)
Converts between a QDomElement and casacore::Record for values.
casacore::Array< casacore::Bool > methodParamArrayBool(const casacore::String ¶mName) const
QString toXMLQString() const
bool returnedIsRecord() const
void setMethodParam(const casacore::String ¶mName, int value)
bool methodParamIsString(const casacore::String ¶mName) const
bool returnedIsUInt() const
void setTo(const casacore::String &value)
void setReturnedValueRec(const casacore::Record &retValue)
bool methodParamIsBool(const casacore::String ¶mName) const
Returns whether the method parameter with the given name is the specified type or not...
casacore::String from() const
Gets/Sets the from tag.
void setReturnedValue(bool value)
Sets the returned value to the given value (and associated type).
static QString elemChildText(QDomElement elem, const QString &name, bool createIfAbsent=false)
bool methodParamIsDouble(const casacore::String ¶mName) const
const Char * c_str() const
Get char array.
casacore::String methodName() const
Gets/Sets the method name and whether the method call is asynchronous or not (default is false)...
bool methodParamIsRecord(const casacore::String ¶mName) const
static QString qstringFromBool(bool value)
bool returnedIsString() const
void setMethodParam(const casacore::String ¶mName, const casacore::Array< bool > &value)
static QString elemChildText(QDomDocument doc, const QString &name, bool createIfAbsent=false)
Returns the text value of the child of the given element with the given tag name. ...
A hierarchical collection of named fields of various types.
casacore::String toXMLString() const
Returns the whole XML as a string.
void setMethodParam(const casacore::String ¶mName, const casacore::String &value)
QString qmethodName() const
void setMethodParam(const casacore::String ¶mName, casacore::uInt value)
casacore::String methodParamString(const casacore::String ¶mName) const
QString qreturnedType() const
static void elemFromRecord(QDomElement elem, const casacore::Record &value)
static void setElemText(QDomElement elem, const QString &text)
Sets the text value of the given element (if it is not null) to the given text.
bool returnedBool() const
Returns the returned value as the specified type.
bool methodParamIsArrayBool(const casacore::String ¶mName) const
QString returnedQString() const
casacore::uInt returnedUInt() const
String: the storage and methods of handling collections of characters.
static casacore::Array< casacore::Bool > elemToArrayBool(QDomElement value)
Converts between a QDomElement and casacore::Bool casacore::Array for values.
casacore::String time() const
Gets the value of the time tag, or an empty string if there is none.
void setMethodParam(const casacore::String ¶mName, const casacore::Array< int > &value)
void setMethodParams(const casacore::Record ¶meters)
casacore::String returnedType() const
Returns the type of the returned value, or empty string for none.
casacore::Record methodParamRecord(const casacore::String ¶mName) const
static QDomElement elemChild(QDomDocument doc, const QString &name, bool createIfAbsent=false)
Returns the child of the given element with the given tag name.
void setMethodParam(const casacore::String ¶mName, bool value)
Sets the parameter with the given name to the given value (and associated type).
casacore::Array< bool > returnedArrayBool() const
QtDBusXML & operator=(const QtDBusXML ©)
Copy operator.
static void setElemChildText(QDomDocument doc, const QString &name, const QString &value, bool createIfAbsent=false)
Sets the text value of the child of the given element with the given tag name to the given value...
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
bool returnedIsDouble() const
casacore::Array< casacore::Int > methodParamArrayInt(const casacore::String ¶mName) const
QString qmethodParamType(const QString ¶mName) const
bool methodParamBool(const casacore::String ¶mName) const
Returns the value of the method parameter with the given name as the specified type.