RMF
Toggle main menu visibility
ConstFile.h
Go to the documentation of this file.
1
/**
2
* \file RMF/HDF5/ConstFile.h
3
* \brief Handle read/write of Model data from/to files.
4
*
5
* Copyright 2007-2022 IMP Inventors. All rights reserved.
6
*
7
*/
8
9
#ifndef RMF_HDF5_CONST_FILE_H
10
#define RMF_HDF5_CONST_FILE_H
11
12
#include "RMF/config.h"
13
#include "
ConstGroup.h
"
14
15
RMF_ENABLE_WARNINGS
16
17
namespace
RMF
{
18
namespace
HDF5
{
19
20
/** Store a handle to a non-writable HDF5 file. See
21
\external{https://docs.hdfgroup.org/releases/hdf5/v1_14/v1_14_4/documentation/doxygen/group___h5_f.html,
22
the HDF5 manual} for more information.
23
24
\note At the moment, a given file can only be opened once within a
25
a process. This can be fixed if there is demand.
26
*/
27
class
RMFEXPORT ConstFile :
public
ConstGroup {
28
public
:
29
#if !defined(RMF_DOXYGEN) && !defined(SWIG)
30
ConstFile(std::shared_ptr<SharedHandle> h);
31
#endif
32
ConstFile(
File
f);
33
ConstFile() {}
34
RMF_SHOWABLE(ConstFile,
"ConstFile "
<< get_name());
35
std::string get_name()
const
;
36
~ConstFile();
37
};
38
39
/** Open an existing HDF5 file read only. The file cannot already
40
be open.
41
*/
42
RMFEXPORT
ConstFile
open_file_read_only
(std::string name);
43
44
/** */
45
typedef
std::vector<Group> ConstGroups;
46
/** */
47
typedef
std::vector<File> ConstFiles;
48
49
/** For debugging, one can get the number of open HDF5 handles for either
50
one file, or the whole system.*/
51
RMFEXPORT
int
get_number_of_open_handles
(
ConstFile
f =
ConstFile
());
52
/** For debugging you can get the names of open handles in either one file
53
or the whole process.*/
54
RMFEXPORT
Strings
get_open_handle_names
(
ConstFile
f =
ConstFile
());
55
56
/** Turn on and off printing of HDF5 error messages. They can help in
57
diagnostics, but, for the moment, can only be output to standard
58
error and so are off by default.
59
*/
60
RMFEXPORT
void
set_show_errors
(
bool
tf);
61
62
}
/* namespace HDF5 */
63
}
/* namespace RMF */
64
65
RMF_DISABLE_WARNINGS
66
67
#endif
/* RMF_HDF5_CONST_FILE_H */
ConstGroup.h
Handle read/write of Model data from/to files.
RMF::HDF5::ConstFile
Definition
ConstFile.h:27
RMF::HDF5::File
Definition
File.h:55
RMF::HDF5
The namespace for all HDF5 functionality in the library.
Definition
ConstAttributes.h:21
RMF::HDF5::open_file_read_only
ConstFile open_file_read_only(std::string name)
RMF::HDF5::set_show_errors
void set_show_errors(bool tf)
RMF::HDF5::Strings
std::vector< String > Strings
Definition
HDF5/types.h:46
RMF::HDF5::get_open_handle_names
Strings get_open_handle_names(ConstFile f=ConstFile())
RMF::HDF5::get_number_of_open_handles
int get_number_of_open_handles(ConstFile f=ConstFile())
RMF
The namespace for all functionality in the library.
Definition
BufferConstHandle.h:21