LSSTApplications  1.1.2+25,10.0+13,10.0+132,10.0+133,10.0+224,10.0+41,10.0+8,10.0-1-g0f53050+14,10.0-1-g4b7b172+19,10.0-1-g61a5bae+98,10.0-1-g7408a83+3,10.0-1-gc1e0f5a+19,10.0-1-gdb4482e+14,10.0-11-g3947115+2,10.0-12-g8719d8b+2,10.0-15-ga3f480f+1,10.0-2-g4f67435,10.0-2-gcb4bc6c+26,10.0-28-gf7f57a9+1,10.0-3-g1bbe32c+14,10.0-3-g5b46d21,10.0-4-g027f45f+5,10.0-4-g86f66b5+2,10.0-4-gc4fccf3+24,10.0-40-g4349866+2,10.0-5-g766159b,10.0-5-gca2295e+25,10.0-6-g462a451+1
LSSTDataManagementBasePackage
KeyBase.h
Go to the documentation of this file.
1 // -*- lsst-c++ -*-
2 #ifndef AFW_TABLE_KeyBase_h_INCLUDED
3 #define AFW_TABLE_KeyBase_h_INCLUDED
4 
5 #include <vector>
6 
7 #include "lsst/afw/table/misc.h"
8 
9 namespace lsst { namespace afw { namespace table {
10 
11 class BaseRecord;
12 
13 template <typename T> class Key;
14 
16 template <typename T>
17 class KeyBase {
18 public:
19  static bool const HAS_NAMED_SUBFIELDS = false;
20 
21 };
22 
24 template <>
25 class KeyBase< Coord > {
26 public:
27  static bool const HAS_NAMED_SUBFIELDS = true;
28 
29  Key<Angle> getRa() const;
30  Key<Angle> getDec() const;
31 
32 #ifndef SWIG
33  static char const * subfields[];
34 #endif
35 };
36 
38 template <typename U>
39 class KeyBase< Point<U> > {
40 public:
41  static bool const HAS_NAMED_SUBFIELDS = true;
42 
43  Key<U> getX() const;
44  Key<U> getY() const;
45 
46  static char const * subfields[];
47 };
48 
50 template <typename U>
51 class KeyBase< Moments<U> > {
52 public:
53  static bool const HAS_NAMED_SUBFIELDS = true;
54 
55  Key<U> getIxx() const;
56  Key<U> getIyy() const;
57  Key<U> getIxy() const;
58 
59  static char const * subfields[];
60 };
61 
63 template <typename U>
64 class KeyBase< Array<U> > {
65 public:
66  static bool const HAS_NAMED_SUBFIELDS = false;
67 
68  std::vector<U> extractVector(BaseRecord const & record) const;
69 
70  void assignVector(BaseRecord & record, std::vector<U> const & values) const;
71 
72  Key<U> operator[](int i) const;
73 
74  Key< Array<U> > slice(int begin, int end) const;
75 };
76 
78 template <typename U>
79 class KeyBase< Covariance<U> > {
80 public:
81  static bool const HAS_NAMED_SUBFIELDS = false;
82 
84  Key<U> operator()(int i, int j) const;
85 };
86 
88 template <typename U>
89 class KeyBase< Covariance< Point<U> > > {
90 public:
91  static bool const HAS_NAMED_SUBFIELDS = false;
92 
94  Key<U> operator()(int i, int j) const;
95 };
96 
98 template <typename U>
99 class KeyBase< Covariance< Moments<U> > > {
100 public:
101  static bool const HAS_NAMED_SUBFIELDS = false;
102 
104  Key<U> operator()(int i, int j) const;
105 };
106 
107 }}} // namespace lsst::afw::table
108 
109 #endif // !AFW_TABLE_KeyBase_h_INCLUDED
static bool const HAS_NAMED_SUBFIELDS
Definition: KeyBase.h:19
A base class for Key that allows subfield keys to be extracted for some field types.
Definition: KeyBase.h:17
Base class for all records.
Definition: BaseRecord.h:27
A class used as a handle to a particular field in a table.
Definition: fwd.h:44
Tag types used to declare specialized field types.
Definition: misc.h:35