casacore
Loading...
Searching...
No Matches
Containers_module

More...

Topics

 Containers_module_internal_classes
 Internal Containers_module classes and functions.

Classes

class  casacore::ArrayInitPolicy
  More...
struct  casacore::Allocator_private::AllocSpec< T >
 Allocator specifier. More...
struct  casacore::AllocSpec< T >
 Allocator specifier. More...
class  casacore::BlockTrace
  More...
class  casacore::Block< T >
 simple 1-D array More...
class  casacore::PtrBlock< T >
 A drop-in replacement for Block<T*>. More...
struct  casacore::BlockIO_global_functions_BlockIO
  More...
class  casacore::IterError
  More...
class  casacore::IterBoundaryError
 Iteration Boundary error class. More...
class  casacore::IterInitError
 Iteration initialization error. More...
class  casacore::InvalidIterError
 Invalide iteration error class. More...
class  casacore::ObjectStack< T >
  More...
class  casacore::RecordDesc
  More...
class  casacore::RORecordFieldPtr< T >
 Read-Only access to an individual field from a Record. More...
class  casacore::RecordFieldId
  More...
class  casacore::ValueHolder
  More...

Enumerations

enum  casacore::RecordType {
  casacore::Fixed ,
  casacore::Variable
}
  More...

Functions

 casacore::Record ()
 
 casacore::RecordFieldPtr ()
 

Detailed Description

Non-mathematical Containers

See below for an overview of the classes in this module.

Review Status

Reviewed By:
UNKNOWN
Date Reviewed:
before2004/08/25

Synopsis

This module provides non-mathematical containers. These containers are the prototypical computer science types of containers – records and simple arrays. These classes are useful for all of the various types of low level data management. In general, these classes will have familiar semantics and an unsurprising interface. Note that Casacore used to have classes such as Map and List, but they became obsolete when the Standard C++ Library was introduced. Therefore these classes have been removed.

Most of the important classes in this module also have IO shift operators, e.g. for writing out a Block (simple array). These operators typically allow the container (and the objects it contains) to be written out to both AipsIO and the standard ostream.

The class Block has the option to trace (de)allocations for Blocks with a size above a given threshold. It uses class MemoryTrace to log the trace messages. Unlike MemoryTrace, it also works on non-Linux systems. Since class Array uses Block underneath, it makes it possible to trace Array usage.

Enumeration Type Documentation

◆ RecordType

Abstract base class for Record classes

Intended use:

Public interface

Review Status

Reviewed By:
Mark Wieringa
Date Reviewed:
1996/04/15
Test programs:
tRecord

Etymology

``Record'' is a widely used term in both programming languages and data structures to denote an imhogeneous set of fields. An alternative would have been to name it structure, which would have perhaps been a clearer name for C++ programmers.
RecordInterface denotes that this class defines the common interface to possible Record classes.

Synopsis

A Record is an heterogeneous, hierarchical, collection of named fields. The fields may be of scalar type, array type, a Table or a Record. This latter feature is what makes the Record a (potentially) hierarchical type.

RecordInterface is the abstract base class for various Record classes. At the moment three Record classes exist:

Presently, the scalar types are chosen to be compatible with the native types of the Table system, viz: Bool, uChar, Short, Int, uInt, Int64, Float, Double, Complex, DComplex, String. Arrays of all these types are also available. It is fairly straightforward to extend this set if necessary, although it will result in more template instantiations with the current implementation.

Each field has an integral index, which ranges between 0 and nfields() - 1. The values of a field can be manipulated in two ways:

  1. Through the get and put functions in this class. They are easy to use and support type promotion. However, they are a bit less efficient than the second way.
  2. Through the class RecordFieldPtr. This is a bit less convenient. However, it is more efficient if the same field is accessed multiple times.

The structure of a record can be fixed or variable. If fixed, it is not possible to change the structure once the record has been instantiated. If variable, the record can be restructured or fields can be added/removed.
When a field gets added, it is possible to check if its name and type are valid by means of the CheckFunction callback. This is for instance used by the table system to assure that keywords and columns in a table do not have the same name.

Arrays in a record description can be fixed or variable shaped. If fixed shaped, only arrays with that shape can be stored in that field in the record. If variable shaped, any array can be stored.
However, note there is a difference between assign and define. Assign invokes the array assignment operator which checks for conformance. Thus even for variable shaped arrays, the new array must conform the exisitng one when using assign. Define simply replaces the array, thus for variable shaped arrays ay array shape will do.

