Hdf4Pager.h

Go to the documentation of this file.
00001 /*
00002  * The information in this file is
00003  * Copyright(c) 2007 Ball Aerospace & Technologies Corporation
00004  * and is subject to the terms and conditions of the
00005  * GNU Lesser General Public License Version 2.1
00006  * The license text is available from   
00007  * http://www.gnu.org/licenses/lgpl.html
00008  */
00009 
00010 #ifndef HDF4PAGER_H
00011 #define HDF4PAGER_H
00012 
00013 #include "AppConfig.h"
00014 
00015 #include "HdfPager.h"
00016 
00017 #include <hdf.h>
00018 #include <mfhdf.h>
00019 
00020 /**
00021  * This class is an on-disk accessor for HDF4 files.
00022  *
00023  * Under current conditions, no one will need to derive from Hdf4Pager unless
00024  * multiple HDF datasets correspond to a single data cube or the
00025  * data interleave is BIL, which is currently not natively supported.
00026  */
00027 class Hdf4Pager : public HdfPager
00028 {
00029 public:
00030    /**
00031     * Creates an RasterPager for HDF4 data.
00032     *
00033     * If you create a subclass, make sure to call setName() to something unique. Two plug-ins with
00034     * the same name will cause problems.
00035     */
00036    Hdf4Pager();
00037 
00038    /**
00039     * Destroys the RasterPager for HDF4 data.
00040     *
00041     * Closes the file and dataset that was opened by openFile().
00042     */
00043    ~Hdf4Pager();
00044 
00045 private:
00046    Hdf4Pager& operator=(const Hdf4Pager& rhs);
00047 
00048    // file and data handles.
00049    int mFileHandle;
00050    int32 mDataHandle;
00051 
00052    /**
00053     * Opens the HDF4 file and dataset.
00054     *
00055     * Opens the HDF4 file by calling SDstart(filename.c_str()).
00056     * Opens the HDF4 data handle by calling getHdfDatasetName() and SDnametoindex(datasetName)
00057     * and SDselect on the resulting dataset index.
00058     */
00059    bool openFile(const std::string& filename);
00060 
00061    /**
00062     * Closes the HDF4 dataset and file handles.
00063     */
00064    void closeFile();
00065 
00066    /**
00067     *  Fetches a CacheUnit from an HDF4 file.
00068     */
00069    CachedPage::UnitPtr fetchUnit(DataRequest *pOriginalRequest);
00070 
00071 };
00072 
00073 #endif

Software Development Kit - Opticks 4.9.0 Build 16218