lsst.afw  13.0-109-g62eb66483
Public Member Functions | Static Public Member Functions | Protected Types | List of all members
lsst::afw::table::io::PersistableFactory Class Referenceabstract

A base class for factory classes used to reconstruct objects from records. More...

#include <Persistable.h>

Inheritance diagram for lsst::afw::table::io::PersistableFactory:
lsst::afw::detection::FootprintFactory lsst::afw::detection::HeavyFootprint< ImagePixelT, MaskPixelT, VariancePixelT >::Factory lsst::afw::image::WcsFactory lsst::afw::math::AnalyticKernel::Factory lsst::afw::math::DeltaFunctionKernel::Factory lsst::afw::math::FixedKernel::Factory lsst::afw::math::LinearCombinationKernel::Factory

Public Member Functions

 PersistableFactory (std::string const &name)
 Constructor for the factory. More...
 
virtual std::shared_ptr< Persistable > read (InputArchive const &archive, CatalogVector const &catalogs) const =0
 Construct a new object from the given InputArchive and vector of catalogs. More...
 
virtual ~PersistableFactory ()
 
 PersistableFactory (const PersistableFactory &)=delete
 
PersistableFactory & operator= (const PersistableFactory &)=delete
 
 PersistableFactory (PersistableFactory &&)=delete
 
PersistableFactory & operator= (PersistableFactory &&)=delete
 

Static Public Member Functions

static PersistableFactory const & lookup (std::string const &name, std::string const &module="")
 Return the factory that has been registered with the given name. More...
 

Protected Types

typedef io::InputArchive InputArchive
 
typedef io::CatalogVector CatalogVector
 

Detailed Description

A base class for factory classes used to reconstruct objects from records.

Classes that inherit from Persistable should also subclass PersistableFactory, and instantiate exactly one instance of the derived factory with static duration (usually the class and instance are both defined in an anonymous namespace in a source file).

Definition at line 214 of file Persistable.h.

Member Typedef Documentation

◆ CatalogVector

Definition at line 217 of file Persistable.h.

◆ InputArchive

Definition at line 216 of file Persistable.h.

Constructor & Destructor Documentation

◆ PersistableFactory() [1/3]

lsst::afw::table::io::PersistableFactory::PersistableFactory ( std::string const &  name)
explicit

Constructor for the factory.

This should be called only once, and only on an object with static duration, as a pointer to the object will be put in a singleton registry.

The name must be globally unique with respect to all Persistables and be the same as Persistable::getPersistenceName(); the Python module that a Persistable may also declare is not used to resolve names, but rather just to import the module that may install the necessary factory in the registry.

◆ ~PersistableFactory()

virtual lsst::afw::table::io::PersistableFactory::~PersistableFactory ( )
inlinevirtual

Definition at line 246 of file Persistable.h.

◆ PersistableFactory() [2/3]

lsst::afw::table::io::PersistableFactory::PersistableFactory ( const PersistableFactory &  )
delete

◆ PersistableFactory() [3/3]

lsst::afw::table::io::PersistableFactory::PersistableFactory ( PersistableFactory &&  )
delete

Member Function Documentation

◆ lookup()

static PersistableFactory const& lsst::afw::table::io::PersistableFactory::lookup ( std::string const &  name,
std::string const &  module = "" 
)
static

Return the factory that has been registered with the given name.

If the lookup fails and module is not an empty string, we will attempt to import a Python module with that name (this will only work when the C++ is being called from Python) and try again.

◆ operator=() [1/2]

PersistableFactory& lsst::afw::table::io::PersistableFactory::operator= ( const PersistableFactory &  )
delete

◆ operator=() [2/2]

PersistableFactory& lsst::afw::table::io::PersistableFactory::operator= ( PersistableFactory &&  )
delete

◆ read()

virtual std::shared_ptr<Persistable> lsst::afw::table::io::PersistableFactory::read ( InputArchive const &  archive,
CatalogVector const &  catalogs 
) const
pure virtual

The documentation for this class was generated from the following file: