LSSTApplications
21.0.0+1b62c9342b,21.0.0+45a059f35e,21.0.0-1-ga51b5d4+ceb9cf20a3,21.0.0-2-g103fe59+4d13aff7ba,21.0.0-2-g1367e85+571a348718,21.0.0-2-g2909d54+45a059f35e,21.0.0-2-g45278ab+1b62c9342b,21.0.0-2-g4bc9b9f+ebfe466dad,21.0.0-2-g5242d73+571a348718,21.0.0-2-g54e2caa+ae261561d3,21.0.0-2-g66bcc37+0b2c5d3971,21.0.0-2-g7f82c8f+08f1f55c36,21.0.0-2-g8dde007+5d1b9cb3f5,21.0.0-2-g8f08a60+73884b2cf5,21.0.0-2-ga326454+08f1f55c36,21.0.0-2-ga63a54e+5beb793fda,21.0.0-2-gc738bc1+8c4731df06,21.0.0-2-gde069b7+5a8f2956b8,21.0.0-2-ge17e5af+571a348718,21.0.0-2-ge712728+cfa36ee5f9,21.0.0-2-gecfae73+e597808034,21.0.0-2-gfc62afb+571a348718,21.0.0-20-g4449a12+6d1341e0f3,21.0.0-21-g006371a9+1cd928f0c5,21.0.0-3-g4c5b185+c3794955c6,21.0.0-3-g6d51c4a+0b2c5d3971,21.0.0-3-g8076721+5adeb471db,21.0.0-3-gaa929c8+01f4b7cfca,21.0.0-3-gd222c45+afc8332dbe,21.0.0-4-g1383c07+0b2c5d3971,21.0.0-4-g3300ddd+1b62c9342b,21.0.0-4-g5873dc9+9a92674037,21.0.0-4-g8a80011+ca0917f8b6,21.0.0-5-gcff38f6+36b2eaf090,21.0.0-6-g463d161+bfc341698e,21.0.0-6-gd3283ba+01f4b7cfca,21.0.0-8-g19111d86+8234efb485,21.0.0-9-g7bed000b9+c7d3cce47e,w.2021.04
LSSTDataManagementBasePackage
|
Go to the documentation of this file.
2 #ifndef AFW_TABLE_Schema_h_INCLUDED
3 #define AFW_TABLE_Schema_h_INCLUDED
104 template <
typename T>
115 template <
typename F>
117 _impl->findAndApply(_aliases->apply(
name), std::forward<F>(func));
169 template <
typename T>
179 template <
typename T>
192 template <
typename T>
194 bool doReplace =
false) {
199 template <
typename T>
211 template <
typename F>
214 std::for_each(_impl->getItems().begin(), _impl->getItems().end(), visitor);
257 template <typename T>
374 template <
typename T>
385 template <
typename F>
387 _impl->findAndApply(_aliases->apply(
join(_name,
name)), std::forward<F>(func));
401 template <
typename F>
403 _impl->findAndApply(_aliases->apply(_name), std::forward<F>(func));
427 template <
typename T>
429 return _impl->find<T>(_aliases->apply(_name)).
key;
439 template <
typename T>
441 return _impl->find<T>(_aliases->apply(_name)).
field;
470 #endif // !AFW_TABLE_Schema_h_INCLUDED
Key< T > addField(std::string const &name, std::string const &doc, FieldBase< T > const &base, bool doReplace=false)
Add a new field to the Schema, and return the associated Key.
SchemaItem< T > find(std::string const &name) const
Find a nested SchemaItem by name.
Key< T > addField(Field< T > const &field, bool doReplace=false)
Add a new field to the Schema, and return the associated Key.
const int DEFAULT_HDU
Specify that the default HDU should be read.
A simple struct that combines the two arguments that must be passed to most cfitsio routines and cont...
std::string join(std::string const &a, std::string const &b, std::string const &c, std::string const &d) const
int compare(Schema const &other, int flags=EQUAL_KEYS) const
Do a detailed equality comparison of two schemas.
int getRecordSize() const
Return the raw size of a record in bytes.
SubSchema operator[](std::string const &name) const
Return a nested proxy.
A private implementation class to hide the messy details of Schema.
void findAndApply(std::string const &name, F &&func) const
Find a SchemaItem by name and run a functor on it.
std::string join(std::string const &a, std::string const &b) const
Join strings using the field delimiter appropriate for this Schema.
Key< T > addField(std::string const &name, std::string const &doc, std::string const &units="", FieldBase< T > const &base=FieldBase< T >(), bool doReplace=false)
Add a new field to the Schema, and return the associated Key.
Schema & operator=(Schema const &other)
Class for storing ordered metadata with comments.
ComparisonFlags
Bit flags used when comparing schemas.
Defines the fields and offsets for a table.
std::set< std::string > getNames(bool topOnly=false) const
Return a set of nested names that start with the SubSchema's prefix.
Lifetime-management for memory that goes into FITS memory files.
bool operator!=(Schema const &other) const
void forEach(F &&func) const
Apply a functor to each SchemaItem in the Schema.
@ EQUAL_KEYS
Keys have the same types offsets, and sizes.
bool operator==(Schema const &other) const
Equality comparison.
SchemaItem< T > find(std::string const &name) const
Find a SchemaItem in the Schema by name.
Schema()
Construct an empty Schema.
std::size_t hash_value() const noexcept
Return a hash of this object.
SubSchema operator[](std::string const &name) const
Look up a (possibly incomplete) name in the Schema.
std::set< std::string > getNames(bool topOnly=false) const
Return a set of field names in the schema.
Mapping class that holds aliases for a Schema.
std::string join(std::string const &a, std::string const &b, std::string const &c) const
ItemVariant const * other
static Schema readFits(std::string const &filename, int hdu=fits::DEFAULT_HDU)
Construct from reading a FITS file.
void setAliasMap(std::shared_ptr< AliasMap > aliases)
Set the alias map.
A simple pair-like struct for mapping a Field (name and description) with a Key (used for actual data...
std::string join(std::string const &a, std::string const &b) const
Join strings using the field delimiter appropriate for this Schema.
A class used as a handle to a particular field in a table.
void findAndApply(std::string const &name, F &&func) const
Find a nested SchemaItem by name and run a functor on it.
@ EQUAL_ALIASES
Schemas have identical AliasMaps.
@ EQUAL_DOCS
Fields have the same documentation (ordered).
@ IDENTICAL
Everything is the same.
A base class for image defects.
friend std::ostream & operator<<(std::ostream &os, Schema const &schema)
Stringification.
int getNonFlagFieldCount() const
The number of non-Flag fields.
@ EQUAL_UNITS
Fields have the same units (ordered).
void apply(F &&func) const
Run functor on the SchemaItem represented by this SubSchema.
std::string join(std::string const &a, std::string const &b, std::string const &c, std::string const &d) const
Field base class default implementation (used for numeric scalars and lsst::geom::Angle).
int getFieldCount() const
The total number of fields.
A description of a field in a table.
A proxy type for name lookups in a Schema.
static Schema fromFitsMetadata(daf::base::PropertyList &header, bool stripMetadata=true)
Construct from reading a FITS header.
int getFlagFieldCount() const
The number of Flag fields.
size_t operator()(argument_type const &obj) const noexcept
void disconnectAliases()
Sever the connection between this schema and any others with which it shares aliases.
std::string join(std::string const &a, std::string const &b, std::string const &c) const
@ EQUAL_NAMES
Fields have the same names (ordered).
std::shared_ptr< AliasMap > getAliasMap() const
Return the map of aliases.
A functor-wrapper used in the implementation of Schema::forEach.
int contains(Schema const &other, int flags=EQUAL_KEYS) const
Test whether the given schema is a subset of this.
@ EQUAL_FIELDS
Fields are identical (but aliases may not be).
void replaceField(Key< T > const &key, Field< T > const &field)
Replace the Field (name/description) for an existing Key.
std::string const & getPrefix() const
Return the prefix that defines this SubSchema relative to its parent Schema.
Schema & operator=(Schema &&other)