RecordFieldWriter.h

Classes

RecordFieldWriter -- Record field writer. Base class for the copiers. (full description)
RecordFieldCopier -- Record field copier. Copies field to field as is. (full description)
UnequalShapeCopier -- Unequal shape copier. (full description)
MultiRecordFieldWriter -- Multi field writer. Copy many fields with a single call. (full description)

class RecordFieldWriter

Interface

Public Members
virtual ~RecordFieldWriter()
virtual void writeField() = 0

Description

Review Status

Date Reviewed:
yyyy/mm/dd

Etymology

These classes write values to a field or fields in a record.

Synopsis

These classes are used in the ms2sdfits conversion code. It might be better if they were moved there.

Motivation

It was useful to set up a number of copiers and invoke them as appropriate via a single function call. Some copiers may be more complicate than a direct field to field copy.

To Do

Member Description

virtual ~RecordFieldWriter()

virtual void writeField() = 0


class RecordFieldCopier : public RecordFieldWriter

Interface

RecordFieldCopier(RecordInterface &outRecord, RecordFieldId whichOutField, const RecordInterface &inRecord, RecordFieldId whichInField)
void copy()
virtual void writeField()

Description

Review Status

Date Reviewed:
yyyy/mm/dd

Etymology

Copies a field from a record to another record with a field of the same type.

Motivation

This type of copy can be inlined.

Member Description

RecordFieldCopier(RecordInterface &outRecord, RecordFieldId whichOutField, const RecordInterface &inRecord, RecordFieldId whichInField)

void copy()

virtual void writeField()


template<class T> class UnequalShapeCopier : public RecordFieldWriter

Interface

UnequalShapeCopier(RecordInterface &outRecord, RecordFieldId whichOutField, const RecordInterface &inRecord, RecordFieldId whichInField)
virtual void writeField()

Description

Review Status

Date Reviewed:
yyyy/mm/dd

Etymology

Copy fields where the two fields fields do not have the same shape, however, the number of elements must match. Copying is done element by element in vector order.

Motivation

Sometimes the shapes need to change even though the number of elements stays the same.

Member Description

UnequalShapeCopier(RecordInterface &outRecord, RecordFieldId whichOutField, const RecordInterface &inRecord, RecordFieldId whichInField)

virtual void writeField()


class MultiRecordFieldWriter

Interface

void addWriter(RecordFieldWriter *fromNew)
void copy()
~MultiRecordFieldWriter()

Description

Review Status

Date Reviewed:
yyyy/mm/dd

Etymology

This class contains other copiers and copies multiple fields at a time.

Motivation

It was useful to set up a number of copiers and invoke them as appropriate via a single function call.

Member Description

void addWriter(RecordFieldWriter *fromNew)

void copy()

~MultiRecordFieldWriter()