|
lsst.afw
14.0-52-g19103d347
|
An object passed to Persistable::write to allow it to persist itself. More...
#include <OutputArchive.h>
Public Member Functions | |
| BaseCatalog | makeCatalog (Schema const &schema) |
| Return a new, empty catalog with the given schema. More... | |
| void | saveEmpty () |
| Indicate that the object being persisted has no state, and hence will never call makeCatalog() or saveCatalog(). More... | |
| void | saveCatalog (BaseCatalog const &catalog) |
| Save a catalog in the archive. More... | |
| ~OutputArchiveHandle () | |
| OutputArchiveHandle (const OutputArchiveHandle &)=delete | |
| OutputArchiveHandle & | operator= (const OutputArchiveHandle &)=delete |
| OutputArchiveHandle (OutputArchiveHandle &&)=delete | |
| OutputArchiveHandle & | operator= (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 InputArchive. More... | |
| 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 InputArchive. More... | |
Friends | |
| class | OutputArchive::Impl |
An object passed to Persistable::write to allow it to persist itself.
OutputArchiveHandle provides an interface to add additional catalogs and save nested Persistables to the same archive.
Definition at line 117 of file OutputArchive.h.
| lsst::afw::table::io::OutputArchiveHandle::~OutputArchiveHandle | ( | ) |
|
delete |
|
delete |
| BaseCatalog lsst::afw::table::io::OutputArchiveHandle::makeCatalog | ( | Schema const & | schema | ) |
Return a new, empty catalog with the given schema.
All catalogs passed to saveCatalog should be originally created by makeCatalog, or at least share the same table.
|
delete |
|
delete |
| int lsst::afw::table::io::OutputArchiveHandle::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 InputArchive.
If permissive is true and obj->isPersistable() is false, the object will not be saved but 0 will be returned instead of throwing an exception.
If the given pointer has already been saved, it will not be written again and the same ID will be returned as the first time it was saved.
If the given pointer is null, the returned ID is always 0, which may be used to retrieve null pointers from an InputArchive.
It is expected that the shared_ptr form will usually be used, as Persistables are typically held by shared_ptr. But we expose the lower-level raw-pointer form so users aren't forced to clone objects before persisting them if they don't already have a shared_ptr.
|
inline |
Save an object to the archive and return a unique ID that can be used to retrieve it from an InputArchive.
If permissive is true and obj->isPersistable() is false, the object will not be saved but 0 will be returned instead of throwing an exception.
If the given pointer has already been saved, it will not be written again and the same ID will be returned as the first time it was saved.
If the given pointer is null, the returned ID is always 0, which may be used to retrieve null pointers from an InputArchive.
It is expected that the shared_ptr form will usually be used, as Persistables are typically held by shared_ptr. But we expose the lower-level raw-pointer form so users aren't forced to clone objects before persisting them if they don't already have a shared_ptr.
Definition at line 144 of file OutputArchive.h.
| void lsst::afw::table::io::OutputArchiveHandle::saveCatalog | ( | BaseCatalog const & | catalog | ) |
Save a catalog in the archive.
The catalog must have been created using makeCatalog, or be a shallow copy or subset of such a catalog.
| void lsst::afw::table::io::OutputArchiveHandle::saveEmpty | ( | ) |
Indicate that the object being persisted has no state, and hence will never call makeCatalog() or saveCatalog().
|
friend |
Definition at line 160 of file OutputArchive.h.
1.8.13