2 #ifndef AFW_TABLE_DETAIL_SchemaImpl_h_INCLUDED
3 #define AFW_TABLE_DETAIL_SchemaImpl_h_INCLUDED
49 template <
typename ...E>
50 static std::variant<SchemaItem<E>...> makeItemVariantType(
TypeList<E...>);
94 (boost::format(
"Field with name '%s' not found") %
name).str());
96 return std::visit(std::forward<F>(func), _items[
iter->second]);
105 template <
typename T>
109 template <
typename T>
116 template <
typename T>
123 template <
typename T>
136 SchemaImpl() : _recordSize(0), _lastFlagField(0), _lastFlagBit(0), _items(), _initFlag(false) {}
141 template <
typename T>
table::Key< std::string > name
#define LSST_EXCEPT(type,...)
Tag types used to declare specialized field types.
Key specialization for Flag.
A class used as a handle to a particular field in a table.
A private implementation class to hide the messy details of Schema.
ItemContainer const & getItems() const
Return the vector of SchemaItem variants.
std::map< std::pair< std::size_t, std::size_t >, std::size_t > FlagMap
A map from Flag field offset/bit pairs to position in the vector, so we can do Flag field lookups.
std::set< std::string > getNames(bool topOnly) const
Return a set of field names (used to implement Schema::getNames).
SchemaImpl()
Default constructor.
Key< T > addField(Field< T > const &field, bool doReplace=false)
Add a field to the schema (used to implement Schema::addField).
int contains(SchemaItem< T > const &item, int flags) const
decltype(auto) findAndApply(std::string const &name, F &&func) const
Find an item by name and run the given functor on it.
std::size_t getRecordSize() const
The size of a record in bytes.
void replaceField(Key< T > const &key, Field< T > const &field)
Replace the Field in an existing SchemaItem without changing the Key.
std::size_t getFlagFieldCount() const
The number of Flag fields.
std::size_t getNonFlagFieldCount() const
The number of non-Flag fields.
std::map< std::string, std::size_t > NameMap
A map from field names to position in the vector, so we can do name lookups.
SchemaItem< T > find(std::string const &name) const
Find an item by name (used to implement Schema::find).
std::size_t getFieldCount() const
The total number of fields.
decltype(makeItemVariantType(FieldTypes{})) ItemVariant
A Boost.Variant type that can hold any one of the allowed SchemaItem types.
std::vector< ItemVariant > ItemContainer
A std::vector whose elements can be any of the allowed SchemaItem types.
std::map< std::size_t, std::size_t > OffsetMap
A map from standard field offsets to position in the vector, so we can do field lookups.
class[[deprecated("Removed with no replacement (but see lsst::afw::image::TransmissionCurve). Will be " "removed after v22.")]] FilterProperty final
Describe the properties of a Filter (e.g.
A base class for image defects.
A description of a field in a table.
A simple pair-like struct for mapping a Field (name and description) with a Key (used for actual data...
SchemaItem(Key< T > const &key_, Field< T > const &field_)