2#ifndef AFW_TABLE_Key_h_INCLUDED
3#define AFW_TABLE_Key_h_INCLUDED
5#include "lsst/utils/hashCombine.h"
65 template <
typename OtherT>
69 template <
typename OtherT>
75 return _offset == other._offset && this->
getElementCount() == other.getElementCount();
97 bool isValid() const noexcept {
return _valid; }
108 Key& operator=(
Key const&) noexcept = default;
109 Key& operator=(
Key&&) noexcept = default;
110 ~
Key() noexcept = default;
113 inline friend
std::ostream& operator<<(
std::ostream&
os,
Key<T> const& key) {
115 <<
", nElements=" << key.getElementCount() <<
")";
123 :
FieldBase<T>(fb), _offset(offset), _valid(true) {}
Base class for all records.
A base class for Key that allows subfield keys to be extracted for some field types.
A class used as a handle to a particular field in a table.
bool operator==(Key< OtherT > const &other) const noexcept
Equality comparison.
std::size_t getOffset() const noexcept
Return the offset (in bytes) of this field within a record.
bool operator!=(Key const &other) const noexcept
Key() noexcept
Default construct a field.
Key(Key &&) noexcept=default
bool isValid() const noexcept
Return true if the key was initialized to valid offset.
std::size_t hash_value() const noexcept
Return a hash of this object.
bool operator==(Key const &other) const noexcept
bool operator!=(Key< OtherT > const &other) const noexcept
Key(Key const &) noexcept=default
Field base class default implementation (used for numeric scalars and lsst::geom::Angle).
static std::string getTypeString()
Return a string description of the field type.
std::size_t getElementCount() const noexcept
Return the number of subfield elements (always one for scalars).
static FieldBase makeDefault() noexcept
Needed to allow Keys to be default-constructed.
size_t operator()(argument_type const &obj) const noexcept