LSSTApplications  1.1.2+25,10.0+13,10.0+132,10.0+133,10.0+224,10.0+41,10.0+8,10.0-1-g0f53050+14,10.0-1-g4b7b172+19,10.0-1-g61a5bae+98,10.0-1-g7408a83+3,10.0-1-gc1e0f5a+19,10.0-1-gdb4482e+14,10.0-11-g3947115+2,10.0-12-g8719d8b+2,10.0-15-ga3f480f+1,10.0-2-g4f67435,10.0-2-gcb4bc6c+26,10.0-28-gf7f57a9+1,10.0-3-g1bbe32c+14,10.0-3-g5b46d21,10.0-4-g027f45f+5,10.0-4-g86f66b5+2,10.0-4-gc4fccf3+24,10.0-40-g4349866+2,10.0-5-g766159b,10.0-5-gca2295e+25,10.0-6-g462a451+1
LSSTDataManagementBasePackage
InputArchive.h
Go to the documentation of this file.
1 // -*- lsst-c++ -*-
2 #ifndef AFW_TABLE_IO_InputArchive_h_INCLUDED
3 #define AFW_TABLE_IO_InputArchive_h_INCLUDED
4 
5 #include <map>
6 
7 #include "lsst/base.h"
9 
10 namespace lsst { namespace afw { namespace table {
11 
12 class BaseRecord;
13 template <typename RecordT> class CatalogT;
14 typedef CatalogT<BaseRecord> BaseCatalog;
15 
16 namespace io {
17 
18 class CatalogVector;
19 
28 class InputArchive {
29 public:
30 
31  typedef std::map<int,PTR(Persistable)> Map;
32 
34  InputArchive();
35 
37  InputArchive(BaseCatalog const & index, CatalogVector const & dataCatalogs);
38 
40  InputArchive(InputArchive const & other);
41 
43  InputArchive & operator=(InputArchive const & other);
44 
45  ~InputArchive();
46 
52  PTR(Persistable) get(int id) const;
53 
55  template <typename T>
56  PTR(T) get(int id) const {
57  PTR(T) p = boost::dynamic_pointer_cast<T>(get(id));
58  LSST_ARCHIVE_ASSERT(p || id == 0);
59  return p;
60  }
61 
63  Map const & getAll() const;
64 
70  static InputArchive readFits(fits::Fits & fitsfile);
71 
72 private:
73 
74  class Impl;
75 
76  InputArchive(PTR(Impl) impl);
77 
78  PTR(Impl) _impl;
79 };
80 
81 }}}} // namespace lsst::afw::table::io
82 
83 #endif // !AFW_TABLE_IO_InputArchive_h_INCLUDED
InputArchive()
Construct an empty InputArchive that contains no objects.
CatalogT< BaseRecord > BaseCatalog
Definition: fwd.h:61
A custom container class for records, based on std::vector.
Definition: Catalog.h:94
boost::shared_ptr< Impl > _impl
Definition: InputArchive.h:78
Map const & getAll() const
Load and return all objects in the archive.
#define PTR(...)
Definition: base.h:41
A simple struct that combines the two arguments that must be passed to most cfitsio routines and cont...
Definition: fits.h:194
A base class for objects that can be persisted via afw::table::io Archive classes.
Definition: Persistable.h:74
boost::shared_ptr< Persistable > get(int id) const
Load the Persistable with the given ID and return it.
std::map< int, boost::shared_ptr< Persistable > > Map
Definition: InputArchive.h:31
static InputArchive readFits(fits::Fits &fitsfile)
Read an object from an already open FITS object.
A vector of catalogs used by Persistable.
Definition: CatalogVector.h:26
InputArchive & operator=(InputArchive const &other)
Assignment. Does not deep-copy loaded Persistables.
int id
Definition: CR.cc:151
#define LSST_ARCHIVE_ASSERT(EXPR)
An assertion macro used to validate the structure of an InputArchive.
Definition: Persistable.h:47
A multi-catalog archive object used to load table::io::Persistable objects.
Definition: InputArchive.h:28