casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | List of all members
casa::QtXmlRecord Class Reference

#include <QtXmlRecord.h>

Inheritance diagram for casa::QtXmlRecord:
casacore::Record casacore::RecordInterface casacore::NoticeSource

Public Member Functions

 QtXmlRecord ()
 
 ~QtXmlRecord ()
 
bool recordToElement (const casacore::Record *rec, QDomElement *parent, QDomDocument &doc)
 
casacore::Bool elementToRecord (QDomElement *ele, casacore::Record &rec, casacore::Bool useOptName=true)
 
casacore::Bool domToRecord (QDomDocument *doc, casacore::Record &rec)
 
casacore::Bool optsElemToRecord (QDomElement optsElem, casacore::Record &rec)
 
bool readDomFrom (QDomDocument &doc, QIODevice *device)
 
bool writeDomTo (QDomDocument *doc, QIODevice *device)
 
bool recordToDom (casacore::Record *rec, QDomDocument &doc)
 
- Public Member Functions inherited from casacore::Record
 Record ()
 Create a record with no fields. More...
 
 Record (RecordType type, CheckFieldFunction *=0, const void *checkArgument=0)
 Create a record with no fields. More...
 
 Record (const RecordDesc &description, RecordType type=Fixed, CheckFieldFunction *=0, const void *checkArgument=0)
 Create a record with the given description. More...
 
 Record (const Record &other)
 Create a copy of other using copy semantics. More...
 
 Record (const RecordInterface &other)
 Create a Record from another type of record using copy semantics. More...
 
Recordoperator= (const Record &other)
 Copy the data in the other record to this record. More...
 
virtual ~Record ()
 Release resources associated with this object. More...
 
virtual RecordInterfaceclone () const
 Make a copy of this object. More...
 
virtual void assign (const RecordInterface &that)
 Assign that RecordInterface object to this one. More...
 
virtual const Stringcomment (const RecordFieldId &) const
 Get the comment for this field. More...
 
virtual void setComment (const RecordFieldId &, const String &comment)
 Set the comment for this field. More...
 
const RecordDescdescription () const
 Describes the current structure of this Record. More...
 
virtual void restructure (const RecordDesc &newDescription, Bool recursive=True)
 Change the structure of this Record to contain the fields in newDescription. More...
 
Bool conform (const Record &other) const
 Returns True if this and other have the same RecordDesc, other than different names for the fields. More...
 
virtual uInt nfields () const
 How many fields does this structure have? A convenient synonym for description().nfields(). More...
 
virtual Int fieldNumber (const String &fieldName) const
 Get the field number from the field name. More...
 
virtual DataType type (Int whichField) const
 Get the data type of this field. More...
 
void removeField (const RecordFieldId &)
 Remove a field from the record. More...
 
void renameField (const String &newName, const RecordFieldId &)
 Rename the given field. More...
 
void defineRecord (const RecordFieldId &, const Record &value, RecordType type=Variable)
 Define a value for the given field containing a subrecord. More...
 
virtual void defineRecord (const RecordFieldId &, const RecordInterface &value, RecordType=Variable)
 
const RecordsubRecord (const RecordFieldId &) const
 Get the subrecord from the given field. More...
 
RecordrwSubRecord (const RecordFieldId &)
 
virtual const RecordInterfaceasRecord (const RecordFieldId &) const
 
virtual RecordInterfaceasrwRecord (const RecordFieldId &)
 
virtual ValueHolder asValueHolder (const RecordFieldId &) const
 Get or define the value as a ValueHolder. More...
 
virtual void defineFromValueHolder (const RecordFieldId &, const ValueHolder &)
 
void mergeField (const Record &other, const RecordFieldId &, DuplicatesFlag=ThrowOnDuplicates)
 Merge a field from another record into this record. More...
 
void merge (const Record &other, DuplicatesFlag=ThrowOnDuplicates)
 Merge all fields from the other record into this record. More...
 
void putRecord (AipsIO &os) const
 Write the Record to an output stream. More...
 
void getRecord (AipsIO &os)
 Read the Record from an input stream. More...
 
