A GlishRecord may be converted to and from an AIPS++ Record object.
Vector<Complex> vis; ... // 1 GlishRecord record; // 2 record.add("hello", 3.0) ; // 3 record.add("world", vis); // 4 ... GlishArray tmp; // 5 if (!record.exists("world")) {...} // 6 tmp = record.get("world"); // 7 Vector<DComplex> vis2(tmp.nelements(); // 8 if (!tmp.get(vis2)) { ... } // 9 ... use vis2 ...
Logically make this object a copy of other. Physically avoids the copy for as long as possible (copy on write).
If other isn't a record, an exception (AipsError) is thrown.
Logically make this object a copy of other. Physically avoids the copy for as long as possible (copy on write).
Describe the layout of this object. By default it is not done recursively (thus not for subrecords).
Interconvert a GlishRecord and a Record. The converted object is zero'd first, i.e. any existing fields are wiped out before copying the fields.
These functions could in principle be global functions instead of member functions, but it seemed likely that users would look for this functionality here. But they can be moved if this seems best to others. The present implementation isn't particularly fast.
Logically make this object a copy of other. Physically avoids the copy for as long as possible (copy on write).
If other isn't a record, an exception (AipsError) is thrown.
Logically make this object a copy of other. Physically avoids the copy for as long as possible (copy on write).
Add field "name" with the supplied value to this GlishRecord. If one already exists, it is overwritten. These functions return a reference to the glish record itself so that you can write things like: rec.add("a", 1).add("b", 2);
This (overloaded) version was written so that automatic conversions of scalars and AIPS++ arrays will take place, e.g. record.add("pi", 3.14159).
Add field "name" with the supplied value to this GlishRecord. If one already exists, it is overwritten. These functions return a reference to the glish record itself so that you can write things like: rec.add("a", 1).add("b", 2);
Does a field with the given name exist?
Get the field with the given name from this record. Returns False is no field with that name exists.
Get the fieldNumber'th field from this record. fieldNumber ranges between 0 and nelements() - 1.
Get the name corresponding to the fieldNumber'th field in this record.
Is this record consistent?