Data Access Library (DAL)
|
00001 /* Copyright 2011-2012 ASTRON, Netherlands Institute for Radio Astronomy 00002 * This file is part of the Data Access Library (DAL). 00003 * 00004 * This library is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU Lesser General Public 00006 * License as published by the Free Software Foundation; either 00007 * version 3 of the License, or (at your option) any later version. 00008 * 00009 * This library is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 * Lesser General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU Lesser General Public 00015 * License along with this library. If not, see <http://www.gnu.org/licenses/>. 00016 */ 00017 #ifndef DAL_FILE_H 00018 #define DAL_FILE_H 00019 00020 #include <string> 00021 #include <hdf5.h> 00022 #include "types/versiontype.h" 00023 #include "Group.h" 00024 #include "Attribute.h" 00025 00026 namespace dal { 00027 00042 class File: public Group { 00043 public: 00049 File(); 00050 00073 File( const std::string &filename, FileMode mode = READ, const std::string &versionAttrName = ""); 00074 00078 virtual ~File(); 00079 00085 File& operator=(File rhs); 00086 00091 friend void swap(File& first, File& second); 00092 00101 virtual void open( const std::string &filename, FileMode mode = READ, const std::string &versionAttrName = ""); 00102 00109 virtual void close(); 00110 00114 void flush(); 00115 00119 virtual bool exists() const; 00120 00160 Attribute<VersionType> version(); 00161 00162 private: 00163 hid_gc openFile( const std::string &filename, FileMode mode ) const; 00164 void initFileNodes(); 00165 }; 00166 00167 } 00168 00169 #endif 00170