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 | Private Attributes | List of all members
lsst::daf::persistence::FitsStorage Class Reference

Class for FITS file storage. More...

#include <FitsStorage.h>

Inheritance diagram for lsst::daf::persistence::FitsStorage:
lsst::daf::persistence::Storage lsst::daf::base::Citizen

Public Types

typedef boost::shared_ptr
< FitsStorage
Ptr
 
- Public Types inherited from lsst::daf::persistence::Storage
typedef boost::shared_ptr
< Storage
Ptr
 
typedef std::vector< PtrList
 
- Public Types inherited from lsst::daf::base::Citizen
enum  { magicSentinel = 0xdeadbeef }
 
typedef unsigned long memId
 Type of the block's ID. More...
 
typedef memId(* memNewCallback )(const memId cid)
 A function used to register a callback. More...
 
typedef memId(* memCallback )(const Citizen *ptr)
 

Public Member Functions

 FitsStorage (void)
 
virtual ~FitsStorage (void)
 
virtual void setPolicy (lsst::pex::policy::Policy::Ptr policy)
 
virtual void setPersistLocation (LogicalLocation const &location)
 
virtual void setRetrieveLocation (LogicalLocation const &location)
 
virtual void startTransaction (void)
 
virtual void endTransaction (void)
 
virtual std::string const & getPath (void)
 
virtual int getHdu (void)
 
- Public Member Functions inherited from lsst::daf::persistence::Storage
virtual ~Storage (void)
 
- Public Member Functions inherited from lsst::daf::base::Citizen
 Citizen (const std::type_info &)
 
 Citizen (Citizen const &)
 
 ~Citizen ()
 
Citizenoperator= (Citizen const &)
 
std::string repr () const
 Return a string representation of a Citizen. More...
 
void markPersistent (void)
 Mark a Citizen as persistent and not destroyed until process end. More...
 
memId getId () const
 Return the Citizen's ID. More...
 

Private Attributes

std::string _path
 
int _hdu
 

Additional Inherited Members

- Static Public Member Functions inherited from lsst::daf::persistence::Storage
static Ptr createInstance (std::string const &name, LogicalLocation const &location, bool persist, lsst::pex::policy::Policy::Ptr policy)
 
- Static Public Member Functions inherited from lsst::daf::base::Citizen
static bool hasBeenCorrupted ()
 Check all allocated blocks for corruption. More...
 
static memId getNextMemId ()
 Return the memId of the next object to be allocated. More...
 
static int init ()
 Called once when the memory system is being initialised. More...
 
static int census (int, memId startingMemId=0)
 How many active Citizens are there? More...
 
static void census (std::ostream &stream, memId startingMemId=0)
 Print a list of all active Citizens to stream, sorted by ID. More...
 
static const std::vector
< const Citizen * > * 
census ()
 Return a (newly allocated) std::vector of active Citizens sorted by ID. More...
 
static memId setNewCallbackId (memId id)
 Call the NewCallback when block is allocated. More...
 
static memId setDeleteCallbackId (memId id)
 Call the current DeleteCallback when block is deleted. More...
 
static memNewCallback setNewCallback (memNewCallback func)
 Set the NewCallback function. More...
 
static memCallback setDeleteCallback (memCallback func)
 Set the DeleteCallback function. More...
 
static memCallback setCorruptionCallback (memCallback func)
 Set the CorruptionCallback function. More...
 
- Protected Member Functions inherited from lsst::daf::persistence::Storage
 Storage (std::type_info const &type)
 
void verifyPathName (std::string const &pathName)
 

Detailed Description

Class for FITS file storage.

Merely maintains pathname and HDU number for Formatter subclasses to use.

Definition at line 52 of file FitsStorage.h.

Member Typedef Documentation

Definition at line 54 of file FitsStorage.h.

Constructor & Destructor Documentation

lsst::daf::persistence::FitsStorage::FitsStorage ( void  )

Constructor.

Definition at line 55 of file FitsStorage.cc.

55  : Storage(typeid(*this)) {
56 }
Storage(std::type_info const &type)
Definition: Storage.cc:60
lsst::daf::persistence::FitsStorage::~FitsStorage ( void  )
virtual

Destructor.

Definition at line 60 of file FitsStorage.cc.

60  {
61 }

Member Function Documentation

void lsst::daf::persistence::FitsStorage::endTransaction ( void  )
virtual

End a transaction. No transaction support for now.

Implements lsst::daf::persistence::Storage.

Definition at line 103 of file FitsStorage.cc.

103  {
104 }
int lsst::daf::persistence::FitsStorage::getHdu ( void  )
virtual

Return the HDU to read from the FITS file.

Returns
Number of the HDU, PDU = 0

Definition at line 116 of file FitsStorage.cc.

116  {
117  return _hdu;
118 }
std::string const & lsst::daf::persistence::FitsStorage::getPath ( void  )
virtual

Return the pathname for the FITS file.

Returns
Pathname

Definition at line 109 of file FitsStorage.cc.

109  {
110  return _path;
111 }
void lsst::daf::persistence::FitsStorage::setPersistLocation ( LogicalLocation const &  location)
virtual

Set the destination of the FITS file for persistence.

Parameters
[in]locationPathname to write to.

Implements lsst::daf::persistence::Storage.

Definition at line 72 of file FitsStorage.cc.

72  {
73  _path = location.locString();
74  _hdu = 0;
76 }
void verifyPathName(std::string const &pathName)
Definition: Storage.cc:93
void lsst::daf::persistence::FitsStorage::setPolicy ( lsst::pex::policy::Policy::Ptr  policy)
virtual

Allow a Policy to be used to configure the FitsStorage.

Parameters
[in]policy

Implements lsst::daf::persistence::Storage.

Definition at line 66 of file FitsStorage.cc.

66  {
67 }
void lsst::daf::persistence::FitsStorage::setRetrieveLocation ( LogicalLocation const &  location)
virtual

Set the source of the FITS file for retrieval.

Parameters
[in]locationPathname to read from, optionally followed by bracketed HDU number.

Implements lsst::daf::persistence::Storage.

Definition at line 82 of file FitsStorage.cc.

82  {
83  _path = location.locString();
84  size_t loc = _path.find_last_of('[');
85  if (loc == std::string::npos) {
86  _hdu = 0;
87  }
88  else {
89  // HDUs for setHdu() are off by one from bracket extensions.
90  _hdu = strtol(_path.substr(loc + 1).c_str(), 0, 10) + 1;
91  }
92 }
void lsst::daf::persistence::FitsStorage::startTransaction ( void  )
virtual

Start a transaction. No transaction support for now.

Implements lsst::daf::persistence::Storage.

Definition at line 97 of file FitsStorage.cc.

97  {
98 }

Member Data Documentation

int lsst::daf::persistence::FitsStorage::_hdu
private

Definition at line 71 of file FitsStorage.h.

std::string lsst::daf::persistence::FitsStorage::_path
private

Definition at line 70 of file FitsStorage.h.


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