RecordFieldPtr objects attached to a Record have to be notified when the Record is deleted or changed. The RecordInterface class provides the hooks for this via the Notice system. It is derived from NoticeSource. The class RecordNotice is for the messages.

Motivation

This common base class provides a common interface to the various Record classes. Furthermore it is needed for the class RecordFieldPtr. Finally it provides the hooks for the notification in case the record structure changes.

To Do

  • A record reference class, which contains some fields from another record, would likely be useful. This would be analagous to a subarray sliced from an existing array.

*/ class RecordInterface { public: /** Define the flag telling if a Record has a fixed or variable structure.

Enumerator
Fixed 

Record has a fixed structure; that is, no fields can be added or removed once the Record is created.

Variable 

Record has a variable structure; after Record creation fields can be added or removed at will.

Definition at line 145 of file RecordInterface.h.

Function Documentation

◆ Record()

casacore::Record ( )

A hierarchical collection of named fields of various types

Intended use:

Public interface

Review Status

Reviewed By:
Mark Wieringa
Date Reviewed:
1996/04/15
Test programs:
tRecord

Prerequisite

Etymology

``Record'' is a widely used term in both programming languages and data structures to denote an imhogeneous set of fields. An alternative would have been to name it structure, which would have perhaps been a clearer name for C++ programmers.

Synopsis

Class RecordInterface decribes the fundamental properties of records.
The Record class is a particular type of a record class. The fields in Record may be of scalar type, array type, or a Record. The types are chosen to be compatible with the native types of the Table system, viz: Bool, uChar, Short, Int, uInt, float, double, Complex, DComplex, String. Arrays of all these types are also available. Note that a Record is not a space-efficient way of storing small objects.

The structure of a Record is defined by the RecordDesc class. The structure of the Record can be defined at construction time. It can thereafter be restructured. This has the effect, however, that any existing RecordFieldPtr objects become invalid.
It is possible to add or remove fields once a Record is constructed. However, this is not possible when the Record is constructed with a fixed structure (i.e. with the fixedStructure flag set).

A Record is a hierarchical structure, because it can have fields containing Record's (as layed out in the RecordDesc). A subrecord has a variable structure, when its RecordDesc is empty (i.e. contains no fields). It is fixed when its RecordDesc contains fields.

A Record may be assigned to another only if they conform; that is if their fields have the identical type in the identical order. The field names do not need to be identical however, only the types. That is, the structure needs to be identical, but not the labels. Note that field order is significant, [ifield(type=Int),ffield(type=float)] is not the same as [ffield(type=float),ifield(type=Int)]
Conformance is checked recursively for fixed subrecords. That is, a variable structured subrecord is not checked, because any record can be assigned to it. A fixed structured subrecord has to conform the corresponding subrecord in the source.

Record uses copy-on-write semantics. This means that when a Record is copied, only the pointer to the underlying RecordRep object is copied. Only when the Record gets changed (i.e. when a non-const Record member function is called), the RecordRep object is copied. This results in a cheap copy behaviour.

Example

Suppose we wanted to create a records that describe the favorite example of the OO world - an employee:

RecordDesc employeeDesc;
employeeDesc.addField ("name", TpString);
employeeDesc.addField ("salary", TpDouble);
uInt addField(const String &fieldName, DataType dataType)
Add scalar, array, sub-record, or table field.
Definition RecordDesc.h:321

The above creates the description (structure) for some record objects.

Record employeeA(employeeDesc);
Record employeeB(employeeDesc, False);
const Bool False
Definition aipstype.h:42

And these two lines create Record objects which share this common structure. The first Record has a fixed structure, the 2nd variable.

RecordFieldPtr<String> nameA(employeeA, 0);
RecordFieldPtr<String> nameB(employeeB, 0);
RecordFieldPtr<double> salaryA(employeeA, 1);
RecordFieldPtr<double> salaryB(employeeB, "salary");

This shows how we can get access to the individual fields. The fields are fundamentally identified by number, but the number can be looked up through the use of the fieldNumber member function.

nameA.define ("Tim");
nameB.define ("Brian");
salaryA.define (1.0e+8);
salaryB.define (1.0 / *salaryA);

Once obtained, the fields are readily manipulated, as shown above. Note that the field values are obtained through the dereference (*) operator. This is to identify that the field objects are pointers to the values in the underlying Record; that is

salaryA = salaryB;
*salaryA = *salaryB;

Do very different things; the first line is a pointer copy; salaryA and salaryB now point to the same field in salaryB. The second line is a value copy.

Whole records can be copied as long as their structures are compatible, so that employeeA = employeeB is a legal statement. However, if the structure is changed, assignment is no longer possible, and all of the field pointers are invalidated:

employeeB.define ("age", (Int)40);
employeeA = employeeB; // exception - no longer conformant
int Int
Definition aipstype.h:48

Motivation

Collections of data with different types are frequently needed. Record makes it possible to hold such data in a flexible way.

To Do

  • A record reference class, which contains some fields from another record, would likely be useful. This would be analagous to a subarray sliced from an existing array.

*/ class Record : public RecordInterface { friend class RecordRep;

public: /** Create a record with no fields. The record has a variable structure.

Referenced by casacore::MSMetaData::_createScanRecords(), casacore::MSMetaData::_createSubScanRecords(), casacore::MSMetaData::_createTimeStampRecords(), casacore::ImageInfo::_setRestoringBeam(), casacore::ColumnsIndex::accessKey(), casacore::ColumnsIndexArray::accessKey(), casacore::MSTableIndex::accessKey(), casacore::ColumnsIndex::accessLowerKey(), casacore::ColumnsIndexArray::accessLowerKey(), casacore::ColumnsIndex::accessUpperKey(), casacore::ColumnsIndexArray::accessUpperKey(), casacore::DataManInfo::adaptNames(), casacore::WCRegion::addAxisDesc(), casacore::Table::addColumn(), casacore::TableParseProject::addColumnDesc(), casacore::BaseTable::addColumns(), casacore::TableProxy::addColumns(), casacore::RecordRep::addField(), casacore::TiledDataStMan::addHypercube(), casacore::TiledDataStManAccessor::addHypercube(), casacore::MSFlagger::addStats(), casacore::DataManInfo::adjustDesc(), casacore::DataManInfo::adjustStMan(), casacore::DataManInfo::adjustTSM(), casacore::MeasuresProxy::alltyp(), casacore::AntennaPairStMan::AntennaPairStMan(), casacore::ValueHolder::asRecord(), casacore::ValueHolderRep::asRecord(), casacore::FunctionalProxy::asrecord(), casacore::SDAntennaHandler::attach(), casacore::SDDataDescHandler::attach(), casacore::SDFeedHandler::attach(), casacore::SDFieldHandler::attach(), casacore::SDFITSHandler::attach(), casacore::SDHistoryHandler::attach(), casacore::SDMainHandler::attach(), casacore::SDObservationHandler::attach(), casacore::SDPointingHandler::attach(), casacore::SDPolarizationHandler::attach(), casacore::SDSourceHandler::attach(), casacore::SDSpWindowHandler::attach(), casacore::SDSysCalHandler::attach(), casacore::SDWeatherHandler::attach(), casacore::TableExprNode::attributes(), casacore::TableExprNodeRep::attributes(), casacore::WCRegion::axisNr(), casacore::ImageInfo::beamToRecord(), casacore::SetupNewTable::bindCreate(), casacore::SetupNewTableRep::bindCreate(), casacore::BitFlagsEngine< StoredType >::BitFlagsEngine(), casacore::RegionManager::box(), casacore::RegionManager::box(), casacore::TableProxy::calcValues(), casacore::CASATask::CASATask(), casacore::CASATask::CASATask(), casacore::TiledStMan::checkAddHypercube(), casacore::TiledStMan::checkCoordinates(), casacore::TiledStMan::checkValues(), casacore::MSFlagger::clearDataBuffer(), casacore::TableCopy::cloneColumn(), casacore::TableCopy::cloneColumnTyped(), casacore::CompressComplex::CompressComplex(), casacore::CompressComplexSD::CompressComplexSD(), casacore::CompressFloat::CompressFloat(), conform(), casacore::python::casa_record_to_python::convert(), casacore::TSMCube::coordinateSize(), casacore::ImageProxy::coordSys(), casacore::TableProxy::copy(), casacore::ColumnsIndex::copyKey(), casacore::ColumnsIndex::copyKeyField(), casacore::ColumnsIndex::copyKeyField(), casacore::MIRIADImage::crackHeader(), casacore::EclecticFunctionFactory< T >::create(), casacore::FunctionFactory< T >::create(), casacore::SpecificFunctionFactory< T, F >::create(), casacore::TableParseQuery::createSubTable(), casacore::TableUtil::createSubTable(), casacore::TableParseQuery::createTable(), casacore::TableUtil::createTable(), casacore::FITSMultiTable::currentRow(), casacore::FITSTable::currentRow(), casacore::FITSTabular::currentRow(), casacore::FITSTimedTable::currentRow(), casacore::FITSTimedTable::currentRow(), casacore::PGPlotter::curs(), casacore::PGPlotterInterface::curs(), casacore::PGPlotterNull::curs(), casacore::FittingProxy::cxfunctional(), casacore::FittingProxy::cxlinear(), casacore::BaseTable::dataManagerInfo(), casacore::ColumnSet::dataManagerInfo(), casacore::ConcatTable::dataManagerInfo(), casacore::DataManager::dataManagerInfo(), casacore::MemoryTable::dataManagerInfo(), casacore::NullTable::dataManagerInfo(), casacore::PlainTable::dataManagerInfo(), casacore::RefTable::dataManagerInfo(), casacore::Table::dataManagerInfo(), casacore::Adios2StMan::dataManagerSpec(), casacore::Adios2StMan::impl::dataManagerSpec(), casacore::AntennaPairStMan::dataManagerSpec(), casacore::BitFlagsEngine< StoredType >::dataManagerSpec(), casacore::CompressComplex::dataManagerSpec(), casacore::CompressFloat::dataManagerSpec(), casacore::DataManager::dataManagerSpec(), casacore::DerivedMSCal::dataManagerSpec(), casacore::ForwardColumnEngine::dataManagerSpec(), casacore::ForwardColumnIndexedRowEngine::dataManagerSpec(), casacore::ISMBase::dataManagerSpec(), casacore::MappedArrayEngine< VirtualType, StoredType >::dataManagerSpec(), casacore::RetypedArrayEngine< VirtualType, StoredType >::dataManagerSpec(), casacore::ScaledArrayEngine< VirtualType, StoredType >::dataManagerSpec(), casacore::ScaledComplexData< VirtualType, StoredType >::dataManagerSpec(), casacore::SiscoStMan::dataManagerSpec(), casacore::SSMBase::dataManagerSpec(), casacore::StokesIStMan::dataManagerSpec(), casacore::TiledShapeStMan::dataManagerSpec(), casacore::TiledStMan::dataManagerSpec(), casacore::UvwStMan::dataManagerSpec(), casacore::VirtualTaQLColumn::dataManagerSpec(), dyscostman::DyscoStMan::dataManagerSpec(), casacore::BaseTable::deepCopy(), casacore::ConcatTable::deepCopy(), casacore::MemoryTable::deepCopy(), casacore::NullTable::deepCopy(), casacore::RefTable::deepCopy(), casacore::Table::deepCopy(), casacore::Table::deepCopy(), casacore::Table::deepCopy(), casacore::MSSelection::definedAndSet(), defineRecord(), casacore::DerivedMSCal::DerivedMSCal(), casacore::MSFlagger::diffDataBuffer(), casacore::MeasuresProxy::dirshow(), casacore::FITSMultiTable::displayFormats(), casacore::FITSTable::displayFormats(), casacore::FITSTabular::displayFormats(), casacore::FITSTimedTable::displayFormats(), casacore::FITSTabular::displayFormatsFromHDU(), casacore::TableParseProject::dminfo(), casacore::TableCopy::doCloneColumn(), casacore::RegionManager::doConcatenation(), casacore::MeasuresProxy::doframe(), casacore::MeasuresProxy::doptofreq(), casacore::MeasuresProxy::doptorv(), casacore::HDF5Record::doReadRecord(), casacore::ImageProxy::doRegrid(), dyscostman::DyscoStMan::DyscoStMan(), casacore::MeasuresProxy::expand(), casacore::RecordGram::expr2ArrayBool(), casacore::RecordGram::expr2ArrayComplex(), casacore::RecordGram::expr2ArrayDate(), casacore::RecordGram::expr2ArrayDouble(), casacore::RecordGram::expr2ArrayInt(), casacore::RecordGram::expr2ArrayString(), casacore::RecordGram::expr2Bool(), casacore::RecordGram::expr2Complex(), casacore::RecordGram::expr2Date(), casacore::RecordGram::expr2Double(), casacore::RecordGram::expr2Int(), casacore::RecordGram::expr2String(), casacore::TSMCube::extend(), casacore::TSMCubeBuff::extend(), casacore::TSMCubeMMap::extend(), casacore::TSMCube::extendCoordinates(), casacore::TiledDataStMan::extendHypercube(), casacore::TiledDataStManAccessor::extendHypercube(), casacore::FunctionalProxy::fhd2rec(), casacore::FunctionalProxy::fhdc2rec(), casacore::SDAntennaHandler::fill(), casacore::SDDataDescHandler::fill(), casacore::SDFeedHandler::fill(), casacore::SDFieldHandler::fill(), casacore::SDFITSHandler::fill(), casacore::SDHistoryHandler::fill(), casacore::SDMainHandler::fill(), casacore::SDObservationHandler::fill(), casacore::SDPointingHandler::fill(), casacore::SDPolarizationHandler::fill(), casacore::SDSourceHandler::fill(), casacore::SDSpWindowHandler::fill(), casacore::SDSysCalHandler::fill(), casacore::SDWeatherHandler::fill(), casacore::DataManInfo::finalizeMerge(), casacore::FITSGroupWriter::FITSGroupWriter(), casacore::FITSTableWriter::FITSTableWriter(), casacore::ForwardColumnEngine::ForwardColumnEngine(), casacore::ForwardColumnIndexedRowEngine::ForwardColumnIndexedRowEngine(), casacore::GaussianBeam::fromRecord(), casacore::ImageBeamSet::fromRecord(), casacore::ImageRegion::fromRecord(), casacore::StatisticsAlgorithmFactory< AccumType, DataIterator, MaskIterator, WeightsIterator >::fromRecord(), casacore::TableRecord::fromRecord(), casacore::ValueHolder::fromRecord(), casacore::ValueHolderRep::fromRecord(), casacore::MSSelection::fromSelectionItem(), casacore::FittingProxy::functional(), casacore::FunctionalProxy::FunctionalProxy(), casacore::SerialHelper::get(), casacore::TableRowProxy::get(), getArray(), getArrayVal(), casacore::UDFBase::getAttributes(), casacore::ImageProxy::getAttrRow(), casacore::WCRegion::getAxesDesc(), casacore::WCRegion::getAxisDesc(), casacore::TableProxy::getCalcResult(), casacore::TableProxy::getColumnDescription(), casacore::TiledStMan::getCubeIndex(), casacore::MSSelector::getData(), casacore::MSFlagger::getDataBuffer(), casacore::TableProxy::getDataManagerInfo(), casacore::ImageAttrGroup::getDataRow(), casacore::ImageAttrGroupCasa::getDataRow(), casacore::ImageAttrGroupHDF5::getDataRow(), casacore::MIRIADImage::getImageAttributes(), casacore::TableProxy::getKeyValues(), casacore::TableProxy::getKeywordSet(), casacore::MeasuresProxy::getMeasureType(), casacore::CASATask::getParams(), casacore::BitFlagsEngine< StoredType >::getProperties(), casacore::DataManager::getProperties(), casacore::ISMBase::getProperties(), casacore::RODataManAccessor::getProperties(), casacore::SSMBase::getProperties(), casacore::TableProxy::getProperties(), casacore::TiledStMan::getProperties(), casacore::TaQLNodeHRValue::getRecord(), casacore::ColumnsIndex::getRowNumber(), casacore::ColumnsIndexArray::getRowNumber(), casacore::TableIndexProxy::getRowNumber(), casacore::ColumnsIndex::getRowNumbers(), casacore::ColumnsIndex::getRowNumbers(), casacore::ColumnsIndexArray::getRowNumbers(), casacore::ColumnsIndexArray::getRowNumbers(), casacore::TableIndexProxy::getRowNumbers(), casacore::TableIndexProxy::getRowNumbersRange(), casacore::MSSummary::getScanSummary(), casacore::MSSummary::getSpectralWindowInfo(), casacore::FittingProxy::getstate(), casacore::MSMetaData::getSummary(), casacore::TableProxy::getTableDesc(), casacore::TableProxy::getTableDescription(), casacore::ROTiledStManAccessor::getValueRecord(), casacore::TableProxy::getVarColumn(), casacore::TableParseProject::handleAddCol(), casacore::TableParseQuery::handleAddCol(), casacore::TableParseProject::handleColSpec(), casacore::TableParseQuery::handleColSpec(), casacore::TableParseQuery::handleCreTab(), casacore::TableParseQuery::handleGiving(), casacore::TaQLNodeHandler::handleMultiRecFld(), casacore::ImageProxy::imageInfo(), casacore::ImageProxy::ImageProxy(), casacore::ImageProxy::ImageProxy(), casacore::SDAntennaHandler::initAll(), casacore::SDFeedHandler::initAll(), casacore::SDFieldHandler::initAll(), casacore::SDFITSHandler::initAll(), casacore::SDHistoryHandler::initAll(), casacore::SDMainHandler::initAll(), casacore::SDObservationHandler::initAll(), casacore::SDPointingHandler::initAll(), casacore::SDPolarizationHandler::initAll(), casacore::SDSourceHandler::initAll(), casacore::SDSpWindowHandler::initAll(), casacore::SDSysCalHandler::initAll(), casacore::SDWeatherHandler::initAll(), casacore::TableParseProject::initDescriptions(), casacore::TableParseQuery::initDescriptions(), casacore::SDAntennaHandler::initRow(), casacore::SDFeedHandler::initRow(), casacore::SDFieldHandler::initRow(), casacore::SDFITSHandler::initRow(), casacore::SDHistoryHandler::initRow(), casacore::SDMainHandler::initRow(), casacore::SDObservationHandler::initRow(), casacore::SDPointingHandler::initRow(), casacore::SDPolarizationHandler::initRow(), casacore::SDSourceHandler::initRow(), casacore::SDSpWindowHandler::initRow(), casacore::SDSysCalHandler::initRow(), casacore::SDWeatherHandler::initRow(), casacore::WCRegion::isAxisDescEqual(), casacore::ISMBase::ISMBase(), casacore::MeasuresProxy::line(), casacore::FittingProxy::linear(), casacore::MSSummary::list(), casacore::MSSummary::listField(), casacore::MSSummary::listMain(), casacore::MSSummary::listWhat(), casacore::FunctionMarshallable::loadFuncType(), casacore::TableProxy::lockOptions(), casacore::MeasEngine< M >::makeAttributes(), casacore::WCRegion::makeAxesDesc(), casacore::WCRegion::makeAxisDesc(), casacore::ImageProxy::makeCoordinateSystem(), casacore::TableCopy::makeEmptyTable(), casacore::TableProxy::makeHC(), casacore::TiledStMan::makeHypercube(), casacore::ImageProxy::makeImage(), casacore::TableProxy::makeLockOptions(), casacore::MeasuresProxy::makeMeasure(), casacore::Adios2StMan::impl::makeObject(), casacore::Adios2StMan::makeObject(), casacore::AntennaPairStMan::makeObject(), casacore::BitFlagsEngine< StoredType >::makeObject(), casacore::CompressComplex::makeObject(), casacore::CompressComplexSD::makeObject(), casacore::CompressFloat::makeObject(), casacore::DerivedMSCal::makeObject(), casacore::ForwardColumnEngine::makeObject(), casacore::ForwardColumnIndexedRowEngine::makeObject(), casacore::ISMBase::makeObject(), casacore::MappedArrayEngine< VirtualType, StoredType >::makeObject(), casacore::MSMBase::makeObject(), casacore::RetypedArrayEngine< VirtualType, StoredType >::makeObject(), casacore::ScaledArrayEngine< VirtualType, StoredType >::makeObject(), casacore::ScaledComplexData< VirtualType, StoredType >::makeObject(), casacore::SiscoStMan::makeObject(), casacore::SSMBase::makeObject(), casacore::StManAipsIO::makeObject(), casacore::StokesIStMan::makeObject(), casacore::TiledCellStMan::makeObject(), casacore::TiledColumnStMan::makeObject(), casacore::TiledDataStMan::makeObject(), casacore::TiledShapeStMan::makeObject(), casacore::UvwStMan::makeObject(), casacore::VirtualTaQLColumn::makeObject(), dyscostman::DyscoStMan::makeObject(), casacore::python::casa_record_to_python::makeobject(), casacore::python::casa_record_from_python::makeRecord(), casacore::ImageProxy::makeStatistics(), casacore::TableProxy::makeTableDesc(), casacore::TiledStMan::makeTSMCube(), casacore::DataManInfo::makeUniqueNames(), casacore::MappedArrayEngine< VirtualType, StoredType >::MappedArrayEngine(), casacore::MarshallableChebyshev< T >::MarshallableChebyshev(), casacore::MarshButterworthBandpass< T >::MarshButterworthBandpass(), casacore::TSMCube::matches(), casacore::MeasuresProxy::measure(), merge(), casacore::DataManInfo::mergeColumns(), mergeField(), casacore::DataManInfo::mergeInfo(), casacore::MeasuresProxy::mh2rec(), casacore::ImageProxy::miscInfo(), casacore::MSMBase::MSMBase(), casacore::MSSelection::MSSelection(), casacore::MeasurementSet::msseltoindex(), mssSelectedIndices(), casacore::WCRegion::ndim(), casacore::FITSMultiTable::nulls(), casacore::FITSTable::nulls(), casacore::FITSTabular::nulls(), casacore::FITSTimedTable::nulls(), casacore::FITSTabular::nullsFromHDU(), casacore::MeasuresProxy::observatory(), operator+(), operator<<(), operator=(), operator>>(), casacore::RFReader::options(), casacore::RFReaderWriter::optionsWidgetForType(), casacore::MeasuresProxy::posangle(), casacore::JsonOut::put(), casacore::TableRowProxy::put(), casacore::MSSelector::putData(), casacore::TableProxy::putKeyValues(), casacore::TableProxy::putKeywordSet(), casacore::TableProxy::putTableInfo(), casacore::TableProxy::putVarColumn(), casacore::MSRange::range(), casacore::MSRange::range(), casacore::MSRange::range(), casacore::AipsIOReaderWriter::read(), casacore::RFReader::read(), casacore::RFReader::readFile(), casacore::RegionManager::readImageFile(), casacore::HDF5Record::readRecord(), casacore::FunctionalProxy::rec2fhd(), casacore::FunctionalProxy::rec2fhdc(), casacore::MeasuresProxy::rec2mh(), Record(), casacore::TableProxy::record2Array(), casacore::TableProxy::recordColumnDesc(), casacore::TableProxy::recordHCDesc(), casacore::ImageProxy::regrid(), casacore::DataManInfo::removeDminfoColumns(), casacore::SDFITSHandler::requiredTableDesc(), casacore::SDAntennaHandler::resetRow(), casacore::SDDataDescHandler::resetRow(), casacore::SDFeedHandler::resetRow(), casacore::SDFieldHandler::resetRow(), casacore::SDHistoryHandler::resetRow(), casacore::SDMainHandler::resetRow(), casacore::SDObservationHandler::resetRow(), casacore::SDPointingHandler::resetRow(), casacore::SDPolarizationHandler::resetRow(), casacore::SDSourceHandler::resetRow(), casacore::SDSpWindowHandler::resetRow(), casacore::SDSysCalHandler::resetRow(), casacore::SDWeatherHandler::resetRow(), casacore::RetypedArrayEngine< VirtualType, StoredType >::RetypedArrayEngine(), casacore::Table::rowNumbers(), rwSubRecord(), casacore::TSMCube::rwValueRecord(), casacore::MSRange::scalarRange(), casacore::ScaledArrayEngine< VirtualType, StoredType >::ScaledArrayEngine(), casacore::ScaledComplexData< VirtualType, StoredType >::ScaledComplexData(), casacore::SDAntennaHandler::SDAntennaHandler(), casacore::SDFeedHandler::SDFeedHandler(), casacore::SDFieldHandler::SDFieldHandler(), casacore::SDFITSHandler::SDFITSHandler(), casacore::SDHistoryHandler::SDHistoryHandler(), casacore::SDMainHandler::SDMainHandler(), casacore::SDObservationHandler::SDObservationHandler(), casacore::SDPointingHandler::SDPointingHandler(), casacore::SDPolarizationHandler::SDPolarizationHandler(), casacore::SDSourceHandler::SDSourceHandler(), casacore::SDSpWindowHandler::SDSpWindowHandler(), casacore::SDSysCalHandler::SDSysCalHandler(), casacore::SDWeatherHandler::SDWeatherHandler(), casacore::MSSelector::select(), casacore::MeasuresProxy::separation(), casacore::SerialHelper::SerialHelper(), casacore::TableExprNodeRep::setAttributes(), casacore::UDFBase::setAttributes(), casacore::ColumnsIndex::setChanged(), casacore::ColumnsIndexArray::setChanged(), casacore::MSFlagger::setDataBufferFlags(), casacore::TableParseProject::setDMInfo(), casacore::TableParseQuery::setDMInfo(), dyscostman::DyscoStMan::setFromSpec(), casacore::AipsIOReaderWriter::setOptions(), casacore::RFWriter::setOptions(), casacore::CASATask::setParams(), casacore::BitFlagsEngine< StoredType >::setProperties(), casacore::DataManager::setProperties(), casacore::ISMBase::setProperties(), casacore::RODataManAccessor::setProperties(), casacore::SSMBase::setProperties(), casacore::TableProxy::setProperties(), casacore::TiledStMan::setProperties(), casacore::TaQLNodeHRValue::setRecord(), casacore::DataManInfo::setTiledStMan(), casacore::TableExprNodeRep::setUnit(), casacore::SiscoStMan::SiscoStMan(), casacore::MeasuresProxy::source(), casacore::SSMBase::SSMBase(), casacore::ImageProxy::statistics(), casacore::StManAipsIO::StManAipsIO(), casacore::StokesIStMan::StokesIStMan(), casacore::FunctionMarshallable::store(), casacore::MarshallableChebyshev< T >::store(), casacore::MarshButterworthBandpass< T >::store(), subRecord(), casacore::FITSTabular::subStringShapeFromHDU(), casacore::TableProxy::tableInfo(), casacore::TableProxy::TableProxy(), casacore::TableProxy::TableProxy(), casacore::TableProxy::TableProxy(), casacore::RegionManager::tableToRecord(), casacore::TiledCellStMan::TiledCellStMan(), casacore::TiledColumnStMan::TiledColumnStMan(), casacore::TiledDataStMan::TiledDataStMan(), casacore::TiledShapeStMan::TiledShapeStMan(), casacore::MeasuresProxy::todop(), casacore::GaussianBeam::toRecord(), casacore::ImageBeamSet::toRecord(), casacore::JsonKVMap::toRecord(), casacore::QuantumHolder::toRecord(), casacore::StatisticsAlgorithmFactory< AccumType, DataIterator, MaskIterator, WeightsIterator >::toRecord(), casacore::TableRecord::toRecord(), toRecord(), casacore::ValueHolder::toRecord(), casacore::ValueHolderRep::toRecord(), casacore::MeasuresProxy::torest(), casacore::BaseTable::trueDeepCopy(), casacore::TSMCube::TSMCube(), casacore::TSMCubeBuff::TSMCubeBuff(), casacore::TSMCubeMMap::TSMCubeMMap(), casacore::DataManInfo::uniqueName(), casacore::FITSMultiTable::units(), casacore::FITSTable::units(), casacore::FITSTabular::units(), casacore::FITSTimedTable::units(), casacore::MSReader::units(), casacore::FITSTabular::unitsFromHDU(), casacore::DataManager::unknownDataManager(), casacore::MeasuresProxy::uvw(), casacore::UvwStMan::UvwStMan(), casacore::ValueHolder::ValueHolder(), casacore::ValueHolderRep::ValueHolderRep(), casacore::ROTiledStManAccessor::valueRecord(), casacore::TSMCube::valueRecord(), casacore::VirtualTaQLColumn::VirtualTaQLColumn(), casacore::RegionManager::wbox(), casacore::RegionManager::wbox(), casacore::RegionManager::wbox(), casacore::RegionManager::wbox(), casacore::AipsIOReaderWriter::write(), casacore::RFWriter::write(), casacore::RFWriter::writeFile(), and casacore::RegionManager::writeImageFile().

◆ RecordFieldPtr()

casacore::RecordFieldPtr ( )

Access to an individual field in a record.

Intended use:

Public interface

Review Status

Reviewed By:
Mark Wieringa
Date Reviewed:
1996/04/15
Test programs:
tRecord

Prerequisite

Etymology

RecordFieldPtr indicates that an object of this type is pointing to a field in a record.

Synopsis

RecordFieldPtr allows access to the fields in a record object. A record object is an object of a class derived from RecordInterface. RecordFieldPtr<T> objects can only be instantiated for types `T' which are valid fields of a record object (e.g. Int, float, String, Record, TableRecord). It can, however, NOT be instantiated for a Table field, because Table fields are accessed indirectly via a TableKeyword object. Table fields have to be accessed directly through the TableRecord interface.

Internally, a RecordFieldPtr stores a Record pointer and field number. Therefore, if the order of fields in a Record is modified, or if the Record is restructured, a RecordFieldPtr is invalidated and should no longer be used.

The RecordFieldPtr is pointer-like in the sense that it points to an object that is physically inside of another object (the enclosing record object). Access to the value is obtained via the dereference operator (operator*()) to emphasize the pointer like nature of these classes.
An alternative way to get access to the values is using the functions define and get. Note that in

*field = value;
field.define (value);
Int fieldNumber(const String &fieldName) const override
Get the field number from the field name.
NewDelAllocator< T > NewDelAllocator< T >::value
Definition Allocator.h:368

the assignment (in line 3) and define (in line 4) are not equivalent. The assignment uses the normal Array assignment, thus it takes the Array conformance rules into account (an assign is only possible when the new array value conforms the current array value or when the current array value is empty). On the other hand, define does not take the current array value into account. Thus an array value can always be redefined.
However, note that if the field is defined with a non-fixed shape in the record description, a value must always conform that shape (in case of assignment as well as in case of define).

Example

See the example in the Record class.

Motivation

RecordFieldPtr provides a fast way to access the data in a record.

*/ template<class T> class RecordFieldPtr { public: /** This object does not point to any field, i.e. this->isAttached() == False;