LSST Applications
21.0.0-172-gfb10e10a+18fedfabac,22.0.0+297cba6710,22.0.0+80564b0ff1,22.0.0+8d77f4f51a,22.0.0+a28f4c53b1,22.0.0+dcf3732eb2,22.0.1-1-g7d6de66+2a20fdde0d,22.0.1-1-g8e32f31+297cba6710,22.0.1-1-geca5380+7fa3b7d9b6,22.0.1-12-g44dc1dc+2a20fdde0d,22.0.1-15-g6a90155+515f58c32b,22.0.1-16-g9282f48+790f5f2caa,22.0.1-2-g92698f7+dcf3732eb2,22.0.1-2-ga9b0f51+7fa3b7d9b6,22.0.1-2-gd1925c9+bf4f0e694f,22.0.1-24-g1ad7a390+a9625a72a8,22.0.1-25-g5bf6245+3ad8ecd50b,22.0.1-25-gb120d7b+8b5510f75f,22.0.1-27-g97737f7+2a20fdde0d,22.0.1-32-gf62ce7b1+aa4237961e,22.0.1-4-g0b3f228+2a20fdde0d,22.0.1-4-g243d05b+871c1b8305,22.0.1-4-g3a563be+32dcf1063f,22.0.1-4-g44f2e3d+9e4ab0f4fa,22.0.1-42-gca6935d93+ba5e5ca3eb,22.0.1-5-g15c806e+85460ae5f3,22.0.1-5-g58711c4+611d128589,22.0.1-5-g75bb458+99c117b92f,22.0.1-6-g1c63a23+7fa3b7d9b6,22.0.1-6-g50866e6+84ff5a128b,22.0.1-6-g8d3140d+720564cf76,22.0.1-6-gd805d02+cc5644f571,22.0.1-8-ge5750ce+85460ae5f3,master-g6e05de7fdc+babf819c66,master-g99da0e417a+8d77f4f51a,w.2021.48
LSST Data Management Base Package
|
An abstract base class for collections of Detectors and specific subclasses thereof. More...
#include <DetectorCollection.h>
Public Types | |
using | NameMap = std::unordered_map< std::string, std::shared_ptr< T > > |
using | IdMap = std::map< int, std::shared_ptr< T > > |
using | List = std::vector< std::shared_ptr< T > > |
Public Member Functions | |
virtual | ~DetectorCollectionBase () noexcept=0 |
NameMap const & | getNameMap () const noexcept |
Get a map keyed and ordered by name. More... | |
IdMap const & | getIdMap () const noexcept |
Get a map keyed and ordered by ID. More... | |
std::size_t | size () const noexcept |
Get the number of detectors. More... | |
bool | empty () const noexcept |
Determine if the collection contains any detectors. More... | |
std::shared_ptr< T > | operator[] (std::string const &name) const |
Implement the [name] operator. More... | |
std::shared_ptr< T > | operator[] (int id) const |
Implement the [id] operator. More... | |
std::shared_ptr< T > | get (std::string const &name, std::shared_ptr< T > def=nullptr) const |
Retrieve a detector by name, or fall back to a default. More... | |
std::shared_ptr< T > | get (int id, std::shared_ptr< T > def=nullptr) const |
Retrieve a detector by ID, or fall back to a default. More... | |
Protected Member Functions | |
DetectorCollectionBase (List const &detectorList) | |
DetectorCollectionBase () noexcept=default | |
DetectorCollectionBase (DetectorCollectionBase const &)=default | |
DetectorCollectionBase (DetectorCollectionBase &&)=default | |
DetectorCollectionBase & | operator= (DetectorCollectionBase const &)=default |
DetectorCollectionBase & | operator= (DetectorCollectionBase &&)=default |
void | add (std::shared_ptr< T > detector) |
Add a detector to the collection. More... | |
void | remove (std::string const &name) |
void | remove (int id) |
An abstract base class for collections of Detectors and specific subclasses thereof.
T | Element type; either Detector or a subclass thereof. |
This class provides the common interface and implementation for DetectorCollection
(which holds true Detector
instances) and Camera::Builder
(which holds Detector::InCameraBuilder
instances). It is not intended to define an interface independent of those classes.
Definition at line 49 of file DetectorCollection.h.
using lsst::afw::cameraGeom::DetectorCollectionBase< T >::IdMap = std::map<int, std::shared_ptr<T> > |
Definition at line 53 of file DetectorCollection.h.
using lsst::afw::cameraGeom::DetectorCollectionBase< T >::List = std::vector<std::shared_ptr<T> > |
Definition at line 54 of file DetectorCollection.h.
using lsst::afw::cameraGeom::DetectorCollectionBase< T >::NameMap = std::unordered_map<std::string, std::shared_ptr<T> > |
Definition at line 52 of file DetectorCollection.h.
|
pure virtualdefaultnoexcept |
|
explicitprotected |
Definition at line 74 of file DetectorCollection.cc.
|
protecteddefaultnoexcept |
|
protecteddefault |
|
protecteddefault |
|
protected |
Add a detector to the collection.
[in] | detector | New detector to add to the collection. |
pex::exceptions::RuntimeError | Thrown if the ID and/or name conflict with those of detectors already in the collection. |
Definition at line 89 of file DetectorCollection.cc.
|
inlinenoexcept |
Determine if the collection contains any detectors.
Definition at line 72 of file DetectorCollection.h.
std::shared_ptr< T > lsst::afw::cameraGeom::DetectorCollectionBase< T >::get | ( | int | id, |
std::shared_ptr< T > | def = nullptr |
||
) | const |
Retrieve a detector by ID, or fall back to a default.
[in] | id | detector id |
[in] | def | default detector to return. This defaults to nullptr . |
Definition at line 65 of file DetectorCollection.cc.
std::shared_ptr< T > lsst::afw::cameraGeom::DetectorCollectionBase< T >::get | ( | std::string const & | name, |
std::shared_ptr< T > | def = nullptr |
||
) | const |
Retrieve a detector by name, or fall back to a default.
[in] | name | detector name |
[in] | def | default detector to return. This defaults to nullptr . |
Definition at line 56 of file DetectorCollection.cc.
|
inlinenoexcept |
Get a map keyed and ordered by ID.
Definition at line 62 of file DetectorCollection.h.
|
inlinenoexcept |
Get a map keyed and ordered by name.
Definition at line 59 of file DetectorCollection.h.
|
protecteddefault |
|
protecteddefault |
std::shared_ptr< T > lsst::afw::cameraGeom::DetectorCollectionBase< T >::operator[] | ( | int | id | ) | const |
Implement the [id] operator.
[in] | id | detector name |
Definition at line 46 of file DetectorCollection.cc.
std::shared_ptr< T > lsst::afw::cameraGeom::DetectorCollectionBase< T >::operator[] | ( | std::string const & | name | ) | const |
Implement the [name] operator.
[in] | name | detector name |
Definition at line 36 of file DetectorCollection.cc.
|
protected |
Definition at line 144 of file DetectorCollection.cc.
|
protected |
Definition at line 129 of file DetectorCollection.cc.
|
inlinenoexcept |
Get the number of detectors.
Renamed to __len__
in Python.
Definition at line 67 of file DetectorCollection.h.