Template Class BoxKey

Inheritance Relationships

Base Type

Class Documentation

template<typename Box>
class BoxKey : public lsst::afw::table::FunctorKey<Box>

A FunctorKey used to get or set a lsst::geom::Box2I or Box2D from a (min, max) pair of PointKeys.

The Box2IKey and Box2DKey typedefs should be preferred to using the template name directly.

Unnamed Group

bool operator==(BoxKey const &other) const

Compare the FunctorKey for equality with another, using the underlying x and y Keys.

bool operator!=(BoxKey const &other) const

Public Types

template<>
using Element = typename Box::Element

Type of coordinate elements (i.e. int or double).

Public Functions

BoxKey()

Default constructor; instance will not be usable unless subsequently assigned to.

BoxKey(PointKey<Element> const &min, PointKey<Element> const &max)

Construct from a pair of PointKeys.

BoxKey(SubSchema const &s)

Construct from a subschema, assuming _min_x, _max_x, _min_y, _max_y subfields

If a schema has “a_min_x” and “a_min_x” (etc) fields, this constructor allows you to construct a BoxKey via:

BoxKey<Box> k(schema["a"]);

BoxKey(BoxKey const&)
BoxKey(BoxKey&&)
BoxKey &operator=(BoxKey const&)
BoxKey &operator=(BoxKey&&)
~BoxKey()
std::size_t hash_value() const

Return a hash of this object.

Box get(BaseRecord const &record) const

Get a Box from the given record.

void set(BaseRecord &record, Box const &value) const

Set a Box in the given record.

bool isValid() const

Return True if both the min and max PointKeys are valid.

PointKey<Element> getMin() const

Return the underlying min PointKey.

PointKey<Element> getMax() const

Return the underlying max PointKey.

Public Static Functions

static BoxKey addFields(Schema &schema, std::string const &name, std::string const &doc, std::string const &unit)

Add _min_x, _min_y, _max_x, _max_y fields to a Schema, and return a BoxKey that points to them.

Parameters
  • [inout] schema: Schema to add fields to.

  • [in] name: Name prefix for all fields; suffixes above will be appended to this to form the full field names. For example, if name == "b", the fields added will be “b_min_x”, “b_min_y”, “b_max_x”, and “b_max_y”.

  • [in] doc: String used as the documentation for the fields.

  • [in] unit: String used as the unit for all fields.