18void Persistable::writeFits(fits::Fits &fitsfile)
const {
21 archive.writeFits(fitsfile);
24void Persistable::writeFits(std::string
const &fileName, std::string
const &mode)
const {
29void Persistable::writeFits(fits::MemFileManager &manager, std::string
const &mode)
const {
34std::string Persistable::getPersistenceName()
const {
return std::string(); }
36std::string Persistable::getPythonModule()
const {
return std::string(); }
39 assert(!isPersistable());
41 "afw::table-based persistence is not supported for this object.");
44std::shared_ptr<Persistable> Persistable::_readFits(std::string
const &fileName,
int hdu) {
47 return _readFits(fitsfile);
50std::shared_ptr<Persistable> Persistable::_readFits(fits::MemFileManager &manager,
int hdu) {
53 return _readFits(fitsfile);
56std::shared_ptr<Persistable> Persistable::_readFits(fits::Fits &fitsfile) {
58 return archive.get(1);
65using RegistryMap = std::map<std::string, const PersistableFactory *>;
67RegistryMap &getRegistry() {
68 static RegistryMap instance;
77 RegistryMap::const_iterator i = getRegistry().find(name);
78 if (i == getRegistry().end()) {
79 if (!module.
empty()) {
83 pex::exceptions::NotFoundError,
85 "PersistableFactory with name '%s' not found, and import of module "
86 "'%s' failed (possibly because Python calls were not available from C++).") %
90 i = getRegistry().find(name);
91 if (i == getRegistry().end()) {
93 pex::exceptions::LogicError,
95 "PersistableFactory with name '%s' not found even after successful import "
96 "of module '%s'. Please report this as a bug in the persistence "
97 "implementation for this object.") %
103 pex::exceptions::LogicError,
105 "PersistableFactory with name '%s' not found, and no Python module to import "
106 "was provided. Please report this as a bug in the persistence implementation "
107 "for this object.") %
#define LSST_EXCEPT(type,...)
An object passed to Persistable::write to allow it to persist itself.
A multi-catalog archive object used to save table::io::Persistable objects.
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...
static PersistableFactory const & lookup(std::string const &name, std::string const &module="")
Return the factory that has been registered with the given name.
PersistableFactory(std::string const &name)
Constructor for the factory.
static bool import(std::string const &name)