LSST Applications g063fba187b+fee0456c91,g0f08755f38+ea96e5a5a3,g1653933729+a8ce1bb630,g168dd56ebc+a8ce1bb630,g1a2382251a+90257ff92a,g20f6ffc8e0+ea96e5a5a3,g217e2c1bcf+937a289c59,g28da252d5a+daa7da44eb,g2bbee38e9b+253935c60e,g2bc492864f+253935c60e,g3156d2b45e+6e55a43351,g32e5bea42b+31359a2a7a,g347aa1857d+253935c60e,g35bb328faa+a8ce1bb630,g3a166c0a6a+253935c60e,g3b1af351f3+a8ce1bb630,g3e281a1b8c+c5dd892a6c,g414038480c+416496e02f,g41af890bb2+afe91b1188,g599934f4f4+0db33f7991,g7af13505b9+e36de7bce6,g80478fca09+da231ba887,g82479be7b0+a4516e59e3,g858d7b2824+ea96e5a5a3,g89c8672015+f4add4ffd5,g9125e01d80+a8ce1bb630,ga5288a1d22+bc6ab8dfbd,gb58c049af0+d64f4d3760,gc28159a63d+253935c60e,gcab2d0539d+3f2b72788c,gcf0d15dbbd+4ea9c45075,gda6a2b7d83+4ea9c45075,gdaeeff99f8+1711a396fd,ge79ae78c31+253935c60e,gef2f8181fd+3031e3cf99,gf0baf85859+c1f95f4921,gfa517265be+ea96e5a5a3,gfa999e8aa5+17cd334064,w.2024.50
LSST Data Management Base Package
|
A private implementation class to hide the messy details of Schema. More...
#include <SchemaImpl.h>
Public Types | |
using | ItemVariant = decltype(makeItemVariantType(FieldTypes{})) |
A Boost.Variant type that can hold any one of the allowed SchemaItem types. | |
using | ItemContainer = std::vector<ItemVariant> |
A std::vector whose elements can be any of the allowed SchemaItem types. | |
using | NameMap = std::map<std::string, std::size_t> |
A map from field names to position in the vector, so we can do name lookups. | |
using | OffsetMap = std::map<std::size_t, std::size_t> |
A map from standard field offsets to position in the vector, so we can do field lookups. | |
using | FlagMap = std::map<std::pair<std::size_t, std::size_t>, std::size_t> |
A map from Flag field offset/bit pairs to position in the vector, so we can do Flag field lookups. | |
Public Member Functions | |
std::size_t | getRecordSize () const |
The size of a record in bytes. | |
std::size_t | getFieldCount () const |
The total number of fields. | |
std::size_t | getFlagFieldCount () const |
The number of Flag fields. | |
std::size_t | getNonFlagFieldCount () const |
The number of non-Flag fields. | |
template<typename T > | |
SchemaItem< T > | find (std::string const &name) const |
Find an item by name (used to implement Schema::find). | |
template<typename T > | |
SchemaItem< T > | find (Key< T > const &key) const |
Find an item by key (used to implement Schema::find). | |
SchemaItem< Flag > | find (Key< Flag > const &key) const |
Find an item by key (used to implement Schema::find). | |
template<typename F > | |
decltype(auto) | findAndApply (std::string const &name, F &&func) const |
Find an item by name and run the given functor on it. | |
std::set< std::string > | getNames (bool topOnly) const |
Return a set of field names (used to implement Schema::getNames). | |
std::set< std::string > | getNames (bool topOnly, std::string const &prefix) const |
Return a set of field names (used to implement SubSchema::getNames). | |
template<typename T > | |
int | contains (SchemaItem< T > const &item, int flags) const |
template<typename T > | |
Key< T > | addField (Field< T > const &field, bool doReplace=false) |
Add a field to the schema (used to implement Schema::addField). | |
Key< Flag > | addField (Field< Flag > const &field, bool doReplace=false) |
Add a field to the schema (used to implement Schema::addField). | |
template<typename T > | |
Key< Array< T > > | addField (Field< Array< T > > const &field, bool doReplace=false) |
Add a field to the schema (used to implement Schema::addField). | |
Key< std::string > | addField (Field< std::string > const &field, bool doReplace=false) |
Add a field to the schema (used to implement Schema::addField). | |
template<typename T > | |
void | replaceField (Key< T > const &key, Field< T > const &field) |
Replace the Field in an existing SchemaItem without changing the Key. | |
ItemContainer const & | getItems () const |
Return the vector of SchemaItem variants. | |
SchemaImpl () | |
Default constructor. | |
Static Public Attributes | |
static int const | VERSION = 3 |
Friends | |
class | detail::Access |
A private implementation class to hide the messy details of Schema.
This can't be a real pimpl class, because some of the most important functionality is in the forEach function, a templated function we can't explicitly instantiate in a source file. But putting all the details here draws a clear line between what users should look at (Schema) and what they shouldn't (this).
Because Schema holds SchemaImpl by shared pointer, one SchemaImpl can be shared between multiple Schemas (and SubSchemas), which implement copy-on-write by creating a new SchemaImpl if the pointer they have isn't unique when they are modified.
Definition at line 45 of file SchemaImpl.h.
using lsst::afw::table::detail::SchemaImpl::FlagMap = std::map<std::pair<std::size_t, std::size_t>, std::size_t> |
A map from Flag field offset/bit pairs to position in the vector, so we can do Flag field lookups.
Definition at line 63 of file SchemaImpl.h.
A std::vector whose elements can be any of the allowed SchemaItem types.
Definition at line 57 of file SchemaImpl.h.
using lsst::afw::table::detail::SchemaImpl::ItemVariant = decltype(makeItemVariantType(FieldTypes{})) |
A Boost.Variant type that can hold any one of the allowed SchemaItem types.
Definition at line 55 of file SchemaImpl.h.
A map from field names to position in the vector, so we can do name lookups.
Definition at line 59 of file SchemaImpl.h.
A map from standard field offsets to position in the vector, so we can do field lookups.
Definition at line 61 of file SchemaImpl.h.
|
inline |
Default constructor.
Definition at line 136 of file SchemaImpl.h.
Key< Array< T > > lsst::afw::table::detail::SchemaImpl::addField | ( | Field< Array< T > > const & | field, |
bool | doReplace = false ) |
Add a field to the schema (used to implement Schema::addField).
Definition at line 294 of file Schema.cc.
Key< Flag > lsst::afw::table::detail::SchemaImpl::addField | ( | Field< Flag > const & | field, |
bool | doReplace = false ) |
Add a field to the schema (used to implement Schema::addField).
Definition at line 318 of file Schema.cc.
Key< std::string > lsst::afw::table::detail::SchemaImpl::addField | ( | Field< std::string > const & | field, |
bool | doReplace = false ) |
Add a field to the schema (used to implement Schema::addField).
Definition at line 303 of file Schema.cc.
Key< T > lsst::afw::table::detail::SchemaImpl::addField | ( | Field< T > const & | field, |
bool | doReplace = false ) |
Add a field to the schema (used to implement Schema::addField).
Definition at line 314 of file Schema.cc.
int lsst::afw::table::detail::SchemaImpl::contains | ( | SchemaItem< T > const & | item, |
int | flags ) const |
Definition at line 225 of file Schema.cc.
SchemaItem< Flag > lsst::afw::table::detail::SchemaImpl::find | ( | Key< Flag > const & | key | ) | const |
Find an item by key (used to implement Schema::find).
Definition at line 126 of file Schema.cc.
SchemaItem< T > lsst::afw::table::detail::SchemaImpl::find | ( | Key< T > const & | key | ) | const |
Find an item by key (used to implement Schema::find).
Definition at line 110 of file Schema.cc.
SchemaItem< T > lsst::afw::table::detail::SchemaImpl::find | ( | std::string const & | name | ) | const |
Find an item by name (used to implement Schema::find).
Definition at line 92 of file Schema.cc.
|
inline |
Find an item by name and run the given functor on it.
Definition at line 90 of file SchemaImpl.h.
|
inline |
|
inline |
|
inline |
Return the vector of SchemaItem variants.
Fields are in the order they are added. That means they're also ordered with increasing Key offsets, except for Flag fields, which are in increasing order of (offset, bit) relative to each other, but not relative to all the other fields.
Definition at line 133 of file SchemaImpl.h.
std::set< std::string > lsst::afw::table::detail::SchemaImpl::getNames | ( | bool | topOnly | ) | const |
Return a set of field names (used to implement Schema::getNames).
Definition at line 251 of file Schema.cc.
std::set< std::string > lsst::afw::table::detail::SchemaImpl::getNames | ( | bool | topOnly, |
std::string const & | prefix ) const |
Return a set of field names (used to implement SubSchema::getNames).
Definition at line 270 of file Schema.cc.
|
inline |
|
inline |
The size of a record in bytes.
Definition at line 66 of file SchemaImpl.h.
void lsst::afw::table::detail::SchemaImpl::replaceField | ( | Key< T > const & | key, |
Field< T > const & | field ) |
Replace the Field in an existing SchemaItem without changing the Key.
Definition at line 193 of file Schema.cc.
|
friend |
Definition at line 139 of file SchemaImpl.h.
|
static |
Definition at line 52 of file SchemaImpl.h.