LSST Applications  21.0.0-147-g0e635eb1+1acddb5be5,22.0.0+052faf71bd,22.0.0+1ea9a8b2b2,22.0.0+6312710a6c,22.0.0+729191ecac,22.0.0+7589c3a021,22.0.0+9f079a9461,22.0.1-1-g7d6de66+b8044ec9de,22.0.1-1-g87000a6+536b1ee016,22.0.1-1-g8e32f31+6312710a6c,22.0.1-10-gd060f87+016f7cdc03,22.0.1-12-g9c3108e+df145f6f68,22.0.1-16-g314fa6d+c825727ab8,22.0.1-19-g93a5c75+d23f2fb6d8,22.0.1-19-gb93eaa13+aab3ef7709,22.0.1-2-g8ef0a89+b8044ec9de,22.0.1-2-g92698f7+9f079a9461,22.0.1-2-ga9b0f51+052faf71bd,22.0.1-2-gac51dbf+052faf71bd,22.0.1-2-gb66926d+6312710a6c,22.0.1-2-gcb770ba+09e3807989,22.0.1-20-g32debb5+b8044ec9de,22.0.1-23-gc2439a9a+fb0756638e,22.0.1-3-g496fd5d+09117f784f,22.0.1-3-g59f966b+1e6ba2c031,22.0.1-3-g849a1b8+f8b568069f,22.0.1-3-gaaec9c0+c5c846a8b1,22.0.1-32-g5ddfab5d3+60ce4897b0,22.0.1-4-g037fbe1+64e601228d,22.0.1-4-g8623105+b8044ec9de,22.0.1-5-g096abc9+d18c45d440,22.0.1-5-g15c806e+57f5c03693,22.0.1-7-gba73697+57f5c03693,master-g6e05de7fdc+c1283a92b8,master-g72cdda8301+729191ecac,w.2021.39
LSST Data Management Base Package
OutputArchive.h
Go to the documentation of this file.
1 // -*- lsst-c++ -*-
2 #ifndef AFW_TABLE_IO_OutputArchive_h_INCLUDED
3 #define AFW_TABLE_IO_OutputArchive_h_INCLUDED
4 
5 #include "lsst/base.h"
7 
8 namespace lsst {
9 namespace afw {
10 namespace table {
11 
12 class Schema;
13 class BaseRecord;
14 template <typename RecordT>
15 class CatalogT;
16 using BaseCatalog = CatalogT<BaseRecord>;
17 
18 namespace io {
19 
20 class Persistable;
21 class OutputArchiveHandle;
22 
35 public:
36  friend class OutputArchiveHandle;
37 
39  OutputArchive();
40 
44 
48 
49  // (trivial) destructor must be defined in the source for pimpl idiom.
51 
53 
80  int put(std::shared_ptr<Persistable const> obj, bool permissive = false);
81  int put(Persistable const * obj, bool permissive = false);
82  int put(Persistable const & obj, bool permissive = false) { return put(&obj, permissive); }
84 
89  BaseCatalog const& getIndexCatalog() const;
90 
92  BaseCatalog const& getCatalog(int n) const;
93 
95  std::size_t countCatalogs() const;
96 
104  void writeFits(fits::Fits& fitsfile) const;
105 
106 private:
107  class Impl;
108 
109  std::shared_ptr<Impl> _impl;
110 };
111 
119 public:
127 
132  void saveEmpty();
133 
140  void saveCatalog(BaseCatalog const& catalog);
141 
144  int put(Persistable const* obj, bool permissive = false);
145  int put(std::shared_ptr<Persistable const> obj, bool permissive = false);
146  int put(Persistable const & obj, bool permissive = false) { return put(&obj, permissive); }
148 
150 
151  // No copying
154 
155  // No moving
158 
159 private:
160  friend class OutputArchive::Impl;
161 
162  OutputArchiveHandle(int id, std::string const& name, std::string const& module,
164 
165  int _id;
166  int _catPersistable;
167  std::string _name;
168  std::string _module;
170 };
171 } // namespace io
172 } // namespace table
173 } // namespace afw
174 } // namespace lsst
175 
176 #endif // !AFW_TABLE_IO_OutputArchive_h_INCLUDED
table::Key< std::string > name
Definition: Amplifier.cc:116
table::Schema schema
Definition: python.h:134
Basic LSST definitions.
A simple struct that combines the two arguments that must be passed to most cfitsio routines and cont...
Definition: fits.h:297
Defines the fields and offsets for a table.
Definition: Schema.h:51
An object passed to Persistable::write to allow it to persist itself.
OutputArchiveHandle & operator=(OutputArchiveHandle &&)=delete
OutputArchiveHandle(OutputArchiveHandle &&)=delete
void saveCatalog(BaseCatalog const &catalog)
Save a catalog in the archive.
OutputArchiveHandle(const OutputArchiveHandle &)=delete
void saveEmpty()
Indicate that the object being persisted has no state, and hence will never call makeCatalog() or sav...
BaseCatalog makeCatalog(Schema const &schema)
Return a new, empty catalog with the given schema.
OutputArchiveHandle & operator=(const OutputArchiveHandle &)=delete
int put(Persistable const &obj, bool permissive=false)
Save an object to the archive and return a unique ID that can be used to retrieve it from an InputArc...
int put(Persistable const *obj, bool permissive=false)
Save an object to the archive and return a unique ID that can be used to retrieve it from an InputArc...
A multi-catalog archive object used to save table::io::Persistable objects.
Definition: OutputArchive.h:34
OutputArchive(OutputArchive const &other)
Copy-construct an OutputArchive. Saved objects are not deep-copied.
std::size_t countCatalogs() const
Return the total number of catalogs, including the index.
int put(Persistable const &obj, bool permissive=false)
Save an object to the archive and return a unique ID that can be used to retrieve it from an InputArc...
Definition: OutputArchive.h:82
int put(std::shared_ptr< Persistable const > obj, bool permissive=false)
Save an object to the archive and return a unique ID that can be used to retrieve it from an InputArc...
void writeFits(fits::Fits &fitsfile) const
Write the archive to an already-open FITS object.
BaseCatalog const & getCatalog(int n) const
Return the nth catalog. Catalog 0 is always the index catalog.
OutputArchive & operator=(OutputArchive const &other)
Assign from another OutputArchive. Saved objects are not deep-copied.
BaseCatalog const & getIndexCatalog() const
Return the index catalog that specifies where objects are stored in the data catalogs.
OutputArchive()
Construct an empty OutputArchive containing no objects.
A base class for objects that can be persisted via afw::table::io Archive classes.
Definition: Persistable.h:74
class[[deprecated("Removed with no replacement (but see lsst::afw::image::TransmissionCurve). Will be " "removed after v22.")]] FilterProperty final
Describe the properties of a Filter (e.g.
Definition: Filter.h:53
CatalogT< BaseRecord > BaseCatalog
Definition: fwd.h:72
A base class for image defects.