LSSTApplications
18.0.0+106,18.0.0+50,19.0.0,19.0.0+1,19.0.0+10,19.0.0+11,19.0.0+13,19.0.0+17,19.0.0+2,19.0.0-1-g20d9b18+6,19.0.0-1-g425ff20,19.0.0-1-g5549ca4,19.0.0-1-g580fafe+6,19.0.0-1-g6fe20d0+1,19.0.0-1-g7011481+9,19.0.0-1-g8c57eb9+6,19.0.0-1-gb5175dc+11,19.0.0-1-gdc0e4a7+9,19.0.0-1-ge272bc4+6,19.0.0-1-ge3aa853,19.0.0-10-g448f008b,19.0.0-12-g6990b2c,19.0.0-2-g0d9f9cd+11,19.0.0-2-g3d9e4fb2+11,19.0.0-2-g5037de4,19.0.0-2-gb96a1c4+3,19.0.0-2-gd955cfd+15,19.0.0-3-g2d13df8,19.0.0-3-g6f3c7dc,19.0.0-4-g725f80e+11,19.0.0-4-ga671dab3b+1,19.0.0-4-gad373c5+3,19.0.0-5-ga2acb9c+2,19.0.0-5-gfe96e6c+2,w.2020.01
LSSTDataManagementBasePackage
|
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 an unordered map keyed by name. More... | |
IdMap const & | getIdMap () const noexcept |
Get an unordered map keyed 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 | ( | 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.
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.
|
inlinenoexcept |
Get an unordered map keyed by ID.
Definition at line 62 of file DetectorCollection.h.
|
inlinenoexcept |
Get an unordered map keyed by name.
Definition at line 59 of file DetectorCollection.h.
|
protecteddefault |
|
protecteddefault |
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.
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.
|
protected |
Definition at line 129 of file DetectorCollection.cc.
|
protected |
Definition at line 144 of file DetectorCollection.cc.
|
inlinenoexcept |
Get the number of detectors.
Renamed to __len__
in Python.
Definition at line 67 of file DetectorCollection.h.