lsst.afw  13.0-100-ge0459d59f+2
Static Public Member Functions | List of all members
lsst::afw::table::io::PersistableFacade< T > Class Template Reference

A CRTP facade class for subclasses of Persistable. More...

#include <Persistable.h>

Static Public Member Functions

static std::shared_ptr< T > readFits (fits::Fits &fitsfile)
 Read an object from an already open FITS object. More...
 
static std::shared_ptr< T > readFits (std::string const &fileName, int hdu=INT_MIN)
 Read an object from a regular FITS file. More...
 
static std::shared_ptr< T > readFits (fits::MemFileManager &manager, int hdu=INT_MIN)
 Read an object from a FITS file in memory. More...
 

Detailed Description

template<typename T>
class lsst::afw::table::io::PersistableFacade< T >

A CRTP facade class for subclasses of Persistable.

Derived classes should generally inherit from PersistableFacade at all levels, but only inherit from Persistable via the base class of each hierarchy. For example, with Psfs:

class Psf: public PersistableFacade<Psf>, public Persistable { ... };
class DoubleGaussianPsf: public PersistableFacade<DoubleGaussianPsf>, public Psf { ... };

Inheriting from PersistableFacade is not required for any classes but the base of each hierarchy, but doing so can save users from having to do some dynamic_casts.

Note
PersistableFacade should usually be the first class in a list of base classes; if it appears after a base class that inherits from different specialization of PersistableFacade, those base class member functions will hide the desired ones.

Definition at line 173 of file Persistable.h.

Member Function Documentation

◆ readFits() [1/3]

template<typename T>
static std::shared_ptr<T> lsst::afw::table::io::PersistableFacade< T >::readFits ( fits::Fits &  fitsfile)
inlinestatic

Read an object from an already open FITS object.

Parameters
[in]fitsfileFITS object to read from, already positioned at the desired HDU.

Definition at line 180 of file Persistable.h.

◆ readFits() [2/3]

template<typename T>
static std::shared_ptr<T> lsst::afw::table::io::PersistableFacade< T >::readFits ( std::string const &  fileName,
int  hdu = INT_MIN 
)
inlinestatic

Read an object from a regular FITS file.

Parameters
[in]fileNameName of the file to read.
[in]hduHDU to read, where 0 is the primary. The special value of INT_MIN skips the primary HDU if it is empty.

Definition at line 191 of file Persistable.h.

◆ readFits() [3/3]

template<typename T>
static std::shared_ptr<T> lsst::afw::table::io::PersistableFacade< T >::readFits ( fits::MemFileManager &  manager,
int  hdu = INT_MIN 
)
inlinestatic

Read an object from a FITS file in memory.

Parameters
[in]managerManager for the memory to read from.
[in]hduHDU to read, where 0 is the primary. The special value of INT_MIN skips the primary HDU if it is empty.

Definition at line 202 of file Persistable.h.


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