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
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
lsst::afw::table::io::InputArchive Class Reference

A multi-catalog archive object used to load table::io::Persistable objects. More...

#include <InputArchive.h>

Public Types

typedef std::map< int,
boost::shared_ptr< Persistable > > 
Map
 

Public Member Functions

 InputArchive ()
 Construct an empty InputArchive that contains no objects. More...
 
 InputArchive (BaseCatalog const &index, CatalogVector const &dataCatalogs)
 Construct an archive from catalogs. More...
 
 InputArchive (InputArchive const &other)
 Copy-constructor. Does not deep-copy loaded Persistables. More...
 
InputArchiveoperator= (InputArchive const &other)
 Assignment. Does not deep-copy loaded Persistables. More...
 
 ~InputArchive ()
 
boost::shared_ptr< Persistableget (int id) const
 Load the Persistable with the given ID and return it. More...
 
template<typename T >
boost::shared_ptr< T > get (int id) const
 Load an object of the given type and ID with error checking. More...
 
Map const & getAll () const
 Load and return all objects in the archive. More...
 

Static Public Member Functions

static InputArchive readFits (fits::Fits &fitsfile)
 Read an object from an already open FITS object. More...
 

Private Member Functions

 InputArchive (boost::shared_ptr< Impl > impl)
 

Private Attributes

boost::shared_ptr< Impl > _impl
 

Detailed Description

A multi-catalog archive object used to load table::io::Persistable objects.

An InputArchive can be constructed directly from the catalogs produced by OutputArchive, or more usefully, read from a multi-extension FITS file.

See Also
OutputArchive

Definition at line 28 of file InputArchive.h.

Member Typedef Documentation

typedef std::map<int,boost::shared_ptr< Persistable > > lsst::afw::table::io::InputArchive::Map

Definition at line 31 of file InputArchive.h.

Constructor & Destructor Documentation

lsst::afw::table::io::InputArchive::InputArchive ( )

Construct an empty InputArchive that contains no objects.

lsst::afw::table::io::InputArchive::InputArchive ( BaseCatalog const &  index,
CatalogVector const &  dataCatalogs 
)

Construct an archive from catalogs.

lsst::afw::table::io::InputArchive::InputArchive ( InputArchive const &  other)

Copy-constructor. Does not deep-copy loaded Persistables.

lsst::afw::table::io::InputArchive::~InputArchive ( )
lsst::afw::table::io::InputArchive::InputArchive ( boost::shared_ptr< Impl >  impl)
private

Member Function Documentation

boost::shared_ptr< Persistable > lsst::afw::table::io::InputArchive::get ( int  id) const

Load the Persistable with the given ID and return it.

If the object has already been loaded once, the same instance will be returned again.

template<typename T >
boost::shared_ptr< T > lsst::afw::table::io::InputArchive::get ( int  id) const
inline

Load an object of the given type and ID with error checking.

Definition at line 56 of file InputArchive.h.

56  {
57  PTR(T) p = boost::dynamic_pointer_cast<T>(get(id));
58  LSST_ARCHIVE_ASSERT(p || id == 0);
59  return p;
60  }
#define PTR(...)
Definition: base.h:41
#define LSST_ARCHIVE_ASSERT(EXPR)
An assertion macro used to validate the structure of an InputArchive.
Definition: Persistable.h:47
boost::shared_ptr< Persistable > get(int id) const
Load the Persistable with the given ID and return it.
Map const& lsst::afw::table::io::InputArchive::getAll ( ) const

Load and return all objects in the archive.

InputArchive& lsst::afw::table::io::InputArchive::operator= ( InputArchive const &  other)

Assignment. Does not deep-copy loaded Persistables.

static InputArchive lsst::afw::table::io::InputArchive::readFits ( fits::Fits fitsfile)
static

Read an object from an already open FITS object.

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

Member Data Documentation

boost::shared_ptr< Impl > lsst::afw::table::io::InputArchive::_impl
private

Definition at line 78 of file InputArchive.h.


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