LSSTApplications
10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
home
lsstsw
stack
Linux64
afw
11.0-2-g04d2804
include
lsst
afw
table
Field.h
Go to the documentation of this file.
1
// -*- lsst-c++ -*-
2
#ifndef AFW_TABLE_Field_h_INCLUDED
3
#define AFW_TABLE_Field_h_INCLUDED
4
5
#include <iostream>
6
7
#include "
lsst/afw/table/FieldBase.h
"
8
9
namespace
lsst {
namespace
afw {
namespace
table {
10
21
template
<
typename
T>
22
struct
Field
:
public
FieldBase
<T> {
23
25
typedef
typename
FieldBase<T>::Element
Element
;
26
46
Field
(
47
std::string
const
&
name
,
48
std::string
const
& doc,
49
std::string
const
& units =
""
,
50
FieldBase<T>
const
& size =
FieldBase<T>
()
51
) :
FieldBase
<T>(size),
_name
(name),
_doc
(doc),
_units
(units) {}
52
69
Field
(
70
std::string
const
& name,
71
std::string
const
& doc,
72
FieldBase<T>
const
& size
73
) :
FieldBase
<T>(size),
_name
(name),
_doc
(doc),
_units
() {}
74
75
#ifdef SWIG
76
// SWIG doesn't understand implicit conversions from int to FieldBase, even with %implicitconv.
77
// We don't need to define these, because when SWIG calls them in its implementation, the
78
// implicit conversion *will* work.
79
Field
(
80
std::string
const
& name,
81
std::string
const
& doc,
82
std::string
const
& units,
83
int
size
84
);
85
Field
(
86
std::string
const
& name,
87
std::string
const
& doc,
88
int
size
89
);
90
#endif
91
93
std::string
const
&
getName
()
const
{
return
_name
; }
94
96
std::string
const
&
getDoc
()
const
{
return
_doc
; }
97
99
std::string
const
&
getUnits
()
const
{
return
_units
; }
100
102
inline
friend
std::ostream & operator<<(std::ostream & os, Field<T>
const
&
field
) {
103
os <<
"Field['"
<<
Field<T>::getTypeString
()
104
<<
"'](name=\""
<<
field
.getName() <<
"\""
;
105
if
(!
field
.getDoc().empty())
106
os <<
", doc=\""
<<
field
.getDoc() <<
"\""
;
107
if
(!
field
.getUnits().empty())
108
os <<
", units=\""
<<
field
.getUnits() <<
"\""
;
109
field
.stream(os);
110
return
os <<
")"
;
111
}
112
114
Field<T>
copyRenamed
(std::string
const
& newName)
const
{
115
return
Field<T>
(newName,
getDoc
(),
getUnits
(), *
this
);
116
}
117
118
private
:
119
std::string
_name
;
120
std::string
_doc
;
121
std::string
_units
;
122
};
123
124
}}}
// namespace lsst::afw::table
125
126
#endif // !AFW_TABLE_Field_h_INCLUDED
lsst::afw::table::Field::copyRenamed
Field< T > copyRenamed(std::string const &newName) const
Return a new Field with a new name and other properties the same as this.
Definition:
Field.h:114
lsst::afw::table::FieldBase
Field base class default implementation (used for numeric scalars and Angle).
Definition:
FieldBase.h:48
lsst::afw::table::Field::_name
std::string _name
Definition:
Field.h:119
name
table::Key< std::string > name
Definition:
ApCorrMap.cc:71
lsst::afw::table::Field::getName
std::string const & getName() const
Return the name of the field.
Definition:
Field.h:93
lsst::afw::table::Field::Field
Field(std::string const &name, std::string const &doc, FieldBase< T > const &size)
Construct a new field.
Definition:
Field.h:69
lsst::afw::table::Field::getDoc
std::string const & getDoc() const
Return the documentation for the field.
Definition:
Field.h:96
lsst::afw::table::Field
A description of a field in a table.
Definition:
Field.h:22
lsst::afw::table::Field::_doc
std::string _doc
Definition:
Field.h:120
lsst::afw::table::Field::Field
Field(std::string const &name, std::string const &doc, std::string const &units="", FieldBase< T > const &size=FieldBase< T >())
Construct a new field.
Definition:
Field.h:46
lsst::afw::table::FieldBase::Element
T Element
the type of subfields (the same as the type itself for scalars)
Definition:
FieldBase.h:53
lsst::afw::table::Field::_units
std::string _units
Definition:
Field.h:121
FieldBase.h
lsst::afw::table::Field::Element
FieldBase< T >::Element Element
Type used to store field data in the table (a field may have multiple elements).
Definition:
Field.h:25
lsst::afw::table::Field::getUnits
std::string const & getUnits() const
Return the units for the field.
Definition:
Field.h:99
field
table::Key< int > field
Definition:
ApCorrMap.cc:72
lsst::afw::table::FieldBase::getTypeString
static std::string getTypeString()
Return a string description of the field type.
Generated on Thu Sep 24 2015 02:29:16 for LSSTApplications by
1.8.5