LSSTApplications  10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
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 boost::shared_ptr< T > readFits (fits::Fits &fitsfile)
 Read an object from an already open FITS object. More...
 
static boost::shared_ptr< T > readFits (std::string const &fileName, int hdu=0)
 Read an object from a regular FITS file. More...
 
static boost::shared_ptr< T > readFits (fits::MemFileManager &manager, int hdu=0)
 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 182 of file Persistable.h.

Member Function Documentation

template<typename T>
static boost::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 192 of file Persistable.h.

192  {
193  return boost::dynamic_pointer_cast<T>(Persistable::_readFits(fitsfile));
194  }
static boost::shared_ptr< Persistable > _readFits(std::string const &fileName, int hdu=0)
template<typename T>
static boost::shared_ptr< T > lsst::afw::table::io::PersistableFacade< T >::readFits ( std::string const &  fileName,
int  hdu = 0 
)
inlinestatic

Read an object from a regular FITS file.

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

Definition at line 205 of file Persistable.h.

205  {
206  return boost::dynamic_pointer_cast<T>(Persistable::_readFits(fileName, hdu));
207  }
static boost::shared_ptr< Persistable > _readFits(std::string const &fileName, int hdu=0)
template<typename T>
static boost::shared_ptr< T > lsst::afw::table::io::PersistableFacade< T >::readFits ( fits::MemFileManager manager,
int  hdu = 0 
)
inlinestatic

Read an object from a FITS file in memory.

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

Definition at line 216 of file Persistable.h.

216  {
217  return boost::dynamic_pointer_cast<T>(Persistable::_readFits(manager, hdu));
218  }
static boost::shared_ptr< Persistable > _readFits(std::string const &fileName, int hdu=0)

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