Class SimpleTable

Nested Relationships

Inheritance Relationships

Base Type

Derived Type

Class Documentation

class SimpleTable : public lsst::afw::table::BaseTable

Table class that must contain a unique ID field and a celestial coordinate field.

Record class that must contain a unique ID field and a celestial coordinate field.

SimpleTable / SimpleRecord are intended to be the base class for records representing astronomical objects. In additional to the minimal schema and the convenience accessors it allows, a SimpleTable may hold an IdFactory object that is used to assign unique IDs to new records.

Subclassed by lsst::afw::table::SourceTable

Unnamed Group

static Key<RecordId> getIdKey()

Key for the unique ID.

Get keys for standard fields shared by all references.

These keys are used to implement getters and setters on SimpleRecord.

static CoordKey getCoordKey()

Key for the celestial coordinates.

Public Types

typedef SimpleRecord Record
typedef ColumnViewT<SimpleRecord> ColumnView
typedef SortedCatalogT<Record> Catalog
typedef SortedCatalogT<Record const> ConstCatalog

Public Functions

std::shared_ptr<IdFactory> getIdFactory()

Return the object that generates IDs for the table (may be null).

std::shared_ptr<IdFactory const> getIdFactory() const

Return the object that generates IDs for the table (may be null).

void setIdFactory(std::shared_ptr<IdFactory> f)

Switch to a new IdFactory object that generates IDs for the table (may be null).

std::shared_ptr<SimpleTable> clone() const

Return a polymorphic deep copy of the table.

Derived classes should reimplement by static-casting the output of _clone to a pointer-to-derived to simulate covariant return types.

Cloning a table does not clone its associated records; the new table produced by clone() does not have any associated records.

std::shared_ptr<SimpleRecord> makeRecord()

Default-construct an associated record.

Derived classes should reimplement by static-casting the output of _makeRecord to the appropriate BaseRecord subclass to simulate covariant return types.

std::shared_ptr<SimpleRecord> copyRecord(BaseRecord const &other)

Deep-copy a record, requiring that it have the same schema as this table.

Regardless of the type or associated table of the input record, the type of the output record will be the type associated with this table and the record instance will be associated with this table.

Allowing derived-class records to be constructed from base-class records could be considered a form of type-slicing, but because we already demand that all records be constructable from nothing but a table, this isn’t anything new.

Derived classes should reimplement by static-casting the output of BaseTable::copyRecord to the appropriate BaseRecord subclass.

This is implemented using makeRecord and calling record.assign on the results; override those to change the behavior.

std::shared_ptr<SimpleRecord> copyRecord(BaseRecord const &other, SchemaMapper const &mapper)

Deep-copy a record, requiring that it have the same schema as this table.

Regardless of the type or associated table of the input record, the type of the output record will be the type associated with this table and the record instance will be associated with this table.

Allowing derived-class records to be constructed from base-class records could be considered a form of type-slicing, but because we already demand that all records be constructable from nothing but a table, this isn’t anything new.

Derived classes should reimplement by static-casting the output of BaseTable::copyRecord to the appropriate BaseRecord subclass.

This is implemented using makeRecord and calling record.assign on the results; override those to change the behavior.

SimpleTable &operator=(SimpleTable const&)
SimpleTable &operator=(SimpleTable&&)
~SimpleTable()

Public Static Functions

static std::shared_ptr<SimpleTable> make(Schema const &schema, std::shared_ptr<IdFactory> const &idFactory)

Construct a new table.

Note that not passing an

IdFactory at all will call the other override of make(), which will set the ID factory to IdFactory::makeSimple().
Parameters
  • [in] schema: Schema that defines the fields, offsets, and record size for the table.

  • [in] idFactory: Factory class to generate record IDs when they are not explicitly given. If null, record IDs will default to zero.

static std::shared_ptr<SimpleTable> make(Schema const &schema)

Construct a new table.

This overload sets the ID factory to

IdFactory::makeSimple().
Parameters
  • [in] schema: Schema that defines the fields, offsets, and record size for the table.

static Schema makeMinimalSchema()

Return a minimal schema for Simple tables and records.

The returned schema can and generally should be modified further, but many operations on SimpleRecords will assume that at least the fields provided by this routine are present.

static bool checkSchema(Schema const &other)

Return true if the given schema is a valid SimpleTable schema.

This will always be true if the given schema was originally constructed using makeMinimalSchema(), and will rarely be true otherwise.

Protected Functions

SimpleTable(Schema const &schema, std::shared_ptr<IdFactory> const &idFactory)
SimpleTable(SimpleTable const &other)
SimpleTable(SimpleTable &&other)
std::shared_ptr<BaseTable> _clone() const

Clone implementation with noncovariant return types.

std::shared_ptr<BaseRecord> _makeRecord()

Default-construct an associated record (protected implementation).

Friends

friend lsst::afw::table::SimpleTable::io::FitsWriter