lsst.afw  21.0.0-39-g68de21fec+f88c352dc9
SchemaMapperImpl.h
Go to the documentation of this file.
1 // -*- lsst-c++ -*-
2 #ifndef AFW_TABLE_DETAIL_SchemaMapperImpl_h_INCLUDED
3 #define AFW_TABLE_DETAIL_SchemaMapperImpl_h_INCLUDED
4 
5 #include <map>
6 #include <algorithm>
7 
8 #include "lsst/afw/table/Key.h"
9 #include "lsst/afw/table/types.h"
10 #include "lsst/afw/table/Schema.h"
11 
12 namespace lsst {
13 namespace afw {
14 namespace table {
15 
16 class SchemaMapper;
17 
18 namespace detail {
19 
27 private:
30  template <typename ...E>
31  static std::variant<std::pair<Key<E>, Key<E>>...> makeKeyPairVariantType(TypeList<E...>);
32 
33 public:
35  using KeyPairVariant = decltype(makeKeyPairVariantType(FieldTypes{}));
38 
40  explicit SchemaMapperImpl(Schema const& input, Schema const& output) : _input(input), _output(output) {}
41 
42 private:
43  friend class table::SchemaMapper;
44  friend class detail::Access;
45 
46  Schema _input;
47  Schema _output;
48  KeyPairMap _map;
49 };
50 } // namespace detail
51 } // namespace table
52 } // namespace afw
53 } // namespace lsst
54 
55 #endif // !AFW_TABLE_DETAIL_SchemaMapperImpl_h_INCLUDED
A class used as a handle to a particular field in a table.
Definition: Key.h:53
Defines the fields and offsets for a table.
Definition: Schema.h:51
A mapping between the keys of two Schemas, used to copy data between them.
Definition: SchemaMapper.h:21
A private implementation class to hide the messy details of SchemaMapper.
std::vector< KeyPairVariant > KeyPairMap
A std::vector whose elements can be any of the allowed pair types.
decltype(makeKeyPairVariantType(FieldTypes{})) KeyPairVariant
A Variant type that can hold any one of the allowed pairx types.
SchemaMapperImpl(Schema const &input, Schema const &output)
Constructor from the given input and output schemas.
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.
Definition: Filter.h:53
A base class for image defects.