LSSTApplications
17.0+11,17.0+34,17.0+56,17.0+57,17.0+59,17.0+7,17.0-1-g377950a+33,17.0.1-1-g114240f+2,17.0.1-1-g4d4fbc4+28,17.0.1-1-g55520dc+49,17.0.1-1-g5f4ed7e+52,17.0.1-1-g6dd7d69+17,17.0.1-1-g8de6c91+11,17.0.1-1-gb9095d2+7,17.0.1-1-ge9fec5e+5,17.0.1-1-gf4e0155+55,17.0.1-1-gfc65f5f+50,17.0.1-1-gfc6fb1f+20,17.0.1-10-g87f9f3f+1,17.0.1-11-ge9de802+16,17.0.1-16-ga14f7d5c+4,17.0.1-17-gc79d625+1,17.0.1-17-gdae4c4a+8,17.0.1-2-g26618f5+29,17.0.1-2-g54f2ebc+9,17.0.1-2-gf403422+1,17.0.1-20-g2ca2f74+6,17.0.1-23-gf3eadeb7+1,17.0.1-3-g7e86b59+39,17.0.1-3-gb5ca14a,17.0.1-3-gd08d533+40,17.0.1-30-g596af8797,17.0.1-4-g59d126d+4,17.0.1-4-gc69c472+5,17.0.1-6-g5afd9b9+4,17.0.1-7-g35889ee+1,17.0.1-7-gc7c8782+18,17.0.1-9-gc4bbfb2+3,w.2019.22
LSSTDataManagementBasePackage
|
Key for type-safe lookup in a GenericMap. More...
#include <GenericMap.h>
Public Types | |
using | KeyType = K |
using | ValueType = V |
Public Member Functions | |
constexpr | Key (K id) |
Construct a new key. More... | |
Key (Key const &)=default | |
Key (Key &&)=default | |
Key & | operator= (Key const &)=delete |
Key & | operator= (Key &&)=delete |
constexpr K const & | getId () const noexcept |
Return the identifier of this field. More... | |
template<typename U > | |
constexpr bool | operator< (Key< K, U > const &other) const noexcept |
Define sort order for Keys. More... | |
std::size_t | hash_value () const noexcept |
Return a hash of this object. More... | |
constexpr bool | operator== (Key< K, V > const &other) const noexcept |
Test for key equality. More... | |
template<typename U > | |
constexpr std::enable_if_t<!std::is_same< U, V >::value, bool > | operator== (Key< K, U > const &) const noexcept |
Test for key equality. More... | |
template<typename U > | |
constexpr bool | operator!= (Key< K, U > const &other) const noexcept |
Test for key equality. More... | |
Related Functions | |
(Note that these are not member functions.) | |
template<typename V , typename K > | |
constexpr Key< K, V > | makeKey (K const &id) |
Factory function for Key, to enable type parameter inference. More... | |
template<typename K , typename V > | |
std::ostream & | operator<< (std::ostream &os, Key< K, V > const &key) |
Output operator for Key. More... | |
Key for type-safe lookup in a GenericMap.
K | the logical type of the key (e.g., a string) |
V | the type of the value mapped to this key |
Key objects are equality-comparable, hashable, sortable, or printable if and only if K
is comparable, hashable, sortable, or printable, respectively. Key can be used in compile-time expressions if and only if K
can (in particular, Key<std::string, V>
cannot).
Definition at line 63 of file GenericMap.h.
using lsst::afw::typehandling::Key< K, V >::KeyType = K |
Definition at line 65 of file GenericMap.h.
using lsst::afw::typehandling::Key< K, V >::ValueType = V |
Definition at line 66 of file GenericMap.h.
|
inline |
Construct a new key.
id | the identifier of the field. For most purposes, this value is the actual key; it can be retrieved by calling getId(). |
K
.Definition at line 79 of file GenericMap.h.
|
default |
|
default |
|
inlinenoexcept |
Return the identifier of this field.
The identifier serves as the "key" for the map abstraction represented by GenericMap.
Definition at line 94 of file GenericMap.h.
|
inlinenoexcept |
|
inlinenoexcept |
Test for key equality.
A key is considered equal to another key if and only if their getId() are equal and their value types are exactly the same (including const/volatile qualifications).
Definition at line 112 of file GenericMap.h.
|
inlinenoexcept |
Define sort order for Keys.
This must be expressed as operator<
instead of std::less because only std::less<void> supports arguments of mixed types, and it cannot be specialized.
other | the key, possibly of a different type, to compare to |
this->getId() < other.getId()
K
does, but is not consistent with equality. In particular, keys with the same value of getId()
but different types will be equivalent but not equal. Definition at line 132 of file GenericMap.h.
|
delete |
|
delete |
|
inlinenoexcept |
Test for key equality.
A key is considered equal to another key if and only if their getId() are equal and their value types are exactly the same (including const/volatile qualifications).
Definition at line 104 of file GenericMap.h.
|
inlinenoexcept |
Test for key equality.
A key is considered equal to another key if and only if their getId() are equal and their value types are exactly the same (including const/volatile qualifications).
Definition at line 107 of file GenericMap.h.
|
related |
Factory function for Key, to enable type parameter inference.
id | the key ID to create. |
K
.Calling this function prevents you from having to explicitly name the key type:
auto key = makeKey<int>("foo");
Definition at line 162 of file GenericMap.h.
|
related |
Output operator for Key.
The output will use C++ template notation for the key; for example, a key "foo" pointing to an int
may print as "foo<int>"
.
os | the desired output stream |
key | the key to print |
os
K
is exception-safe.Definition at line 185 of file GenericMap.h.