void putData (AipsIO &os) const
 Put the data of a record. More...
 
void getData (AipsIO &os, uInt version)
 Read the data of a record. More...
 
virtual void makeUnique ()
 Make a unique record representation (to do copy-on-write in RecordFieldPtr). More...
 
virtual void print (std::ostream &, Int maxNrValues=25, const String &indent="") const
 Print the contents of the record. More...
 
- Public Member Functions inherited from casacore::RecordInterface
 RecordInterface ()
 The default constructor creates an empty record with a variable structure. More...
 
 RecordInterface (RecordType type, CheckFieldFunction *funcPtr, const void *checkArgument)
 Create a record with no fields. More...
 
 RecordInterface (const RecordInterface &other)
 Copy constructor (copy semantics). More...
 
RecordInterfaceoperator= (const RecordInterface &other)
 Assignment (copy semantics). More...
 
virtual ~RecordInterface ()
 Destruct the record. More...
 
Bool isFixed () const
 Is the Record structure fixed (i.e. More...
 
uInt size () const
 
bool empty () const
 Is the record empty? More...
 
Int idToNumber (const RecordFieldId &) const
 Get the field number for the given field id. More...
 
Bool isDefined (const String &fieldName) const
 Test if a field name exists. More...
 
DataType dataType (const RecordFieldId &) const
 
String name (const RecordFieldId &) const
 Get the name of this field. More...
 
IPosition shape (const RecordFieldId &) const
 Get the actual shape of this field. More...
 
RecordDesc description () const
 Get the description of this record. More...
 
void define (const RecordFieldId &, Bool value)
 Define a value for the given field. More...
 
void define (const RecordFieldId &, uChar value)
 
void define (const RecordFieldId &, Short value)
 
void define (const RecordFieldId &, Int value)
 
void define (const RecordFieldId &, uInt value)
 
void define (const RecordFieldId &, Int64 value)
 
void define (const RecordFieldId &, Float value)
 
void define (const RecordFieldId &, Double value)
 
void define (const RecordFieldId &, const Complex &value)
 
void define (const RecordFieldId &, const DComplex &value)
 
void define (const RecordFieldId &, const Char *value)
 
void define (const RecordFieldId &, const String &value)
 
void define (const RecordFieldId &, const Array< Bool > &value, Bool FixedShape=False)
 
void define (const RecordFieldId &, const Array< uChar > &value, Bool FixedShape=False)
 
void define (const RecordFieldId &, const Array< Short > &value, Bool FixedShape=False)
 
void define (const RecordFieldId &, const Array< Int > &value, Bool FixedShape=False)
 
void define (const RecordFieldId &, const Array< uInt > &value, Bool FixedShape=False)
 
void define (const RecordFieldId &, const Array< Int64 > &value, Bool FixedShape=False)
 
void define (const RecordFieldId &, const Array< Float > &value, Bool FixedShape=False)
 
void define (const RecordFieldId &, const Array< Double > &value, Bool FixedShape=False)
 
void define (const RecordFieldId &, const Array< Complex > &value, Bool FixedShape=False)
 
void define (const RecordFieldId &, const Array< DComplex > &value, Bool FixedShape=False)
 
void define (const RecordFieldId &, const Array< String > &value, Bool FixedShape=False)
 
void get (const RecordFieldId &, Bool &value) const
 Get the value of the given field. More...
 
void get (const RecordFieldId &, uChar &value) const
 
void get (const RecordFieldId &, Short &value) const
 
void get (const RecordFieldId &, Int &value) const
 
void get (const RecordFieldId &, uInt &value) const
 
void get (const RecordFieldId &, Int64 &value) const
 
void get (const RecordFieldId &, Float &value) const
 
void get (const RecordFieldId &, Double &value) const
 
void get (const RecordFieldId &, Complex &value) const
 
void get (const RecordFieldId &, DComplex &value) const
 
void get (const RecordFieldId &, String &value) const
 
void get (const RecordFieldId &, Array< Bool > &value) const
 
void get (const RecordFieldId &, Array< uChar > &value) const
 
void get (const RecordFieldId &, Array< Short > &value) const
 
void get (const RecordFieldId &, Array< Int > &value) const
 
void get (const RecordFieldId &, Array< uInt > &value) const
 
void get (const RecordFieldId &, Array< Int64 > &value) const
 
void get (const RecordFieldId &, Array< Float > &value) const
 
void get (const RecordFieldId &, Array< Double > &value) const
 
void get (const RecordFieldId &, Array< Complex > &value) const
 
void get (const RecordFieldId &, Array< DComplex > &value) const
 
void get (const RecordFieldId &, Array< String > &value) const
 
Bool asBool (const RecordFieldId &) const
 The following functions get the value based on field name or number. More...
 
uChar asuChar (const RecordFieldId &) const
 
Short asShort (const RecordFieldId &) const
 
Int asInt (const RecordFieldId &) const
 
uInt asuInt (const RecordFieldId &) const
 
Int64 asInt64 (const RecordFieldId &) const
 
Float asFloat (const RecordFieldId &) const
 
Double asDouble (const RecordFieldId &) const
 
Complex asComplex (const RecordFieldId &) const
 
DComplex asDComplex (const RecordFieldId &) const
 
const StringasString (const RecordFieldId &) const
 
const Array< Bool > & asArrayBool (const RecordFieldId &) const
 
const Array< uChar > & asArrayuChar (const RecordFieldId &) const
 
const Array< Short > & asArrayShort (const RecordFieldId &) const
 
const Array< Int > & asArrayInt (const RecordFieldId &) const
 
const Array< uInt > & asArrayuInt (const RecordFieldId &) const
 
const Array< Int64 > & asArrayInt64 (const RecordFieldId &) const
 
const Array< Float > & asArrayFloat (const RecordFieldId &) const
 
const Array< Double > & asArrayDouble (const RecordFieldId &) const
 
const Array< Complex > & asArrayComplex (const RecordFieldId &) const
 
const Array< DComplex > & asArrayDComplex (const RecordFieldId &) const
 
const Array< String > & asArrayString (const RecordFieldId &) const
 
Array< BooltoArrayBool (const RecordFieldId &) const
 Get an array while promoting the data as needed. More...
 
Array< uChartoArrayuChar (const RecordFieldId &) const
 
Array< ShorttoArrayShort (const RecordFieldId &) const
 
Array< InttoArrayInt (const RecordFieldId &) const
 
Array< uInttoArrayuInt (const RecordFieldId &) const
 
Array< Int64toArrayInt64 (const RecordFieldId &) const
 
Array< FloattoArrayFloat (const RecordFieldId &) const
 
Array< DoubletoArrayDouble (const RecordFieldId &) const
 
Array< Complex > toArrayComplex (const RecordFieldId &) const
 
Array< DComplex > toArrayDComplex (const RecordFieldId &) const
 
Array< StringtoArrayString (const RecordFieldId &) const
 
void toArray (const RecordFieldId &id, Array< Bool > &array) const
 
void toArray (const RecordFieldId &id, Array< uChar > &array) const
 
void toArray (const RecordFieldId &id, Array< Short > &array) const
 
void toArray (const RecordFieldId &id, Array< Int > &array) const
 
void toArray (const RecordFieldId &id, Array< uInt > &array) const
 
void toArray (const RecordFieldId &id, Array< Int64 > &array) const
 
void toArray (const RecordFieldId &id, Array< Float > &array) const
 
void toArray (const RecordFieldId &id, Array< Double > &array) const
 
void toArray (const RecordFieldId &id, Array< Complex > &array) const
 
void toArray (const RecordFieldId &id, Array< DComplex > &array) const
 
void toArray (const RecordFieldId &id, Array< String > &array) const
 
Float asfloat (const RecordFieldId &) const
 Get value based on field name or number. More...
 
Double asdouble (const RecordFieldId &) const
 
const Array< Float > & asArrayfloat (const RecordFieldId &) const
 
const Array< Double > & asArraydouble (const RecordFieldId &) const
 
- Public Member Functions inherited from casacore::NoticeSource
 NoticeSource ()
 
virtual ~NoticeSource ()
 
void notify (const Notice &note)
 Sends the note to all NoticeTargets in the target list. More...
 

Static Public Member Functions

static QString domToString (const QDomElement &elt)
 
static QDomDocument stringToDom (const QString &xml)
 

Public Attributes

const QString rootName
 

Private Member Functions

void formatXml (QDomDocument &doc)
 

Additional Inherited Members

- Public Types inherited from casacore::RecordInterface
enum  RecordType {
  Fixed,
  Variable
}
 Define the flag telling if a Record has a fixed or variable structure. More...
 
enum  DuplicatesFlag {
  RenameDuplicates,
  SkipDuplicates,
  OverwriteDuplicates,
  ThrowOnDuplicates
}
 Define the Duplicates flag for the function merge in the various record classes. More...
 
typedef Bool CheckFieldFunction (const String &fieldName, DataType dataType, const void *extraArgument, String &message)
 Define the signature of the add callback function. More...
 
- Protected Member Functions inherited from casacore::Record
virtual void * get_pointer (Int whichField, DataType type) const
 Used by the RecordField classes to attach in a type-safe way to the correct field. More...
 
virtual void * get_pointer (Int whichField, DataType type, const String &recordType) const
 
const RecordRepref () const
 Return a const reference to the underlying RecordRep. More...
 
RecordReprwRef ()
 Return a non-const reference to the underlying RecordRep. More...
 
virtual void addDataField (const String &name, DataType type, const IPosition &shape, Bool fixedShape, const void *value)
 Add a field to the record. More...
 
virtual void defineDataField (Int whichField, DataType type, const void *value)
 Define a value in the given field. More...
 
- Protected Member Functions inherited from casacore::RecordInterface
void throwIfFixed () const
 Check if the Record has a non-fixed structure. More...
 
void checkName (const String &fieldName, DataType type) const
 Check if the new field name is correct. More...
 
RecordTyperecordType ()
 Give access to the RecordType flag (write-access is needed when a record is read back). More...
 
RecordType recordType () const
 
Int newIdToNumber (const RecordFieldId &) const
 Get the field number for the given field id. More...
 
void defineField (const RecordFieldId &, DataType type, const void *value)
 Add a scalar field with the given type and value. More...
 
void defineField (const RecordFieldId &, DataType type, const IPosition &shape, Bool fixedShape, const void *value)
 Add an array field with the given type, shape and value. More...
 

Detailed Description

Definition at line 48 of file QtXmlRecord.h.

Constructor & Destructor Documentation

casa::QtXmlRecord::QtXmlRecord ( )
casa::QtXmlRecord::~QtXmlRecord ( )

Member Function Documentation

casacore::Bool casa::QtXmlRecord::domToRecord ( QDomDocument *  doc,
casacore::Record rec 
)
static QString casa::QtXmlRecord::domToString ( const QDomElement &  elt)
static
casacore::Bool casa::QtXmlRecord::elementToRecord ( QDomElement *  ele,
casacore::Record rec,
casacore::Bool  useOptName = true 
)
void casa::QtXmlRecord::formatXml ( QDomDocument &  doc)
private
casacore::Bool casa::QtXmlRecord::optsElemToRecord ( QDomElement  optsElem,
casacore::Record rec 
)
bool casa::QtXmlRecord::readDomFrom ( QDomDocument &  doc,
QIODevice *  device 
)
bool casa::QtXmlRecord::recordToDom ( casacore::Record rec,
QDomDocument &  doc 
)
bool casa::QtXmlRecord::recordToElement ( const casacore::Record rec,
QDomElement *  parent,
QDomDocument &  doc 
)
static QDomDocument casa::QtXmlRecord::stringToDom ( const QString &  xml)
static
bool casa::QtXmlRecord::writeDomTo ( QDomDocument *  doc,
QIODevice *  device 
)

Member Data Documentation

const QString casa::QtXmlRecord::rootName

Definition at line 61 of file QtXmlRecord.h.


The documentation for this class was generated from the following file: