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
Key.h
Go to the documentation of this file.
1
// -*- lsst-c++ -*-
2
#ifndef AFW_TABLE_Key_h_INCLUDED
3
#define AFW_TABLE_Key_h_INCLUDED
4
5
#include "
lsst/afw/table/FieldBase.h
"
6
#include "
lsst/afw/table/Flag.h
"
7
#include "
lsst/afw/table/KeyBase.h
"
8
9
namespace
lsst {
namespace
afw {
namespace
table {
10
11
namespace
detail {
12
13
class
Access;
14
15
}
// namespace detail
16
49
template
<
typename
T>
50
class
Key :
public
KeyBase<T>,
public
FieldBase<T> {
51
public
:
52
54
63
template
<
typename
OtherT>
bool
operator==
(
Key<OtherT>
const
& other)
const
{
return
false
; }
64
template
<
typename
OtherT>
bool
operator!=
(
Key<OtherT>
const
& other)
const
{
return
true
; }
65
66
bool
operator==
(
Key
const
& other)
const
{
67
return
_offset
== other._offset && this->
getElementCount
() == other.getElementCount();
68
}
69
bool
operator!=
(
Key
const
& other)
const
{
return
!this->
operator==
(other); }
71
73
int
getOffset
()
const
{
return
_offset
; }
74
83
bool
isValid
()
const
{
return
_offset
>= 0; }
84
90
Key
() :
FieldBase
<T>(
FieldBase
<T>::
makeDefault
()),
_offset
(-1) {}
91
93
inline
friend
std::ostream & operator<<(std::ostream & os, Key<T>
const
& key) {
94
return
os <<
"Key<"
<<
Key<T>::getTypeString
() <<
">(offset="
<< key.getOffset()
95
<<
", nElements="
<< key.getElementCount() <<
")"
;
96
}
97
98
private
:
99
100
friend
class
detail::Access
;
101
friend
class
BaseRecord
;
102
103
explicit
Key
(
int
offset,
FieldBase<T>
const
& fb =
FieldBase<T>
())
104
:
FieldBase
<T>(fb),
_offset
(offset) {}
105
106
int
_offset
;
107
};
108
109
}}}
// namespace lsst::afw::table
110
111
#endif // !AFW_TABLE_Key_h_INCLUDED
lsst::afw::table::Key::isValid
bool isValid() const
Return true if the key was initialized to valid offset.
Definition:
Key.h:83
lsst::afw::table::FieldBase
Field base class default implementation (used for numeric scalars and Angle).
Definition:
FieldBase.h:48
lsst::afw::table::Key::_offset
int _offset
Definition:
Key.h:106
lsst::afw::table::Key::operator!=
bool operator!=(Key< OtherT > const &other) const
Equality comparison.
Definition:
Key.h:64
Flag.h
lsst::afw::table::Key::operator!=
bool operator!=(Key const &other) const
Equality comparison.
Definition:
Key.h:69
lsst::afw::table::detail::Access
Definition:
Access.h:29
KeyBase.h
lsst::afw::table::Key::getOffset
int getOffset() const
Return the offset (in bytes) of this field within a record.
Definition:
Key.h:73
lsst::afw::table::FieldBase::getElementCount
int getElementCount() const
Return the number of subfield elements (always one for scalars).
Definition:
FieldBase.h:56
lsst::afw::table::Key::operator==
bool operator==(Key const &other) const
Equality comparison.
Definition:
Key.h:66
lsst::afw::table::BaseRecord
Base class for all records.
Definition:
BaseRecord.h:27
lsst::afw::table::Key
A class used as a handle to a particular field in a table.
Definition:
fwd.h:44
FieldBase.h
lsst::afw::table::Key::Key
Key()
Default construct a field.
Definition:
Key.h:90
lsst::afw::table::Key::operator==
bool operator==(Key< OtherT > const &other) const
Equality comparison.
Definition:
Key.h:63
lsst::afw::table::FieldBase::makeDefault
static FieldBase makeDefault()
Needed to allow Keys to be default-constructed.
Definition:
FieldBase.h:77
lsst::afw::table::Key::Key
Key(int offset, FieldBase< T > const &fb=FieldBase< T >())
Definition:
Key.h:103
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