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 HDF5DATASET_H 00011 #define HDF5DATASET_H 00012 00013 #include "EnumWrapper.h" 00014 #include "Hdf5CustomReader.h" 00015 #include "Hdf5Data.h" 00016 #include "Hdf5Element.h" 00017 #include "Hdf5Resource.h" 00018 #include "TypesFile.h" 00019 00020 #include <hdf5.h> 00021 00022 #include <memory> 00023 #include <string> 00024 00025 class Hdf5Dataset : public Hdf5Element, public Hdf5Data 00026 { 00027 public: 00028 /** 00029 * Gets whether the dataset is compound or not. 00030 * 00031 * Compound datasets have no data encoding (UNKNOWN), 0 per element, and 0 count. 00032 * If this function returns true, HdfPlugInLib will not have parsed the dataset because 00033 * the HdfPlugInLib does not support loading compound datasets. 00034 * 00035 * @return Returns whether the dataset is a compound dataset (ie. vdata) or not. 00036 */ 00037 bool isCompoundDataset() const; 00038 00039 /** 00040 * Gets the data encoding type for the HDF dataset. 00041 * 00042 * For non-native types or compound datasets, EncodingType will not be valid (EncodingType.isValid()). 00043 * 00044 * @param encoding 00045 * The data encoding type that corresponds to the member string. 00046 * For those types that do not correspond to an EncodingType (ie. a compound dataset), 00047 * the EncodingType will not be valid. 00048 * 00049 */ 00050 void getDataEncoding(EncodingType& encoding) const; 00051 00052 protected: 00053 // The Hdf5Group must be a friend so the Hdf5Group can delete and create Hdf5Datasets 00054 friend class Hdf5Group; 00055 00056 /** 00057 * Creates an Hdf5Dataset object that represents the data set object of an HDF file. 00058 * 00059 * To create a dataset, use Hdf5Group::addDataset(). 00060 */ 00061 explicit Hdf5Dataset(Hdf5Element* pParent, const std::string& name); 00062 00063 /** 00064 * Destroys the Hdf5Dataset object. 00065 * 00066 * To destroy an %Hdf5Dataset from a group, call Hdf5Group::removeDataset(). 00067 */ 00068 virtual ~Hdf5Dataset(); 00069 00070 Hdf5Data::DataReader* createReader() const; 00071 }; 00072 00073 #endif